/// <summary> /// 把查询的数据添加到仓储数据库 /// </summary> /// <param name="masterds"></param> /// <param name="detailds"></param> public void Insert(DataSet masterds, DataSet detailds, DataSet middleds) { try { using (PersistentManager pm = new PersistentManager()) { DownDecidePlanDao dao = new DownDecidePlanDao(); if (masterds.Tables["WMS_IN_BILLMASTER"].Rows.Count > 0) { dao.InsertInBillMaster(masterds); } if (detailds.Tables["WMS_IN_BILLDETAIL"].Rows.Count > 0) { dao.InsertInBillDetail(detailds); } if (middleds.Tables["WMS_MIDDLE_IN_BILLDETAIL"].Rows.Count > 0) { dao.InsertMiddle(middleds); } } } catch (Exception e) { throw new Exception(e.Message); } }
/// <summary> /// 把查询的数据添加到仓储数据库 /// </summary> /// <param name="middleds"></param> /// <param name="detailds"></param> public void InsertMiddle(DataSet middleds) { using (PersistentManager pm = new PersistentManager()) { DownDecidePlanDao dao = new DownDecidePlanDao(); } }
/// <summary> /// 查询数字仓储中间表4天内入库单 zxl 2012-09-14 /// </summary> /// <returns></returns> public DataTable GetMiddleBillNo() { using (PersistentManager pm = new PersistentManager()) { DownDecidePlanDao dao = new DownDecidePlanDao(); return(dao.GetMiddleBillNo()); } }
/// <summary> /// 根据卷烟编码查询计量单位信息 /// </summary> /// <param name="product"></param> /// <returns></returns> public DataTable FindUnitListCode(string product) { using (PersistentManager pm = new PersistentManager()) { DownDecidePlanDao dao = new DownDecidePlanDao(); return(dao.FindUnitListCode(product)); } }
/// <summary> /// 下载入库单明细表数据zxl 2012-09-14 /// </summary> /// <returns></returns> public DataTable GetMiddleInBillDetail(string inBillNoList) { using (PersistentManager dbpm = new PersistentManager()) { DownDecidePlanDao dao = new DownDecidePlanDao(); return(dao.GetMiddleInBillDetail(inBillNoList)); } }
/// <summary> /// 删除中间表数据 /// </summary> /// <param name="billno">单号</param> public void DeleteMiddleBill(string billno) { using (PersistentManager pm = new PersistentManager()) { DownDecidePlanDao dao = new DownDecidePlanDao(); dao.DeleteMiddleBill(billno); } }
public DataTable GetInBillMasterDateTime(string dateTime) { using (PersistentManager dbpm = new PersistentManager()) { DownDecidePlanDao dao = new DownDecidePlanDao(); return(dao.GetInBillMasterDateTime(dateTime)); } }
/// <summary> /// 下载入库单主表数据zxl 2012-09-14 /// </summary> /// <returns></returns> public DataTable GetMiddleInBillMaster(string inBillNoList) { using (PersistentManager dbpm = new PersistentManager("ZYJCConnection")) { DownDecidePlanDao dao = new DownDecidePlanDao(); dao.SetPersistentManager(dbpm); return(dao.GetMiddleInBillMaster(inBillNoList)); } }
/// <summary> /// 根据日期下载入库数据 zxl 2013-05-08 更新修改 RFID项目决策系统可使用,广西无RFID项目不可用 /// </summary> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <returns></returns> public bool GetInBillMiddle(string startDate, string endDate, string EmployeeCode, string wareCode, string billtype, out string errorInfo) { bool tag = false; Employee = EmployeeCode; errorInfo = string.Empty; using (PersistentManager pm = new PersistentManager()) { try { string billnolist = string.Empty; string inDetailList = string.Empty; DownDecidePlanDao dao = new DownDecidePlanDao(); DataTable emply = dao.FindEmployee(EmployeeCode); DataTable inMasterBillNo = this.GetMiddleBillNo(); if (inMasterBillNo.Rows.Count != 0) { billnolist = UtinString.StringMake(inMasterBillNo, "bill_no"); billnolist = string.Format(" AND ID NOT IN({0})", billnolist); } DataTable masterdt = this.GetMiddleInBillMaster(string.Format("BILL_DATE >='{0}' {1}", startDate, billnolist)); if (masterdt.Rows.Count != 0) { inDetailList = UtinString.StringMake(masterdt, "BILL_NO"); inDetailList = " AND MASTER_ID IN(" + inDetailList + ")"; } DataTable detaildt = this.GetMiddleInBillDetail(inDetailList); if (masterdt.Rows.Count > 0 && detaildt.Rows.Count > 0) { try { DataSet middleds = this.MiddleTable(masterdt, startDate); this.Insert(middleds); DataSet masterds = this.MiddleInBillMaster(masterdt, emply.Rows[0]["employee_id"].ToString(), wareCode, billtype); DataSet detailds = this.MiddleInBillDetail(detaildt); this.Insert(masterds, detailds); tag = true; } catch (Exception e) { errorInfo = "保存错误:" + e.Message; } } else { errorInfo = "没有新的入库单下载!"; } } catch (Exception ex) { errorInfo = "下载入库数据失败!原因:" + ex.Message; } } return(tag); }