一厂MES,含注塑,喷涂,冲孔
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

93 lines
3.2 KiB

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Reflection;
using System.Text;
using MESClassLibrary.BLL.Log;
using MESClassLibrary.Model;
namespace MESClassLibrary.DAL.ExchangeCenter
{
public class TESPartDetDAL
{
public static string TableName = "TES_PART_DET";
public bool AddInfo(TESPartDetModel md)
{
try
{
string sql = "";
SqlParameter[] param = null;
sql = "INSERT INTO " + TableName + " ([GUID],[PartCode],[Site],[KeyPart],SetupTime,UID,CreateUser,CreateTime,Remark,TaskID,CommandType,DataID,Domain";
sql += ") VALUES (";
sql += "@GUID,";
sql += "@PartCode,";
sql += "@Site,";
sql += "@KeyPart,";
sql += "@SetupTime,";
sql += "@UID,";
sql += "@CreateUser,";
sql += "@CreateTime,";
sql += "@Remark,";
sql += "@TaskID,";
sql += "@CommandType,";
sql += "@DataID,";
sql += "@Domain)";
#region 添加参数
param = new SqlParameter[13];
param[0] = new SqlParameter("@GUID", SqlDbType.VarChar);
param[0].Value = md.GUID;
param[1] = new SqlParameter("@PartCode", SqlDbType.VarChar);
param[1].Value = md.PartCode;
param[2] = new SqlParameter("@Site", SqlDbType.VarChar);
param[2].Value = md.Site;
param[3] = new SqlParameter("@KeyPart", SqlDbType.VarChar);
param[3].Value = md.KeyPart;
param[4] = new SqlParameter("@SetupTime", SqlDbType.VarChar);
param[4].Value = md.SetupTime;
param[5] = new SqlParameter("@UID", SqlDbType.VarChar);
param[5].Value = md.UID;
param[6] = new SqlParameter("@CreateUser", SqlDbType.VarChar);
param[6].Value = md.CreateUser;
param[7] = new SqlParameter("@CreateTime", SqlDbType.VarChar);
param[7].Value = md.CreateTime;
param[8] = new SqlParameter("@Remark", SqlDbType.VarChar);
param[8].Value = md.Remark;
param[9] = new SqlParameter("@TaskID", SqlDbType.VarChar);
param[9].Value = md.TaskID;
param[10] = new SqlParameter("@CommandType", SqlDbType.VarChar);
param[10].Value = md.CommandType;
param[11] = new SqlParameter("@DataID", SqlDbType.VarChar);
param[11].Value = md.DataID;
param[12] = new SqlParameter("@Domain", SqlDbType.VarChar);
param[12].Value = md.Domain;
#endregion
SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param);
return true;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
}
}
}