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; using MESClassLibrary.Model; namespace MESClassLibrary.BLL.ZPPlan { public class ZPRecordBLL { ZPRecordDAL da=new ZPRecordDAL(); public bool AddInfo(tb_ZPRecord md) { try { string sql = @"insert into tb_ZPRecord (OneBarCode,PlanID) values (@OneBarCode,@PlanID)"; SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@OneBarCode", SqlDbType.VarChar); param[0].Value = md.OneBarCode; param[1] = new SqlParameter("@PlanID", SqlDbType.VarChar); param[1].Value = md.PlanID; SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param); return true; //return da.AddInfo(md); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return false; } } public bool AddZcInfo(tb_ZPRecord md) { try { return da.AddZcInfo(md); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return false; } } public DataTable SearchInfo(string barCode) { try { return da.SearchInfo(barCode); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } public DataTable SearchZcInfo(string batchNo) { try { return da.SearchZcInfo(batchNo); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } public DataTable SearchInfobyone(string barCode) { try { return da.SearchInfobyOne(barCode); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } public DataTable SearchPrint(string planID) { try { return da.SearchPrint(planID); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } public DataTable SearchBarCode(string stockNo,string batch) { try { return da.SearchBarCode(stockNo, batch); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } public bool UpdatePrint(ZPRecordModel md) { try { return da.UpdatePrintOK(md); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return false; } } public bool UpdateBad(ZPRecordModel md) { try { return da.UpdateBad(md); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return false; } } public DataTable SearchBarCode(string barCode) { try { return da.SearchBarCode(barCode); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } public bool AddBudaInfo(ZPRecordModel md) { try { return da.AddBudaInfo(md); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return false; } } public DataTable GetCountByPartNo(string partNo) { try { return da.GetCountByPartNo(partNo); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return null; } } public bool UpdateBox(string partNo, string boxNo) { try { return da.UpdateBox(partNo, boxNo); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); return false; } } public string GetPrintCount(string startTime, string endTime) { try { return da.GetPrintCount(startTime, endTime); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod()); return "0"; } } } }