using System; using System.Collections.Generic; using System.Linq; using System.Text; using ICSSoft.Frame.Data.Entity; using ICSSoft.Frame.Data.DAL; using System.Data; namespace ICSSoft.Frame.Data.BLL { public class ICSPalletBLL { public static DataTable SearchItemInfoList(string dsconn) { try { DataTable returndt = new DataTable(); returndt.Columns.Add("箱号guid", typeof(string)); returndt.Columns.Add("箱号", typeof(string)); List returndal = ICSPalletDAL.SearchItemInfoList(dsconn); foreach (FormICSPalletModel returntype in returndal) { DataRow dr = returndt.NewRow(); dr["guid"] = returntype.ID; dr["箱号"] = returntype.PalletCode; //dr["规格型号"] = returntype.INVDESC; returndt.Rows.Add(dr); } return returndt; } catch (Exception ex) { throw ex; } } #region 关联批次 public static void AddandEdit(DataTable dt,string PalletCode, string Appconstr) { try { ICSPalletDAL.AddandEdit(dt,PalletCode, Appconstr); } catch (Exception ex) { throw ex; } } #endregion #region 新增和修改 public static void Add(FormICSPalletModel Info, string dsconn) { try { if (string.IsNullOrWhiteSpace(dsconn)) { throw new Exception("数据库连接字符串错误"); } List InfoList = new List() { Info }; ICSPalletDAL.Add(InfoList, dsconn); } catch (Exception ex) { throw ex; } } #endregion #region 代码是否存在 public static bool IsIncluding(string PalletCode, string dsconn) { try { return ICSPalletDAL.IsIncluding(PalletCode, dsconn); } catch (Exception ex) { throw ex; } } #endregion #region 根据存货编码查找id public static string SearchIDbyItemcode(string PalletCode, string dsconn) { try { return ICSPalletDAL.SearchIDbyItemcode(PalletCode, dsconn); } catch (Exception ex) { throw ex; } } #endregion #region 删除 public static void deleteInfo(List item2routeList, string dsconn) { try { ICSPalletDAL.deleteInfo(item2routeList, dsconn); } catch (Exception ex) { throw ex; } } #endregion #region 分批 public static void Fenpi(FormICSWareHouseLotInfoUIModel lotInfo, decimal number, string newlotno, string dsconn) { try { if (string.IsNullOrWhiteSpace(dsconn)) { throw new Exception("数据库连接字符串错误"); } List lotInfoList = new List() { lotInfo }; ICSPalletDAL.Fenpi(lotInfoList, number, newlotno, dsconn); } catch (Exception ex) { throw ex; } } #endregion #region 合批 public static void Hepi(List lotInfolist, string molot, string dsconn) { try { if (string.IsNullOrWhiteSpace(dsconn)) { throw new Exception("数据库连接字符串错误"); } ICSPalletDAL.Hepi(lotInfolist, molot, dsconn); } catch (Exception ex) { throw ex; } } #endregion #region 批次删除 public static void Lotdelete(List LOTList) { try { ICSPalletDAL.Lotdelete(LOTList); } catch (Exception ex) { throw ex; } } #endregion #region 更新 public static void UpItemLotInfo(List LOToList, string dsconn) { try { ICSPalletDAL.UpItemLotInfo(LOToList, dsconn); } catch (Exception ex) { throw ex; } } #endregion #region 查询 public static ICSWareHouseLotInfo select(String guid, string Appconstr) { try { return ICSPalletDAL.select(guid, Appconstr); } catch (Exception ex) { throw ex; } } public static ICSWareHouseLotInfo Wereselect(String LotNO,String INVCode, String WHCode, String BinCode, string Appconstr) { try { return ICSPalletDAL.Wereselect(LotNO, INVCode, WHCode, BinCode, Appconstr); } catch (Exception ex) { throw ex; } } #endregion public static void updatalot(string ID, Decimal sum, string dsconn) { try { ICSPalletDAL.updatalot(ID, sum,dsconn); } catch (Exception ex) { throw ex; } } public static void updatawerelot(Decimal lsum, string invcode, string whcode, string bincode, string dsconn) { try { ICSPalletDAL.updatawerelot(lsum, invcode, whcode, bincode, dsconn); } catch (Exception ex) { throw ex; } } #region 日志 public static void BLOGAdd(ICSWareHouseLotInfoLog Info, Decimal lsum, string edit,string dsconn) { try { if (string.IsNullOrWhiteSpace(dsconn)) { throw new Exception("数据库连接字符串错误"); } List InfoList = new List() { Info }; ICSPalletDAL.BLOGAdd(InfoList, lsum, edit,dsconn); } catch (Exception ex) { throw ex; } } #endregion } }