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 db=new BasicBLL(); 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; } } } }