using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using MESClassLibrary.BLL.Log; using MESClassLibrary.DAL.TruckBox; using MESClassLibrary.EFModel; namespace MESClassLibrary.BLL.TruckBox { public class InspectionBLL { InspectionDAL da=new InspectionDAL(); BasicBLL db=new BasicBLL(); public bool AddInfo(tb_Inspection_tx md) { try { return da.AddInfo(md); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod()); return false; } } public List SearchInfoByBarCode(string barCode) { try { //return Tool.ConvertTo< tb_Inspection_tx >(da.SearchInfoByCode(barCode)).ToList(); return db.SearchAllInfo().Where(p => p.BarCode==barCode).OrderByDescending(p => p.ID).Take(1) .ToList(); } catch (Exception ex) { LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod()); return null; } } } }