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.
53 lines
1.6 KiB
53 lines
1.6 KiB
9 months ago
|
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.PunchAndWeld
|
||
|
{
|
||
|
public class PunchValueRecordDAL
|
||
|
{
|
||
|
public bool AddInfo(PunchValueRecordModel md)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
string sql = "";
|
||
|
SqlParameter[] param = null;
|
||
|
sql = " insert into tb_PunchValueRecord(ID,DeviceNo,Address,ItemValue";
|
||
|
sql += ") VALUES (";
|
||
|
sql += "@ID,";
|
||
|
sql += "@DeviceNo,";
|
||
|
sql += "@Address,";
|
||
|
sql += "@ItemValue)";
|
||
|
|
||
|
param = new SqlParameter[4];
|
||
|
param[0] = new SqlParameter("@ID", SqlDbType.VarChar);
|
||
|
param[0].Value = md.ID;
|
||
|
|
||
|
param[1] = new SqlParameter("@DeviceNo", SqlDbType.VarChar);
|
||
|
param[1].Value = md.DeviceNo;
|
||
|
|
||
|
param[2] = new SqlParameter("@Address", SqlDbType.VarChar);
|
||
|
param[2].Value = md.Address;
|
||
|
|
||
|
param[3] = new SqlParameter("@ItemValue", SqlDbType.VarChar);
|
||
|
param[3].Value = md.ItemValue;
|
||
|
|
||
|
SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param);
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
catch (Exception ex)
|
||
|
{
|
||
|
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|