/// <summary> /// 產生CGD25第一張報表_門市進貨單 /// </summary> /// <param name="ParameterList">查詢DB的參數</param> /// <returns>回傳查詢結果</returns> public DataTable CGD25_1(ArrayList ParameterList) { CGDModel.CGD25_BCO BCO = new CGDModel.CGD25_BCO(ConntionDB); DataTable Dt = BCO.ProcessStoreData(ParameterList); #region 檢查回傳資料 if (Dt.Rows.Count == 0) { throw new Exception("查無資料"); } #endregion return Dt; }
/// <summary> /// 未列印門市檢查 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnUnpringCheck_Click(object sender, EventArgs e) { try { ErrorMsgLabel.Text = ""; this.hid_PageStatus.Value = "PRINT"; CGDModel.CGD25_BCO BCO = new PIC.VDS2G.LGT.CGD.CGD25_BCO(ConntionDB); DataTable Dt; ParameterList.Clear(); ParameterList.Add(slpStAcceptDate.Text.Trim());//1 門市進貨日 Dt = BCO.CheckRouteStore(ParameterList); if (Dt.Rows.Count == 0) { this.hid_PageStatus.Value = "QUERY"; this.CrystalReportViewer1.Visible = false; ErrorMsgLabel.Text = "查無資料"; //ScriptManager.RegisterStartupScript(Page, this.GetType(), "CGD251.aspx", "alert(' 查無資料 ');", true); return; } else { #region 顯示報表 string s_FileName = ""; //設定輸出檔名 string s_rptFilePath = ""; //設定報表路徑 s_rptFilePath = Server.MapPath("./REPORT/CGD251R02.rpt"); s_FileName = HttpUtility.UrlEncode("未列印門市進貨單路線.PDF", System.Text.Encoding.UTF8); LoadCrystalReport(s_FileName, s_rptFilePath, Dt, "PDF", "2"); #endregion //ShowUnprintReport(Dt); } } catch (Exception ex) { ErrorMsgLabel.Text = ex.Message; } }