public static string MakePickUpBill(string SLP_DateControl, string SLP_BLocateControl, string SLP_BLocateSecControl, string SLP_ELocateControl, string SLP_ELocateSecControl, string UserIdControl ) { bool InsertOK = false; string OK = ""; string PickNo = ""; try { IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); ParameterList.Add(UserIdControl); ParameterList.Add(DateTime.Now.ToString("yyyyMMddHHmmss")); ParameterList.Add(SLP_DateControl); ParameterList.Add(SLP_BLocateControl + SLP_BLocateSecControl); ParameterList.Add(SLP_ELocateControl + SLP_ELocateSecControl); InsertOK = BCO.CreateByLeftTrans(ParameterList, null, out OK, out PickNo); if (OK == "0") { return "0|查無符合資料"; } else { if (OK == "2") { return "2|" + PickNo; } } return "1|" + PickNo; } catch (Exception ex) { throw ex; } }
protected void btnPrint_Click(object sender, EventArgs e) { ErrorMsgLabel.Text = ""; string strErr = ""; string UserID = Session["UID"].ToString(); string PickDate = DateTime.Now.ToString("yyyyMMddHHmmss"); string BLocateSec = SLP_BLocateSec.Text; string ELocateSec = SLP_ELocateSec.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; int TimeCompare = 0; TimeCompare = DateTime.Compare(DateTime.Parse(SLP_Date.Text), DateTime.Parse(hid_NextAcceptDate.Value)); //if (TimeCompare < 0) //{ // strErr = "輸入日期不可小於下次門市進貨日"; // ErrorMsgLabel.Text = strErr; // return; //} try { IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); ParameterList.Add(UserID); ParameterList.Add(PickDate); ParameterList.Add(SLP_Date.Text); ParameterList.Add(SLP_BLocateSec.Text); ParameterList.Add(SLP_ELocateSec.Text); InsertOK = BCO.CreateByLeftTrans(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), "IVM151", "DoPrint();", true); } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } }