/// <summary> /// 下载产品信息 同时上报 /// </summary> /// <returns></returns> public bool DownProductInfo() { bool tag = true; try { DataTable codedt = this.GetProductCode(); string codeList = UtinString.MakeString(codedt, "custom_code"); codeList = "BRAND_CODE NOT IN (" + codeList + ")"; DataTable bradCodeTable = this.GetProductInfo(codeList); if (bradCodeTable.Rows.Count > 0) { DataSet brandCodeDs = this.Insert(bradCodeTable); this.Insert(brandCodeDs); //上报数据 //upload.InsertProduct(brandCodeDs); } else { tag = false; } } catch (Exception e) { throw new Exception("下载卷烟失败!原因:" + e.Message); } return(tag); }
/// <summary> /// 选择日期从营销系统下载出库单据 /// </summary> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <returns></returns> public bool GetOutBill(string startDate, string endDate, string EmployeeCode) { bool tag = true; Employee = EmployeeCode; using (PersistentManager dbpm = new PersistentManager("YXConnection")) { DownOutBillDao dao = new DownOutBillDao(); dao.SetPersistentManager(dbpm); DataTable outBillNoTable = this.GetOutBillNo(); string outBillList = UtinString.StringMake(outBillNoTable, "BILLNO"); outBillList = UtinString.StringMake(outBillList); outBillList = string.Format("ORDER_DATE >='{0}' AND ORDER_DATE <='{1}' AND ORDER_ID NOT IN({2})", startDate, endDate, outBillList); DataTable masterdt = this.GetOutBillMaster(outBillList); string outDetailList = UtinString.StringMake(masterdt, "ORDER_ID"); outDetailList = UtinString.StringMake(outDetailList); outDetailList = "ORDER_ID IN(" + outDetailList + ")"; DataTable detaildt = this.GetOutBillDetail(outDetailList); if (masterdt.Rows.Count > 0 && detaildt.Rows.Count > 0) { DataSet masterds = this.OutBillMaster(masterdt); DataSet detailds = this.OutBillDetail(detaildt); this.Insert(masterds, detailds); } else { tag = false; } } return(tag); }
/// <summary> /// 从营销系统下载线路信息 创联 /// </summary> /// <returns></returns> public bool DownRouteInfos() { bool tag = true; DataTable RouteCodeDt = this.GetRouteCode(); string routeCodeList = UtinString.StringMake(RouteCodeDt, "deliver_line_code"); routeCodeList = UtinString.StringMake(routeCodeList); DataTable RouteDt = this.GetRouteInfos(""); if (RouteDt.Rows.Count > 0) { DataTable routeTable = this.InsertRouteCodes(RouteDt).Tables["DWV_OUT_DELIVER_LINE"]; DataRow[] line = routeTable.Select("DELIVER_LINE_CODE NOT IN(" + routeCodeList + ")"); if (line.Length > 0) { DataSet lineds = this.InsertRouteCode(line); this.Insert(lineds); } } else { tag = false; } return(tag); }
public bool DownInBillInfoAuto(string EmployeeCode) { bool tag = true; Employee = EmployeeCode; using (PersistentManager dbpm = new PersistentManager("YXConnection")) { DownInBillDao dao = new DownInBillDao(); dao.SetPersistentManager(dbpm); DataTable WmsInBillTable = this.GetInBillNo(); string inBillNoList = UtinString.StringMake(WmsInBillTable, "BILLNO"); inBillNoList = UtinString.StringMake(inBillNoList); inBillNoList = "ORDER_ID NOT IN(" + inBillNoList + ")"; DataTable masterdt = this.InBillMaster(inBillNoList); DataTable detaildt = this.InBillDetail(inBillNoList); DataRow[] masterdr = masterdt.Select("1=1"); DataRow[] detaildr = detaildt.Select("1=1"); if (masterdr.Length > 0 && detaildr.Length > 0) { DataSet detailds = this.InBillDetail(detaildr); DataSet masterds = this.InBillMaster(masterdr); this.Insert(masterds, detailds); } else { tag = false; } } return(tag); }
/// <summary> /// 自动下载订单 /// </summary> /// <returns></returns> public string DownSortingOrder() { string tag = "true"; using (PersistentManager dbpm = new PersistentManager()) { DownSortingOrderDao dao = new DownSortingOrderDao(); dao.SetPersistentManager(dbpm); try { DataTable orderdt = this.GetOrderId(); string orderlist = UtinString.StringMake(orderdt, "ORDER_ID"); orderlist = UtinString.StringMake(orderlist); orderlist = "ORDER_ID NOT IN(" + orderlist + ")"; DataTable masterdt = this.GetSortingOrder(orderlist); DataTable detaildt = this.GetSortingOrderDetail(orderlist); 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 DownUnitCodeInfo() { bool tag = true; DataTable unitProductDt = this.GetUnitProduct();//取得中间表数据 string productcodeList = UtinString.MakeString(unitProductDt, "UNIT_LIST_CODE"); productcodeList = "BRAND_N NOT IN(" + productcodeList + ")"; DataTable Unitdt = this.GetUnitInfo(productcodeList);//下载数据 if (Unitdt.Rows.Count > 0) { DataTable codedt = this.GetUnitCode(); //取得单位 DataSet ds = this.InsertTable(Unitdt); //把数据转化放到单位表和中间表 DataTable unitTable = ds.Tables["WMS_UNIT_INSERT"]; //取得单位表 DataTable unitListTable = ds.Tables["WMS_UNIT_PRODUCT"]; //取得单位系列表 string codeList = UtinString.MakeString(codedt, "unit_code"); DataRow[] unitdr = unitTable.Select("UNIT_CODE NOT IN (" + codeList + ")"); //把没有下载过的取出来 DataSet unitDs = this.InsertUnit(unitdr); DataSet unitlistds = this.InsertProduct(unitListTable); if (unitDs.Tables["WMS_UNIT_INSERT"].Rows.Count > 0) { this.Insert(unitDs.Tables["WMS_UNIT_INSERT"]); } if (unitlistds.Tables["WMS_UNIT_PRODUCT"].Rows.Count > 0) { this.InsertLcUnit(unitlistds.Tables["WMS_UNIT_PRODUCT"]); } } return(tag); }
/// <summary> /// 清除当天主表数据和明细表数据 /// </summary> public string deleteData() { string tag = "true"; try { DateTime dateTime = DateTime.Now; string date = Convert.ToString(dateTime.ToString("yyyyMMdd")); using (PersistentManager persistentManager = new PersistentManager()) { SortingOrderDao dao = new SortingOrderDao(); SortingOrderDetailBll bll = new SortingOrderDetailBll(); DataTable orderdt = dao.QueryDate(date); string orderidList = UtinString.StringMake(orderdt, "ORDER_ID"); string orderid = UtinString.StringMake(orderidList); dao.deleteOrderDate(date); bll.DeleteOrderId(orderid); } } catch (Exception e) { tag = e.Message; } return(tag); }
/// <summary> /// 确认线路分配 /// </summary> /// <returns></returns> public string UpdateOrderSoringGroupInfo(string SortingCode, string RouteCode, string orderDate) { string tag = "true"; using (PersistentManager persistentManager = new PersistentManager()) { RouteCode = RouteCode.Substring(3, RouteCode.Length - 3); DataTable orderTable = this.QueryOrderId(RouteCode, orderDate);//查询主表Id if (orderTable.Rows.Count > 0) { string orderIdList = UtinString.StringMake(orderTable, "ORDER_ID"); orderIdList = UtinString.StringMake(orderIdList);//取得截取后的主表Id字符 SortingOrderDetailBll orderDetail = new SortingOrderDetailBll(); SortingRouteBll bll = new SortingRouteBll(); string str = orderDetail.UpdateOrderDeatil(SortingCode, orderIdList);//根据主表ID修改明细表分拣分配状态 if (str == "true") { this.UpdateOrderMaster(SortingCode, RouteCode, orderDate);//修改主表分拣线编号 //bll.UpdateRouteAllotState(RouteCode, "1");//修改线路表id } else { tag = str; } } else { tag = "选择的线路没有主订单"; } } return(tag); }
/// <summary> /// 下载单位数据 /// </summary> /// <returns></returns> public bool DownUnitCodeInfo() { bool tag = true; DataTable Unitdt = this.GetUnitInfo(); //下载数据 DataTable codedt = this.GetUnitCode(); //取得单位 DataTable unitProductDt = this.GetUnitProduct(); //取得中间表数据 DataSet ds = this.Insert(Unitdt); //把数据转化放到单位表和中间表 DataTable unitTable = ds.Tables["WMS_UNIT_INSERT"]; //取得单位表 string codeList = UtinString.StringMake(codedt, "UNITCODE"); string code = UtinString.StringMake(codeList); DataRow[] unitdr = unitTable.Select("UNITCODE NOT IN (" + code + ")");//把没有下载过的取出来 DataSet unitDs = this.InsertUnit(unitdr); DataTable unitProductTable = ds.Tables["WMS_UNIT_PRODUCT"]; string productcodeList = UtinString.StringMake(unitProductDt, "PRODUCTCODE"); string productcode = UtinString.StringMake(productcodeList); DataRow[] unirProductdr = unitProductTable.Select("PRODUCTCODE NOT IN (" + productcode + ")");//把没有下载中间表的取出来 DataSet productds = this.InsertProduct(unirProductdr); this.Insert(unitDs, productds); return(tag); }
/// <summary> /// 取消线路分配 /// </summary> /// <param name="RouteCode"></param> /// <returns></returns> public string CancelAllotOrder(string RouteCode, string orderDate) { string tag = "true"; using (PersistentManager persistentManager = new PersistentManager()) { RouteCode = RouteCode.Substring(3, RouteCode.Length - 3); DataTable orderTable = this.QueryOrderId(RouteCode, orderDate);//查询主表Id if (orderTable.Rows.Count > 0) { string orderIdList = UtinString.StringMake(orderTable, "ORDER_ID"); orderIdList = UtinString.StringMake(orderIdList);//取得截取后的主表Id字符 SortingOrderDetailBll orderDetail = new SortingOrderDetailBll(); SortingRouteBll bll = new SortingRouteBll(); // bll.UpdateRouteAllotState(RouteCode, "0"); this.UpdateOrderMaster("", RouteCode, orderDate); tag = orderDetail.UpdateOrderDeatil("", orderIdList); } else { tag = "选择取消的线路没有订单!"; } } return(tag); }
/// <summary> /// 下载客户信息 /// </summary> /// <returns></returns> public bool DownCustomerInfo() { bool tag = true; try { this.DeleteCustomer(); DataTable customerCodeDt = this.GetCustomerCode(); string CusromerList = UtinString.MakeString(customerCodeDt, "customer_code"); CusromerList = " CUST_CODE NOT IN (" + CusromerList + ")"; DataTable customerDt = this.GetCustomerInfo(CusromerList); if (customerDt.Rows.Count > 0) { DataSet custDs = this.Insert(customerDt); this.Insert(custDs); //上报客户信息数据 // upload.InsertCustom(custDs); } } catch (Exception e) { throw new Exception("下载客户失败!原因:" + e.Message); } 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) { 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 inbillno = UtinString.StringMake(billnolist); inbill.GetInBillManual(inbillno, Session["EmployeeCode"].ToString()); JScript.Instance.ShowMessage(this.UpdatePanel1, "已选择的单据下载完成!"); } else { JScript.Instance.ShowMessage(this.UpdatePanel1, "请选择要下载的单据!"); } } else { JScript.Instance.ShowMessage(this.UpdatePanel1, "没有数据可以下载!"); } }
/// <summary> /// 自动下载 /// </summary> /// <returns></returns> public bool DownOutBillInfoAuto(string EmployeeCode) { bool tag = true; Employee = EmployeeCode; using (PersistentManager dbpm = new PersistentManager("YXConnection")) { DownOutBillDao dao = new DownOutBillDao(); dao.SetPersistentManager(dbpm); DataTable outBillNoTable = this.GetOutBillNo(); string billnolist = UtinString.StringMake(outBillNoTable, "BILLNO"); billnolist = UtinString.StringMake(billnolist); billnolist = "ORDER_ID NOT IN(" + billnolist + ")"; DataTable masterdt = this.GetOutBillMaster(billnolist); DataTable detaildt = this.GetOutBillDetail(billnolist); if (masterdt.Rows.Count > 0 && detaildt.Rows.Count > 0) { DataSet detailds = this.OutBillDetail(detaildt); DataSet masterds = this.OutBillMaster(masterdt); this.Insert(masterds, detailds); } else { tag = false; } } return(tag); }
/// <summary> /// 下载配送区域表 /// </summary> /// <returns></returns> public bool DownDistStationInfo() { bool tag = true; try { DataTable distStationTable = this.GetDistStationCode(); string distList = UtinString.MakeString(distStationTable, "dist_code"); DataTable distTable = this.GetDistInfo(distList); if (distTable.Rows.Count > 0) { DataSet distds = Insert(distTable); this.Insert(distds); } else { tag = false; } } catch (Exception e) { throw new Exception("下载区域表失败!原因:" + e.Message); } return(tag); }
/// <summary> /// 从分拣下载线路信息 /// </summary> /// <returns></returns> public bool DownSortRouteInfo() { bool tag = true; try { DataTable RouteCodeDt = this.GetRouteCode(); string routeCodeList = UtinString.StringMake(RouteCodeDt, "deliver_line_code"); routeCodeList = UtinString.StringMake(routeCodeList); DataTable RouteDt = this.GetSortRouteInfo(""); if (RouteDt.Rows.Count > 0) { DataTable routeTable = this.InsertSortRouteCode(RouteDt).Tables["DWV_OUT_DELIVER_LINE"]; DataRow[] line = routeTable.Select("DELIVER_LINE_CODE NOT IN(" + routeCodeList + ")"); if (line.Length > 0) { DataSet lineds = this.InsertRouteCode(line); this.Insert(lineds); } } else { tag = false; } } catch (Exception e) { throw new Exception("从分拣下载线路信息失败!原因:" + e.Message); } return(tag); }
/// <summary> /// 根据日期下载入库数据 /// </summary> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <returns></returns> public bool GetInBill(string startDate, string endDate, string EmployeeCode) { bool tag = true; Employee = EmployeeCode; using (PersistentManager pm = new PersistentManager()) { DownInBillDao dao = new DownInBillDao(); dao.SetPersistentManager(pm); DataTable inMasterBillNo = this.GetInBillNo(); string billnolist = UtinString.StringMake(inMasterBillNo, "BILLNO"); 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.InBillMaster(billnolist); string inDetailList = UtinString.StringMake(masterdt, "ORDER_ID"); inDetailList = UtinString.StringMake(inDetailList); inDetailList = "ORDER_ID IN(" + inDetailList + ")"; DataTable detaildt = this.InBillDetail(inDetailList); DataRow[] masterdr = masterdt.Select("1=1"); DataRow[] detaildr = detaildt.Select("1=1"); if (masterdr.Length > 0 && detaildr.Length > 0) { DataSet detailds = this.InBillDetail(detaildr); DataSet masterds = this.InBillMaster(masterdr); this.Insert(masterds, detailds); } else { tag = false; } } return(tag); }
/// <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); }
public void DeleteInBill(string billNo) { string idList = this.SelectIdList(billNo); if (idList != null) { idList = UtinString.StringMake(idList); this.DeleteDownReturnInBillInfo(billNo); this.UpdateReturnInBillState(idList, "0"); } }
public string QueryShelfCode(string productCode) { using (PersistentManager persistentManager = new PersistentManager()) { WarehouseCellDao dao = new WarehouseCellDao(); string sql = string.Format("SELECT SHELFCODE FROM WMS_WH_CELL WHERE ASSIGNEDPRODUCT='{0}' AND AREATYPE='0' GROUP BY SHELFCODE", productCode); DataTable shelfTable = dao.GetData(sql).Tables[0]; string shelfList = UtinString.StringMake(shelfTable, "SHELFCODE"); return(UtinString.StringMake(shelfList)); } }
/// <summary> /// 查询营销系统分拣订单主表数据进行下载 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <returns></returns> public DataTable GetSortingOrder(int pageIndex, int pageSize) { using (PersistentManager dbpm = new PersistentManager("YXConnection")) { DownSortingOrderDao dao = new DownSortingOrderDao(); dao.SetPersistentManager(dbpm); DataTable orderdt = this.GetOrderId(); string orderlist = UtinString.StringMake(orderdt, "ORDER_ID"); orderlist = UtinString.StringMake(orderlist); orderlist = "ORDER_ID NOT IN(" + orderlist + ")"; return(dao.GetSortingOrder(orderlist)); } }
//选择单据下载 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();//下载产品 //orgdistbll.DownOrgDistBillInfo();//下载配车单信息 billnolist = billnolist.Substring(0, billnolist.Length - 1); string orderid = UtinString.StringMake(billnolist); string tag = outbill.GetSortingOrderById(orderid); if (tag == "true") { JScript.Instance.ShowMessage(this.UpdatePanel1, "选择的单据下载完成!"); } else { JScript.Instance.ShowMessage(this.UpdatePanel1, "选择的单据下载失败!原因:" + tag); } } else { JScript.Instance.ShowMessage(this.UpdatePanel1, "请选择要下载的单据!"); } } else { JScript.Instance.ShowMessage(this.UpdatePanel1, "无数据可以下载!"); } } catch (Exception exp) { JScript.Instance.ShowMessage(this.UpdatePanel1, exp.Message); } this.BindSortingOrder(); }
/// <summary> /// 根据时间查询营销系统分拣订单主表数据进行下载 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <returns></returns> public DataTable GetSortingOrder(int pageIndex, int pageSize, string startDate, string endDate) { using (PersistentManager dbpm = new PersistentManager("YXConnection")) { DownSortingOrderDao dao = new DownSortingOrderDao(); dao.SetPersistentManager(dbpm); DataTable orderdt = this.GetOrderId(); string orderlist = UtinString.StringMake(orderdt, "ORDER_ID"); orderlist = UtinString.StringMake(orderlist); //orderlist = "ORDER_DATE>='" + startDate + "' AND ORDER_DATE<='" + endDate + "' AND ORDER_ID NOT IN(" + orderlist + ")"; orderlist = "ORDER_ID NOT IN(" + orderlist + ")"; DataTable masert = dao.GetSortingOrder("ORDER_ID NOT IN('')"); DataRow[] orderdr = masert.Select(orderlist); return(this.SaveSortingOrder(orderdr).Tables[0]); } }
//合单 protected void btnUniteBill_Click(object sender, EventArgs e) { try { CheckBox chk = new CheckBox(); int selectedNum = 0; string billNoList = ""; string billNo = billMaster.GetNewBillNo(); string date = DateTime.Now.ToString("yyyy-MM-dd"); bool flag = false; decimal quantity = 0.00M; for (int i = 0; i < gvMain.Rows.Count; i++) { chk = (CheckBox)gvMain.Rows[i].Cells[1].Controls[0]; if (chk.Checked) { billNoList += gvMain.Rows[i].Cells[2].Text.ToString() + ","; quantity += Convert.ToDecimal(gvMain.Rows[i].Cells[6].Text.ToString()); selectedNum++; } } if (selectedNum > 1) { try { billNoList = UtinString.StringMake(billNoList); downbll.GetByOutBill(billNo, date, Session["EmployeeCode"].ToString(), billNoList); //插入数仓表 downbll.zyGetOutTable(billNo, date, Session["EmployeeCode"].ToString(), billNoList); //插入中烟表 downbll.DeleteOutBillInfo(); //清除3天之前合单过且没有作业的数据 JScript.Instance.ShowMessage(this.UpdatePanel1, "合单完成!"); GridDataBind(); } catch (Exception exp) { JScript.Instance.ShowMessage(this.UpdatePanel1, "合单出错!原因:" + exp.Message); } } else { JScript.Instance.ShowMessage(this.UpdatePanel1, "合单必须选择两个或两个以上的单据!"); } } catch (Exception exp) { JScript.Instance.ShowMessage(this.UpdatePanel1, exp.Message); } }
/// <summary> /// 查询营销系统出库主表数据 /// </summary> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <returns></returns> public DataTable GetOutBillMaster(int pageIndex, int pageSize, string startDate, string endDate) { using (PersistentManager dbpm = new PersistentManager("YXConnection")) { DownOutBillDao dao = new DownOutBillDao(); dao.SetPersistentManager(dbpm); DataTable outBillNoTable = this.GetOutBillNo(); string billnolist = UtinString.StringMake(outBillNoTable, "BILLNO"); billnolist = UtinString.StringMake(billnolist); billnolist = "ORDER_ID NOT IN(" + billnolist + ")"; DataTable unitedt = this.UniteBillNo(); string unitelist = UtinString.StringMake(unitedt, "DOWNBILLINO"); unitelist = UtinString.StringMake(unitelist); return(dao.GetOutBillMaster(billnolist, unitelist)); } }
protected void btnDelete_Click(object sender, EventArgs e) { try { string billNo = "";// 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; } billNo = dsMaster.Tables[0].Rows[i]["BILLNO"].ToString();// 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); //inbill.DeleteInStoreBill(billidList); updateBll.deleteInBill(billidList); inbill.DeleteInBill(billNo);// 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> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <returns></returns> public DataTable GetInBillMaster(int pageIndex, int pageSize) { using (PersistentManager pm = new PersistentManager()) { using (PersistentManager dbpm = new PersistentManager("YXConnection")) { DownInBillDao masterdao = new DownInBillDao(); masterdao.SetPersistentManager(pm); DownInBillDao dao = new DownInBillDao(); dao.SetPersistentManager(dbpm); DataTable billnodt = masterdao.GetBillNo(); string billnolist = UtinString.StringMake(billnodt, "BILLNO"); billnolist = UtinString.StringMake(billnolist); return(dao.GetInBillMasterByBillNo(billnolist)); } } }
/// <summary> /// 下载客户信息 创联 /// </summary> /// <returns></returns> public bool DownCustomerInfos() { bool tag = true; DataTable customerCodeDt = this.GetCustomerCode(); string CusromerList = UtinString.MakeString(customerCodeDt, "customer_code"); CusromerList = " CUST_CODE NOT IN (" + CusromerList + ")"; DataTable customerDt = this.GetCustomerInfo(CusromerList); if (customerDt.Rows.Count > 0) { DataSet custDs = this.Inserts(customerDt); this.Insert(custDs); //上报客户信息数据 upload.InsertCustom(custDs); } return(tag); }
/// <summary> /// 下载配送区域表 /// </summary> /// <returns></returns> public bool DownDistStationInfo() { bool tag = true; DataTable distStationTable = this.GetDistStationCode(); string distList = UtinString.MakeString(distStationTable, "dist_code"); DataTable distTable = this.GetDistInfo(distList); if (distTable.Rows.Count > 0) { DataSet distds = Insert(distTable); this.Insert(distds); } else { tag = false; } return(tag); }
/// <summary> /// 选择日期从营销系统下载出库单据 创联 /// </summary> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <returns></returns> public bool GetOutBills(string startDate, string endDate, string EmployeeCode, out string errorInfo, string wareCode, string billType) { bool tag = true; Employee = EmployeeCode; errorInfo = string.Empty; using (PersistentManager dbpm = new PersistentManager()) { DownOutBillDao dao = new DownOutBillDao(); DataTable emply = dao.FindEmployee(EmployeeCode); DataTable outBillNoTable = this.GetOutBillNo(startDate); string outBillList = UtinString.MakeString(outBillNoTable, "bill_no"); outBillList = string.Format("ORDER_DATE ='{0}' AND ORDER_ID NOT IN({1}) ", startDate, outBillList); DataTable masterdt = this.GetOutBillMasters(outBillList); string outDetailList = UtinString.MakeString(masterdt, "ORDER_ID"); outDetailList = "ORDER_ID IN(" + outDetailList + ")"; DataTable detaildt = this.GetOutBillDetail(outDetailList); if (masterdt.Rows.Count > 0 && detaildt.Rows.Count > 0) { try { string billno = this.GetNewBillNo(); DataSet middleds = this.MiddleTable(masterdt, billno); //DataSet masterds = this.OutBillMaster(masterdt, emply.Rows[0]["employee_id"].ToString(), wareCode, billType); DataSet detailds = this.OutBillDetail(detaildt, emply.Rows[0]["employee_id"].ToString(), wareCode, billType, startDate, billno); this.Insert(detailds, middleds); } catch (Exception e) { errorInfo += e.Message; tag = false; } } else { errorInfo = "没有可下载的出库数据!"; tag = false; } } return(tag); }
/// <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); }