public DataTable VIM157_20(ArrayList ParameterList, string ReportOutputFormat, ref ReportList.ExcelOtherType EOT ) { IVMModel.MaintainPickData bco = new IVMModel.MaintainPickData(ConntionDB); DataTable Dt = new DataTable(); Dt = bco.GetPrintRpt02(ParameterList); DataView dv = new DataView(Dt); dv.Sort = "item"; if (Dt.Rows.Count == 0) { throw new Exception("查無資料"); } else { return dv.ToTable(); } }
public static string MakePickUpBill(string txtBMapControl, string txtEMapControl, 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(txtBMapControl); ParameterList.Add(txtEMapControl); ParameterList.Add(4); string MapNos = BCO.CheckIsExistByMAPNo(ParameterList); if (MapNos != string.Empty) { return "0|驗收單" + MapNos + "已被用來產生過揀貨單"; } ParameterList.Clear(); ParameterList.Add(UserIdControl); ParameterList.Add(PickDate); ParameterList.Add(txtBMapControl); ParameterList.Add(txtEMapControl); ParameterList.Add(SLP_BLocateControl + SLP_BLocateSecControl); ParameterList.Add(SLP_ELocateControl + SLP_ELocateSecControl); InsertOK = BCO.CreateByStockIn(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; } }
public void GetPageDefault() { IVMModel.MaintainPickData DBO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); string BDefaultSec = DBO.GetDefaultLocateSecByUse("A"); SLP_BLocate.Text = BDefaultSec; TextBox txtBlocaeNo = (TextBox)SLP_BLocate.FindControl("TextBoxCode"); TextBox txtBlocaeSec = (TextBox)SLP_BLocate.FindControl("TextBoxCode2"); txtBlocaeNo.Enabled = false; txtBlocaeSec.Enabled = false; string EDefaultSec = DBO.GetMinStockLocateIn(); SLP_ELocate.Text = EDefaultSec; hid_ESec.Value = EDefaultSec; TextBox txtElocaeSec = (TextBox)SLP_ELocate.FindControl("TextBoxCode2"); txtElocaeSec.Enabled = false; //this.btnRePrint.Enabled = false; this.btnMaintain.Enabled = false; ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM155", "ImageDisabled();", true); }
protected void btnPrint_Click(object sender, EventArgs e) { SLP_ELocate.Text = this.hid_ESec.Value; string strErr = ""; string UserID = Session["UID"].ToString(); string PickDate = DateTime.Now.ToString("yyyyMMddHHmmss"); string BLocateSec = SLP_BLocate.Text; string ELocateSec = SLP_ELocate.Text; string PickNo = string.Empty; string OK = string.Empty; bool InsertOK = false; TextBox txtBNo = (TextBox)this.SLP_BLocate.FindControl("TextBoxCode"); TextBox txtENo = (TextBox)this.SLP_ELocate.FindControl("TextBoxCode"); TextBox txtESec = (TextBox)this.SLP_ELocate.FindControl("TextBoxCode2"); if (txtBNo.Text == txtENo.Text) { txtESec.Enabled = true; } else { txtESec.Enabled = false; } //檢查儲位不得為空值 if (SLP_ELocate.Text == string.Empty || SLP_ELocate.Text.Length != 6) { strErr = "請輸入正確儲位資料"; ErrorMsgLabel.Text = strErr; return; } //若 [驗收單號起] 及 [驗收單號迄] 只有一個欄位有值,則兩個欄位都填入相同的值 if (txtBMap.Text == string.Empty && txtEMap.Text == string.Empty) { strErr = "請輸入驗收單號"; ErrorMsgLabel.Text = strErr; return; } else { if (txtBMap.Text == string.Empty) { txtBMap.Text = txtEMap.Text; } if (txtEMap.Text == string.Empty) { txtEMap.Text = txtBMap.Text; } } //比較單號號碼 if (txtBMap.Text.Length != 10 && txtEMap.Text.Length != 10) { strErr = "請輸入正確驗收單號"; this.ErrorMsgLabel.Text = strErr; return; } string BMap = txtBMap.Text; string EMap = txtEMap.Text; string BMapNum = BMap.Substring(1, 9); string EMapNum = EMap.Substring(1, 9); int intBMap = 0; int intEMap = 0; if (int.TryParse(BMapNum, out intBMap) == false || int.TryParse(EMapNum, out intEMap) == false) { strErr = "請輸入正確驗收單號"; this.ErrorMsgLabel.Text = strErr; return; } else { if (intBMap > intEMap) { strErr = "單號迄值不可小於單號起值,請重新輸入"; this.ErrorMsgLabel.Text = strErr; return; } } if (SLP_BLocate.Text == SLP_ELocate.Text) { strErr = "上下架儲位不可相同,請重新選擇"; this.ErrorMsgLabel.Text = strErr; return; } txtPickNo.Text = string.Empty; //btnRePrint.Enabled = false; btnMaintain.Enabled = false; try { IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); ParameterList.Add(txtBMap.Text); ParameterList.Add(txtEMap.Text); ParameterList.Add(4); string MapNos = BCO.CheckIsExistByMAPNo(ParameterList); if (MapNos != string.Empty) { strErr = "驗收單" + MapNos + "已被用來產生過揀貨單"; ErrorMsgLabel.Text = strErr; return; } ParameterList.Clear(); ParameterList.Add(UserID); ParameterList.Add(PickDate); ParameterList.Add(BMap); ParameterList.Add(EMap); ParameterList.Add(BLocateSec); ParameterList.Add(ELocateSec); InsertOK = BCO.CreateByStockIn(ParameterList, null, out OK, out PickNo); if (OK == "0") { strErr = "查無符合資料"; this.ErrorMsgLabel.Text = strErr; return; } else { //btnPrint.Enabled = false; //btnRePrint.Enabled = true; btnMaintain.Enabled = true; this.txtPickNo.Text = PickNo; if (OK == "2") { strErr = "有商品於下架儲位庫存不足"; this.ErrorMsgLabel.Text = strErr; } } ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM155", "DoPrint();", true); } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } }
public static string GetLocateNo(string ELocateNo) { string LocateSection = ""; IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); ParameterList.Add(ELocateNo); ParameterList.Add("1"); LocateSection = BCO.GetDefaultLocateByAttr(ParameterList); return LocateSection; }
protected void btnPrint_Click(object sender, EventArgs e) { string strErr = ""; string UserID = Session["UID"].ToString(); string PickDate = DateTime.Now.ToString("yyyyMMddHHmmss"); string TransDate = this.SLP_CustDate.Text; string AcceptDate = this.SLP_Date.Text; string PickNo = string.Empty; string OK = string.Empty; bool InsertOK = false; //this.btnRePrint.Enabled = false; this.btnMaintain.Enabled = false; if (SLP_CustDate.Text == string.Empty && SLP_Date.Text == string.Empty) { strErr = "請至少輸入一個條件"; ErrorMsgLabel.Text = strErr; return; } else { int Day = int.Parse(DateTime.Now.AddDays(-9).ToString("yyyyMMdd")); int CustDay = int.Parse((DateTime.Parse(TransDate + " 00:00:00")).ToString("yyyyMMdd")); if (CustDay < Day) { strErr = "客戶查補日不可小於系統日-9日"; ErrorMsgLabel.Text = strErr; return; } } try { IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); ParameterList.Add(UserID); ParameterList.Add(PickDate); ParameterList.Add(TransDate); ParameterList.Add(AcceptDate); InsertOK = BCO.CreateByCRMTrans(ParameterList, null, out OK, out PickNo); if (OK == "0") { strErr = "查無符合條件的資料"; ErrorMsgLabel.Text = strErr; return; } else { for (int i = 0; i < PickNo.Split(',').Length; i++) { LstBoxPicks.Items.Add(PickNo.Split(',')[i].ToString()); } //this.btnPrint.Enabled = false; this.btnMaintain.Enabled = true; //this.btnRePrint.Enabled = true; LstBoxPicks.SelectedIndex = 0; if (OK == "2") { strErr = "有商品於儲位庫存不足"; } } ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM158", "DoPrint();", true); } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } }
/// <summary> /// /// </summary> /// <param name="PickNo">揀貨單號</param> /// <param name="s_FileName">Excel報表的檔名</param> /// <param name="s_rptFilePath">rpt檔的路徑</param> /// <param name="reportFormatType">檔案型態</param> /// <param name="ReportOrderOption">排序類型 "item":品項 "locate":儲位 </param> private void LoadCrystalReport(string PickNo, string s_FileName, string s_rptFilePath, string reportFormatType, string ReportOrderOption) { try { IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); report.Load(Server.MapPath(s_rptFilePath)); ParameterList.Clear(); ParameterList.Add(PickNo); if (s_rptFilePath != "./REPORT/IVM15/CRIVM15R03.rpt") { DataTable dtResult = new DataTable(); string ProgName = ""; if (s_rptFilePath == "./REPORT/IVM15/CRIVM15R01.rpt") { dtResult = BCO.GetPrintRpt01(ParameterList); ProgName = "IVM15R01"; } else { dtResult = BCO.GetPrintRpt02(ParameterList); ProgName = "IVM15R02"; } DataView dv = new DataView(dtResult); switch (ReportOrderOption) { case "item": dv.Sort = "item"; break; case "locate": dv.Sort = "BLocate_No"; break; default: dv.Sort = "item"; break; } report.SetDataSource(dv.ToTable()); report.SetParameterValue("paraProg", ProgName); report.SetParameterValue("paraUserID", Session["UID"].ToString()); report.SetParameterValue("paraPickNo", PickNo); report.SetParameterValue("paraSource", this.MenuIVM15.SelectedItem.Text); report.SetParameterValue("paraAccDate", ""); report.SetParameterValue("paraReturnNo", ""); report.SetParameterValue("paraRemoveNo", ""); report.SetParameterValue("paraBLocate", ""); report.SetParameterValue("paraELocate", ""); report.SetParameterValue("paraVendor", ""); } else { DataTable dtResult = new DataTable(); dtResult = BCO.GetPrintRpt03(ParameterList); report.SetDataSource(dtResult); report.SetParameterValue("paraProg", "IVM15R03"); report.SetParameterValue("paraUserID", Session["UID"].ToString()); //report.SetParameterValue("paraKind", ""); } switch (reportFormatType) { case "EXCEL": System.IO.Stream streamXLS = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.Excel); byte[] bytesXLS = new byte[streamXLS.Length]; streamXLS.Read(bytesXLS, 0, bytesXLS.Length); streamXLS.Seek(0, System.IO.SeekOrigin.Begin); //export file Response.ClearContent(); Response.ClearHeaders(); Response.AddHeader("content-disposition", "attachment;filename=" + s_FileName);//excel檔名 Response.ContentType = "application/vnd.ms-excel"; Response.OutputStream.Write(bytesXLS, 0, bytesXLS.Length); Response.Flush(); Response.Close(); break; case "PDF": System.IO.Stream streamPDF = report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat); byte[] bytesPDF = new byte[streamPDF.Length]; streamPDF.Read(bytesPDF, 0, bytesPDF.Length); streamPDF.Seek(0, System.IO.SeekOrigin.Begin); //export file Response.ClearContent(); Response.ClearHeaders(); Response.AddHeader("content-disposition", "attachment;filename=" + s_FileName);//excel檔名 Response.ContentType = "application/pdf"; Response.OutputStream.Write(bytesPDF, 0, bytesPDF.Length); Response.Flush(); Response.Close(); break; default: break; } report.Close(); } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } }
public static string MakePickUpBill(string ReturnNoControl, string SLP_DateControl, string SLP_PMAControl, string SLP_RootNoControl, 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(ReturnNoControl); ParameterList.Add(SLP_PMAControl); ParameterList.Add(SLP_RootNoControl); ParameterList.Add(SLP_BLocateControl + SLP_BLocateSecControl); ParameterList.Add(SLP_ELocateControl + SLP_ELocateSecControl); InsertOK = BCO.CreateByBackWard(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; } }
public static string MakePickUpBill(string UserID, string RemoveNoControl, string SLP_ELocateControl, string SLP_ELocateSecControl ) { bool InsertOK = false; string OK = ""; string PickNos = ""; string MapNos = ""; try { //return "2|PK908120001,PK908120002"; IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); ParameterList.Add(RemoveNoControl); ParameterList.Add(RemoveNoControl); ParameterList.Add(1); MapNos = BCO.CheckIsExistByMAPNo(ParameterList); if (MapNos != string.Empty) { return "0|移轉單" + MapNos + "已被用來產生過揀貨單"; } else { //建立揀貨單 ParameterList.Clear(); ParameterList.Add(UserID); ParameterList.Add(DateTime.Now.ToString("yyyyMMddHHmmss")); ParameterList.Add(RemoveNoControl); ParameterList.Add(SLP_ELocateControl); ParameterList.Add(SLP_ELocateSecControl); InsertOK = BCO.CreateByTrans(ParameterList, null, out OK, out PickNos); if (OK == "0") { return OK + "|查無符合條件的資料"; } return OK + "|" + PickNos; } } catch (Exception ex) { throw ex; } }
private void GetPageDefault() { try { string LocateSec = ""; string NextAcceptDate = ""; //取得下次門市進貨日 //Pending IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); LocateSec = BCO.GetDefaultLocateSecByUse("A"); this.SLP_BLocate.Text = LocateSec; this.SLP_BLocate.ReadOnly = true; LocateSec = BCO.GetDefaultLocateSecByUse("C"); this.SLP_ELocate.Text = LocateSec; this.SLP_ELocate.ReadOnly = true; CGRModel.MaintainAcceptDate BCOCGR = new CGRModel.MaintainAcceptDate(ConntionDB); ParameterList.Clear(); ParameterList.Add(DateTime.Now.ToString("yyyy/MM/dd")); NextAcceptDate = BCOCGR.GetNextAcceptDate(ParameterList); hid_NextAcceptDate.Value = NextAcceptDate; SLP_Date.Text = NextAcceptDate; //SLP_Date.ReadOnly = true; } catch (Exception ex) { throw ex; } }
private void dataBind() { try { string SessionIDName = "IVM15B_" + PageTimeStamp.Value; IVMModel.MaintainPickData IVMBCO = new IVMModel.MaintainPickData(ConntionDB); DataTable dtResult = IVMBCO.GetPickNoByDate(SLP_PickDate.Text); if (dtResult.Rows.Count == 0) { ScriptManager.RegisterStartupScript(Page, this.GetType(), "IVM15B.aspx", "alert(' 查無資料 ');", true); } Session[SessionIDName] = dtResult; GridView1.DataSource = dtResult; GridView1.PageIndex = 0; GridView1.DataBind(); } catch (Exception ex) { throw ex; } }
public void GetPageDefault() { IVMModel.MaintainPickData DBO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); string DefaultSec = DBO.GetDefaultLocateSecByUse("B"); SLP_BLocate.Text = DefaultSec.Substring(0, 1); TextBox txtBlocateNo = (TextBox)SLP_BLocate.FindControl("TextBoxCode"); txtBlocateNo.Enabled = false; SLP_ELocate.Text = DefaultSec; TextBox txtElocateNo = (TextBox)SLP_ELocate.FindControl("TextBoxCode"); txtElocateNo.Enabled = false; TextBox txtElocateSec = (TextBox)SLP_ELocate.FindControl("TextBoxCode2"); txtElocateSec.Enabled = false; //this.btnRePrint.Enabled = false; this.btnMaintain.Enabled = false; //ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM156", "BImageDisabled();", true); }
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; } }
public static string MakePickUpBill(string SLP_CustDateControl, string SLP_DateControl, string UserIdControl ) { bool InsertOK = false; string OK = ""; string PickNos = ""; string MapNos = ""; try { //return "2|PK908120001,PK908120002"; int Day = int.Parse(DateTime.Now.AddDays(-9).ToString("yyyyMMdd")); int CustDay = int.Parse((DateTime.Parse(SLP_CustDateControl + " 00:00:00")).ToString("yyyyMMdd")); if (CustDay < Day) { return "0|客戶查補日不可小於系統日-9日"; } IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); ParameterList.Add(UserIdControl); ParameterList.Add(DateTime.Now.ToString("yyyyMMddHHmmss")); ParameterList.Add(SLP_CustDateControl); ParameterList.Add(SLP_DateControl); InsertOK = BCO.CreateByCRMTrans(ParameterList, null, out OK, out PickNos); if (OK == "0") { return OK + "|查無符合條件的資料"; } return OK + "|" + PickNos; } catch (Exception ex) { throw ex; } }
protected void btnPrint_Click(object sender, EventArgs e) { SLP_ELocateSec.Text = hid_ESec.Value; string strErr = ""; string UserID = Session["UID"].ToString(); string PickDate = DateTime.Now.ToString("yyyyMMddHHmmss"); string InOutDate = SLP_Date.Text; string InOutNo = txtReturnNo.Text; string PMA = SLP_PMA.Text; string RootNo = SLP_RootNo.Text; string BLocateSec = SLP_BLocateSec.Text; string ELocateSec = SLP_ELocateSec.Text; TextBox txtBNo = (TextBox)this.SLP_BLocateSec.FindControl("TextBoxCode"); TextBox txtENo = (TextBox)this.SLP_ELocateSec.FindControl("TextBoxCode"); TextBox txtESec = (TextBox)this.SLP_ELocateSec.FindControl("TextBoxCode2"); if (txtBNo.Text == txtENo.Text) { txtESec.Enabled = true; } else { txtESec.Enabled = false; } if (BLocateSec == string.Empty || ELocateSec == string.Empty) { strErr = "上下儲位不可為空白"; ErrorMsgLabel.Text = strErr; return; } else { if (BLocateSec.Length != 6 || ELocateSec.Length != 6) { strErr = "上下儲位輸入錯誤"; ErrorMsgLabel.Text = strErr; return; } } if (BLocateSec == ELocateSec) { strErr = "上下儲位不可相同"; ErrorMsgLabel.Text = strErr; return; } string PickNo = string.Empty; string OK = string.Empty; bool InsertOK = false; //判斷必要條件 if (this.SLP_Date.Text == string.Empty && txtReturnNo.Text == string.Empty) { strErr = "請至少輸入一個日期條件"; ErrorMsgLabel.Text = strErr; return; } txtPickNo.Text = string.Empty; //btnRePrint.Enabled = false; btnMaintain.Enabled = false; try { IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); ParameterList.Add(UserID); ParameterList.Add(PickDate); ParameterList.Add(InOutDate); ParameterList.Add(InOutNo); ParameterList.Add(PMA); ParameterList.Add(RootNo); ParameterList.Add(BLocateSec); ParameterList.Add(ELocateSec); InsertOK = BCO.CreateByBackWard(ParameterList, null, out OK, out PickNo); if (OK == "0") { strErr = "查無符合資料"; //ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM153", "alert('" + strErr + "');", true); ErrorMsgLabel.Text = strErr; return; } else { //btnPrint.Enabled = false; //btnRePrint.Enabled = true; btnMaintain.Enabled = true; this.txtPickNo.Text = PickNo; if (OK == "2") { strErr = "有商品於下架儲位庫存不足"; //ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM153", "alert('" + strErr + "');", true); ErrorMsgLabel.Text = strErr; } } ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM153", "DoPrint();", true); } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } }
private void GetPageDefault() { try { //抓下次門市進貨日 CGRModel.MaintainAcceptDate BCOCGR = new CGRModel.MaintainAcceptDate(ConntionDB); ParameterList.Clear(); ParameterList.Add(DateTime.Now.ToString("yyyy/MM/dd")); string NextAcceptDate = BCOCGR.GetNextAcceptDate(ParameterList); hid_NextAcceptDate.Value = NextAcceptDate; SLP_Date.Text = NextAcceptDate; IVMModel.MaintainPickData DBO = new IVMModel.MaintainPickData(ConntionDB); string BLocateSec = ""; //取得下架儲位預設值 BLocateSec = DBO.GetDefaultLocateSecByUse("A"); this.SLP_BLocateSec.Text = BLocateSec; TextBox txtBLocateNo = (TextBox)this.SLP_BLocateSec.FindControl("TextBoxCode"); txtBLocateNo.Enabled = false; TextBox txtBLocateSec = (TextBox)this.SLP_BLocateSec.FindControl("TextBoxCode2"); txtBLocateSec.Enabled = false; //上架儲區預設[儲區]與[下架儲位]的[儲區]預設值相同 //預設[儲格] = 00A11 //可改 string ELocateSec = ""; ELocateSec = DBO.GetMinStockLocateIn(); this.SLP_ELocateSec.Text = ELocateSec; TextBox txtELocateNo = (TextBox)this.SLP_ELocateSec.FindControl("TextBoxCode"); txtELocateNo.Enabled = false; TextBox txtELocateSec = (TextBox)this.SLP_ELocateSec.FindControl("TextBoxCode2"); txtELocateSec.Enabled = false; //this.btnRePrint.Enabled = false; this.btnMaintain.Enabled = false; } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } }
public void GetPageDefault() { try { IVMModel.MaintainPickData DBO = new IVMModel.MaintainPickData(ConntionDB); SLP_RootNo.Text = DBO.GetRootNoDefault(); string BLocateSec = ""; //取得下架儲位預設值 BLocateSec = DBO.GetDefaultLocateSecByUse("D"); this.SLP_BLocateSec.Text = BLocateSec; TextBox txtBLocateNo = (TextBox)this.SLP_BLocateSec.FindControl("TextBoxCode"); txtBLocateNo.Enabled = false; TextBox txtBLocateSec = (TextBox)this.SLP_BLocateSec.FindControl("TextBoxCode2"); txtBLocateSec.Enabled = false; //上架儲區預設[儲區]與[下架儲位]的[儲區]預設值相同 //預設[儲格] = 01A11 //可改 if (SLP_ELocateSec.Text == "") { this.SLP_ELocateSec.Text = BLocateSec.Substring(0, 1) + "01A11"; } hid_ESec.Value = SLP_ELocateSec.Text; } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } }
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; } }
protected void btnRePrint_Click(object sender, EventArgs e) { int FunNo = 0; string PickNo = txtPickNo.Text; string strErr = string.Empty; if (this.txtPickNo.Text == string.Empty) { strErr = "請輸入撿貨單號"; ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM15A", "alert('" + strErr + "');", true); return; } try { IVMModel.MaintainPickData DBO = new IVMModel.MaintainPickData(ConntionDB); FunNo = DBO.GetPickFunNo(txtPickNo.Text); if (FunNo == 99) { strErr = "無此揀貨單號"; ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM15A", "alert('" + strErr + "');", true); return; } else { if (rdbKind.SelectedIndex == 0) { if (rdbSort.SelectedIndex == 0) LoadCrystalReport(PickNo, HttpUtility.UrlEncode("揀貨單儲位匯總表列印.PDF"), "./REPORT/IVM15/CRIVM15R01.rpt", "PDF", "item"); else LoadCrystalReport(PickNo, HttpUtility.UrlEncode("揀貨單儲位匯總表列印.PDF"), "./REPORT/IVM15/CRIVM15R01.rpt", "PDF", "locate"); } else if (rdbKind.SelectedIndex == 1) { if (rdbSort.SelectedIndex == 0) LoadCrystalReport(PickNo, HttpUtility.UrlEncode("揀貨單儲格明細表列印.PDF"), "./REPORT/IVM15/CRIVM15R02.rpt", "PDF", "item"); else LoadCrystalReport(PickNo, HttpUtility.UrlEncode("揀貨單儲格明細表列印.PDF"), "./REPORT/IVM15/CRIVM15R02.rpt", "PDF", "locate"); } else { if (FunNo != 6) { strErr = "非手開單揀貨單號"; ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM15A", "alert('" + strErr + "');", true); return; } if (rdbSort.SelectedIndex == 0) LoadCrystalReport(PickNo, HttpUtility.UrlEncode("揀貨單門市揀貨明細表列印.PDF"), "./REPORT/IVM15/CRIVM15R03.rpt", "PDF", "item"); else LoadCrystalReport(PickNo, HttpUtility.UrlEncode("揀貨單門市揀貨明細表列印.PDF"), "./REPORT/IVM15/CRIVM15R03.rpt", "PDF", "locate"); } } } catch (Exception ex) { throw ex; } }
protected void btnPrint_Click(object sender, EventArgs e) { ErrorMsgLabel.Text = ""; string strErr = ""; //判斷資料輸入完整性 if (SLP_BLocateSec.Text == string.Empty || SLP_BLocateSec.Text.Length != 6 || SLP_ELocateSec.Text == string.Empty || SLP_ELocateSec.Text.Length != 6) { strErr = "上下架儲位輸入不完整,請重新輸入"; ErrorMsgLabel.Text = strErr; return; } if (SLP_BLocateSec.Text == SLP_ELocateSec.Text) { strErr = "上下架儲位不得相同,請重新輸入"; ErrorMsgLabel.Text = strErr; return; } 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; try { IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); ParameterList.Clear(); ParameterList.Add(UserID); ParameterList.Add(PickDate); ParameterList.Add(""); ParameterList.Add(SLP_BLocateSec.Text); ParameterList.Add(SLP_ELocateSec.Text); InsertOK = BCO.CreateByLocateSec(ParameterList, null, out OK, out PickNo); if (OK == "0") { //this.btnPrint.Enabled = true; strErr = "查無符合條件的資料"; ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM159", "alert('" + strErr + "');", true); return; } else { this.txtPickNo.Text = PickNo; //this.btnPrint.Enabled = false; this.btnMaintain.Enabled = true; //this.btnRePrint.Enabled = true; } ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(UpdatePanel), "IVM159", "DoPrint();", true); } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } }
public static string SendReportMessage(string PickNoControl, string UserIdControl, string kind, string sort ) { int FunNo = 0; IVMModel.MaintainPickData DBO = new IVMModel.MaintainPickData(ConntionDB); FunNo = DBO.GetPickFunNo(PickNoControl); if (FunNo == 99) { return "Error1"; } string ReportCode = ""; string ProgName = "", FileName = "", FilePath = ""; switch (kind) { case "0": if (sort == "0") ReportCode = "VIM157_10"; else ReportCode = "VIM157_11"; ProgName = "IVM15A"; FileName = "揀貨單儲位匯總表列印"; FilePath = "REPORT\\IVM15\\CRIVM15R01.rpt"; break; case "1": if (sort == "0") ReportCode = "VIM157_20"; else ReportCode = "VIM157_21"; ProgName = "IVM15A"; FileName = "揀貨單儲格明細表列印"; FilePath = "REPORT\\IVM15\\CRIVM15R02.rpt"; break; case "2": if (FunNo != 6) { return "Error"; } ReportCode = "VIM157_3"; ProgName = "IVM15A"; FileName = "揀貨單門市揀貨清單列印"; FilePath = "REPORT\\IVM15\\CRIVM15R03.rpt"; break; } #region DB需要的變數 ReportParameter[] DBParameter = new ReportParameter[1]; DBParameter[0].ParameterName = "揀貨單號"; DBParameter[0].ParameterValue = PickNoControl; #endregion #region 報表變數 送出產生報表 string ProcessLogFile = ""; IVM_IVM15A IVMRPTPage = new IVM_IVM15A(); ReportParameter[] CryReportParameter; if (kind == "2") { CryReportParameter = new ReportParameter[2]; CryReportParameter[0].ParameterName = "paraProg"; CryReportParameter[0].ParameterValue = ProgName; CryReportParameter[1].ParameterName = "paraUserID"; CryReportParameter[1].ParameterValue = UserIdControl; } else { CryReportParameter = new ReportParameter[10]; CryReportParameter[0].ParameterName = "paraProg"; CryReportParameter[0].ParameterValue = ProgName; CryReportParameter[1].ParameterName = "paraUserID"; CryReportParameter[1].ParameterValue = UserIdControl; CryReportParameter[2].ParameterName = "paraPickNo"; CryReportParameter[2].ParameterValue = PickNoControl; CryReportParameter[3].ParameterName = "paraSource"; CryReportParameter[3].ParameterValue = "揀貨單列印處理"; CryReportParameter[4].ParameterName = "paraAccDate"; CryReportParameter[4].ParameterValue = ""; CryReportParameter[5].ParameterName = "paraReturnNo"; CryReportParameter[5].ParameterValue = ""; CryReportParameter[6].ParameterName = "paraRemoveNo"; CryReportParameter[6].ParameterValue = ""; CryReportParameter[7].ParameterName = "paraBLocate"; CryReportParameter[7].ParameterValue = ""; CryReportParameter[8].ParameterName = "paraELocate"; CryReportParameter[8].ParameterValue = ""; CryReportParameter[9].ParameterName = "paraVendor"; CryReportParameter[9].ParameterValue = ""; } IVMRPTPage.GenerReportConfigXML("IVM", "IVM15A.aspx", ReportCode, IVMRPTPage.Server.MapPath(FilePath), DBParameter, CryReportParameter, ReportOutputFormat.PDF, FileName, ref ProcessLogFile ); IVMRPTPage.Dispose(); #endregion return ProcessLogFile; }
public static string MakePickUpBill(string UID,string BDISNo, string EDISNo, string AcceptDate, string APLDate, string RootNo, string PMA) { try { IVMModel.MaintainPickData BCO = new IVMModel.MaintainPickData(ConntionDB); ArrayList ParameterList = new ArrayList(); ParameterList.Add(UID); ParameterList.Add(BDISNo); ParameterList.Add(EDISNo); ParameterList.Add(AcceptDate); ParameterList.Add(APLDate); ParameterList.Add(RootNo); ParameterList.Add(PMA); bool isOK; string PickNo = ""; int OK = 0; string OutMsg = ""; isOK = BCO.CreateByCRMOrder(ParameterList, out PickNo,out OutMsg,out OK, null); if (OK.ToString() == "0") { return "1|查無符合條件的資料"; } else if (OK.ToString() == "2") { return "2|"+ PickNo +"|有商品於下架儲位庫存不足" ; } else if (OK.ToString() == "3") { return "1|" + OutMsg.ToString(); } return "0|"+ PickNo; } catch (Exception ex) { return "1|" + ex.ToString(); } }