public static string MakePickUpBill(string SLP_VendorControl, string SLP_RootNoControl, string SLP_BLocateControl, string SLP_BLocateSecControl, string SLP_ELocateControl, string SLP_ELocateSecControl, string UserIdControl ) { bool InsertOK = false; string OK = ""; string PickNo = ""; string PickDate = DateTime.Now.ToString("yyyyMMddHHmmss"); try { IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); ParameterList.Add(UserIdControl); ParameterList.Add(PickDate); ParameterList.Add(SLP_VendorControl); ParameterList.Add(SLP_RootNoControl); ParameterList.Add(SLP_BLocateControl); if (SLP_BLocateSecControl == "") ParameterList.Add(""); else ParameterList.Add(SLP_BLocateControl + SLP_BLocateSecControl); ParameterList.Add(SLP_ELocateControl + SLP_ELocateSecControl); InsertOK = BCO.CreateBySupplier(ParameterList, null, out OK, out PickNo); if (OK == "0") { return "0|查無符合資料"; } return "1|" + PickNo; } catch (Exception ex) { throw ex; } }
protected void btnPrint_Click(object sender, EventArgs e) { ErrorMsgLabel.Text = ""; string strErr = string.Empty; if (SLP_Vendor.Text == string.Empty) { strErr = "請輸入供應商代號"; ErrorMsgLabel.Text = strErr; return; } if (SLP_BLocate.Text == SLP_ELocate.Text) { strErr = "上下架儲位不可相同,請重新選擇"; ErrorMsgLabel.Text = strErr; return; } string UserID = Session["UID"].ToString(); string PickDate = DateTime.Now.ToString("yyyyMMddHHmmss"); string Supplier = SLP_Vendor.Text; string RootNo = SLP_RootNo.Text; TextBox txtBlocateNo = (TextBox)SLP_BLocate.FindControl("TextBoxCode"); string BLocateNo = txtBlocateNo.Text; string BLocateSec = string.Empty; TextBox txtBlocateSec = (TextBox)SLP_BLocate.FindControl("TextBoxCode2"); if (txtBlocateSec.Text == string.Empty) { BLocateSec = ""; } else { BLocateSec = SLP_BLocate.Text; } string ELocateSec = SLP_ELocate.Text; string PickNo = string.Empty; string OK = string.Empty; bool InsertOK = false; this.txtPickNo.Text = string.Empty; //this.btnRePrint.Enabled = false; this.btnMaintain.Enabled = false; try { IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); ParameterList.Add(UserID); ParameterList.Add(PickDate); ParameterList.Add(Supplier); ParameterList.Add(RootNo); ParameterList.Add(BLocateNo); ParameterList.Add(BLocateSec); ParameterList.Add(ELocateSec); InsertOK = BCO.CreateBySupplier(ParameterList, null, out OK, out PickNo); if (OK == "0") { strErr = "查無符合條件的資料"; ErrorMsgLabel.Text = strErr; return; } else { this.txtPickNo.Text = PickNo; //this.btnPrint.Enabled = false; this.btnMaintain.Enabled = true; //this.btnRePrint.Enabled = true; } ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM156", "DoPrint();", true); } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } }