一厂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.

60 lines
1.7 KiB

3 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.DAL;
using MESClassLibrary.DAL.ZPPlan;
using MESClassLibrary.EFModel;
namespace MESClassLibrary.BLL.ZPPlan
{
public class ScanRecordBLL
{
BasicBLL<tb_ScanRecord> db=new BasicBLL<tb_ScanRecord>();
ScanRecordDAL da=new ScanRecordDAL();
public bool AddInfo(tb_ScanRecord md)
{
try
{
string sql =
@"insert into tb_ScanRecord (BarCode,StationID) values (@BarCode,@StationID)";
SqlParameter[] param = new SqlParameter[2];
param[0] = new SqlParameter("@BarCode", SqlDbType.VarChar);
param[0].Value = md.BarCode;
param[1] = new SqlParameter("@StationID", SqlDbType.VarChar);
param[1].Value = md.StationID;
SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param);
return true;
//return db.AddInfo(md);
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod());
return false;
}
}
public int IsScan(string barcode,string stationID)
{
try
{
return da.IsScan(barcode, stationID);
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return 1;
}
}
}
}