注塑喷涂
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.
 
 
 
 
 

68 lines
2.0 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.Andon
{
public class AndonButtonRecordDAL
{
public bool InsertInfo(AndonRecordModel md)
{
try
{
string sql = "";
SqlParameter[] param = null;
sql = " insert into tb_AndonRecord(ID,ButtonTypeID";
sql += ") VALUES (";
sql += "@ID,";
sql += "@ButtonTypeID)";
param = new SqlParameter[2];
param[0] = new SqlParameter("@ID", SqlDbType.VarChar);
param[0].Value = md.ID;
param[1] = new SqlParameter("@ButtonTypeID", SqlDbType.VarChar);
param[1].Value = md.ButtonTypeID;
SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param);
return true;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
}
public bool UpdateInfo(AndonRecordModel md)
{
try
{
string sql = "";
SqlParameter[] param = null;
sql =@"update tb_AndonRecord set EndTime=getdate() where ButtonTypeID=@ButtonTypeID and EndTime is null";
param=new SqlParameter[1];
param[0] = new SqlParameter("@ButtonTypeID", SqlDbType.VarChar);
param[0].Value = md.ButtonTypeID;
SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param);
return true;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
}
}
}