/// <summary> /// 下载入库主表 创联 /// </summary> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <param name="EmployeeCode"></param> /// <param name="wareCode"></param> /// <param name="billtype"></param> /// <param name="errorInfo"></param> /// <returns></returns> public bool GetInBills(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 { DownInBillDao dao = new DownInBillDao(); DataTable emply = dao.FindEmployee(EmployeeCode); DataTable inMasterBillNo = this.GetInBillNo(); string billnolist = UtinString.StringMake(inMasterBillNo, "bill_no"); billnolist = UtinString.StringMake(billnolist); billnolist = string.Format("ORDER_DATE >='{0}' AND ORDER_DATE <='{1}' AND ORDER_ID NOT IN({2})", startDate, endDate, billnolist); DataTable masterdt = this.InBillMasters(billnolist); string inDetailList = UtinString.StringMake(masterdt, "ORDER_ID"); inDetailList = UtinString.StringMake(inDetailList); inDetailList = "ORDER_ID IN(" + inDetailList + ")"; DataTable detaildt = this.InBillDetail(inDetailList); if (masterdt.Rows.Count > 0 && detaildt.Rows.Count > 0) { DataSet masterds = this.InBillMaster(masterdt, emply.Rows[0]["employee_id"].ToString(), wareCode, billtype); DataSet detailds = this.InBillDetail(detaildt); this.Insert(masterds, detailds); tag = true; } else { errorInfo = "没有新的入库单下载!"; } } catch (Exception e) { errorInfo = "下载入库单失败!原因:" + e.Message; } } return(tag); }
protected void btnDelete_Click(object sender, EventArgs e) { try { string billid = ""; if (gvMain.Rows[0].Cells[0].Text == "没有符合以上条件的数据") { } else { for (int i = 0; i < gvMain.Rows.Count; i++) { CheckBox chk = (CheckBox)gvMain.Rows[i].Cells[1].Controls[0]; if (chk.Enabled && chk.Checked) { if (dsMaster.Tables[0].Rows[i]["STATUS"].ToString() == "2") { JScript.Instance.ShowMessage(this.UpdatePanel1, "已审核的入库单不能删除"); return; } billid += dsMaster.Tables[0].Rows[i]["BILLNO"].ToString() + ","; dsMaster.Tables[0].Rows[i].Delete(); } } billMaster.Delete(dsMaster); billid = billid.Substring(0, billid.Length - 1); string billidList = UtinString.StringMake(billid); //outbill.DeleteOutStoreBill(billidList);// updateBll.deleteOutBill(billidList); totalCount = billMaster.GetRowCount(filter); pager.RecordCount = totalCount; if (pageIndex > pager.PageCount) { pageIndex = pager.PageCount; } GridDataBind(); } } catch (Exception exp) { JScript.Instance.ShowMessage(this.UpdatePanel1, exp.Message); } }
/// <summary> /// 下载配车单信息 /// </summary> /// <returns></returns> public bool DownOrgDistBillInfo() { bool tag = true; DataTable orgTable = this.QueryOrgDistCode(); string distCodeList = UtinString.StringMake(orgTable, "DIST_BILL_ID"); distCodeList = UtinString.StringMake(distCodeList); distCodeList = "DIST_BILL_ID NOT IN (" + distCodeList + ")"; DataTable bistBillMasterTable = this.GetDistBillMaster(distCodeList); if (bistBillMasterTable.Rows.Count > 0) { this.Insert(bistBillMasterTable); } else { tag = false; } return(tag); }
//protected void CountTotal() //{ // decimal qty = 0.00M; // decimal amount = 0.00M; // foreach (DataRow row in dsDetail.Tables[0].Rows) // { // qty += Convert.ToDecimal(row["QUANTITY"]); // amount += Convert.ToDecimal(row["QUANTITY"]) * Convert.ToDecimal(row["PRICE"]); // } //} #endregion #region 载 //选择单据下载 protected void btnDown_Click(object sender, EventArgs e) { try { CheckBox chk = new CheckBox(); string billnolist = ""; bool hasSelected = false; if (gvMaster.Rows.Count >= 1) { for (int i = 0; i < gvMaster.Rows.Count; i++) { chk = (CheckBox)gvMaster.Rows[i].Cells[1].Controls[0]; if (chk.Checked) { billnolist += gvMaster.Rows[i].Cells[2].Text.ToString() + ","; hasSelected = true; } } if (hasSelected) { bll.DownProductInfo();//下载产品 billnolist = billnolist.Substring(0, billnolist.Length - 1); string billno = UtinString.StringMake(billnolist); outbill.GetOutBillManual(billno, Session["EmployeeCode"].ToString()); JScript.Instance.ShowMessage(this.UpdatePanel1, "已选择的单据下载完成!"); } else { JScript.Instance.ShowMessage(this.UpdatePanel1, "请选择要下载的单据!"); } } else { JScript.Instance.ShowMessage(this.UpdatePanel1, "无数据可以下载!"); } } catch (Exception exp) { JScript.Instance.ShowMessage(this.UpdatePanel1, exp.Message); } }
/// <summary> /// 下载送货区域表 /// </summary> /// <returns></returns> public bool DownReachInfo() { bool tag = true; DataTable reachCodeDt = this.QueryReachCode(); string reachCodeList = UtinString.StringMake(reachCodeDt, "DIST_STA_CODE"); string reachCode = UtinString.StringMake(reachCodeList); reachCode = "DIST_STA_CODE NOT IN(" + reachCode + ")"; DataTable reachDt = this.GetReachInfo(reachCode); if (reachDt.Rows.Count > 0) { this.Insert(reachDt); } else { tag = false; } return(tag); }
/// <summary> /// 下载客户信息 /// </summary> /// <returns></returns> public bool DownCustomerInfo() { bool tag = true; DataTable customerCodeDt = this.GetCustomerCode(); string CusromerList = UtinString.StringMake(customerCodeDt, "CUST_CODE"); CusromerList = UtinString.StringMake(CusromerList); CusromerList = " CUST_CODE NOT IN (" + CusromerList + ")"; DataTable customerDt = this.GetCustomerInfo(CusromerList); if (customerDt.Rows.Count > 0) { DataSet custDs = this.Insert(customerDt); this.Insert(custDs); } else { tag = false; } return(tag); }
/// <summary> /// 下载厂商数据 /// </summary> /// <returns></returns> public bool DownSupplierInfo() { bool tag = true; DataTable suppliercodedt = this.GetSupplierCode(); string codeList = UtinString.StringMake(suppliercodedt, "SUPPLIERCODE"); codeList = UtinString.StringMake(codeList); codeList = "FACTORY_CODE NOT IN (" + codeList + ")"; DataTable spplierTable = this.GetSpplierInfo(codeList); if (spplierTable.Rows.Count > 0) { DataSet spplierds = this.Insert(spplierTable); this.InsertSpplier(spplierds); } else { tag = false; } return(tag); }
/// <summary> /// 下载产品信息 /// </summary> /// <returns></returns> public bool DownProductInfo() { bool tag = true; DataTable codedt = this.GetProductCode(); string codeList = UtinString.StringMake(codedt, "PRODUCTCODE"); codeList = UtinString.StringMake(codeList); codeList = "BRAND_CODE NOT IN (" + codeList + ")"; DataTable bradCodeTable = this.GetProductInfo(codeList); if (bradCodeTable.Rows.Count > 0) { DataSet brandCodeDs = this.Insert(bradCodeTable); this.Insert(brandCodeDs); } else { tag = false; } return(tag); }
/// <summary> /// 下载单位数据 创联 /// </summary> /// <returns></returns> public bool DownUnitInfo() { bool tag = true; //下载单位信息 DataTable unitCodeTable = this.GetUnitCode(); string unitCodeList = UtinString.StringMake(unitCodeTable, "unit_code"); unitCodeList = UtinString.StringMake(unitCodeList); unitCodeList = "BRAND_UNIT_CODE NOT IN (" + unitCodeList + ")"; DataTable brandUnitCodeTable = this.GetUnitInfos(unitCodeList); if (brandUnitCodeTable.Rows.Count > 0) { DataSet unitCodeDs = this.InsertUnit(brandUnitCodeTable); this.Insert(unitCodeDs); } else { tag = false; } //下载计量单位系列数据 DataTable ulistCodeTable = this.GetUlistCode(); string ulistCodeList = UtinString.StringMake(ulistCodeTable, "unit_list_code"); ulistCodeList = UtinString.StringMake(ulistCodeList); ulistCodeList = "BRAND_ULIST_CODE NOT IN (" + ulistCodeList + ")"; DataTable brandUlistCodeTable = this.GetBrandUlist(ulistCodeList); if (brandUlistCodeTable.Rows.Count > 0) { DataSet unitListCodeDs = this.InsertProducts(brandUlistCodeTable); this.InsertUlist(unitListCodeDs.Tables["WMS_UNIT_PRODUCT"]); } else { tag = false; } return(tag); }
/// <summary> /// 下载部门信息 /// </summary> /// <returns></returns> public bool DownDeptInfo() { bool tag = true; DataTable deptCodeDt = this.GetDeptCode(); string deptCodeList = UtinString.StringMake(deptCodeDt, "DEPTCODE"); deptCodeList = UtinString.StringMake(deptCodeList); deptCodeList = "DEPT_CODE NOT IN (" + deptCodeList + ")"; DataTable deptDt = this.GetDeptInfo(deptCodeList); if (deptDt.Rows.Count > 0) { DataSet deptDs = this.Insert(deptDt); this.Insert(deptDs); } else { tag = false; } return(tag); }
/// <summary> /// 选择日期从营销系统下载分拣信息 /// </summary> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <returns></returns> public string GetSortingOrderDate(string startDate, string endDate) { string tag = "true"; using (PersistentManager dbpm = new PersistentManager()) { DownSortingOrderDao dao = new DownSortingOrderDao(); dao.SetPersistentManager(dbpm); try { //查询仓库7天内的订单号 DataTable orderdt = this.GetOrderId(); string orderlist = UtinString.StringMake(orderdt, "ORDER_ID"); orderlist = UtinString.StringMake(orderlist); string orderlistDate = "ORDER_DATE>='" + startDate + "' AND ORDER_DATE<='" + endDate + "' AND ORDER_ID NOT IN(" + orderlist + ")"; DataTable masterdt = this.GetSortingOrder(orderlistDate); //根据时间查询订单信息 string ordermasterlist = UtinString.StringMake(masterdt, "ORDER_ID"); //取得根据时间查询的订单号 string ordermasterid = UtinString.StringMake(ordermasterlist); ordermasterid = "ORDER_ID IN (" + ordermasterid + ")"; DataTable detaildt = this.GetSortingOrderDetail(ordermasterid);//根据订单号查询明细 if (masterdt.Rows.Count > 0 && detaildt.Rows.Count > 0) { DataSet masterds = this.SaveSortingOrder(masterdt); DataSet detailds = this.SaveSortingOrderDetail(detaildt); this.Insert(masterds, detailds); } else { return("没有可用的数据下载!"); } } catch (Exception e) { tag = e.Message; } } return(tag); }
/// <summary> /// 下载线路信息 /// </summary> /// <returns></returns> public bool DownRouteInfo() { bool tag = true; DataTable RouteCodeDt = this.GetRouteCode(); string routeCodeList = UtinString.StringMake(RouteCodeDt, "DELIVER_LINE_CODE"); routeCodeList = UtinString.StringMake(routeCodeList); routeCodeList = "DELIVER_LINE_CODE NOT IN (" + routeCodeList + ")"; DataTable RouteDt = this.GetRouteInfo(routeCodeList); if (RouteDt.Rows.Count > 0) { DataSet routeCodeDs = this.InsertRouteCode(RouteDt); this.Insert(routeCodeDs); } else { tag = false; } return(tag); }
public bool DownReturnInBill(string billNO) { bool tag = true; int count = this.ReturnInBillCount(); if (count == 0) { return(false); } else { string idList = ""; string memo = "此单据于" + DateTime.Now.ToString("yyMMdd") + "从分拣线退烟入库!"; this.InsertReturnInBillMaster(billNO, memo); idList = this.InsertReturnInBillDetail(billNO); this.InsertReturnInBill(billNO, idList); idList = UtinString.StringMake(idList); this.UpdateReturnInBillState(idList, "1"); //DataTable returntable = this.ReturnInBill(); } return(tag); }