예제 #1
0
        /// <summary>
        /// CGR05報表
        /// </summary>
        /// <param name="ParameterList">變數清單</param>
        /// <returns>回傳查詢結果</returns>
        public DataTable CGR05_0(ArrayList ParameterList,
                                 string ReportOutputFormat,
                                 ref ReportList.ExcelOtherType EOT
                                 )
        {
            CGRModel.PrintSorterCheck bco = new CGRModel.PrintSorterCheck(ConntionDB);
            DataTable Dt = bco.PrintRpt(ParameterList);

            if (Dt.Rows.Count == 0)
            {
                throw new Exception("查無資料");
            }
            else
            {
                return Dt;
            }
        }
예제 #2
0
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        try
        {
            if (VerifyFormData())
            {
                DateTime S_Date;
                DateTime E_Date;

                DataTable Dt;
                CGRModel.PrintSorterCheck BCO = new PIC.VDS2G.LGT.CGR.PrintSorterCheck(ConntionDB);

                ParameterList.Clear();

                if (DateTime.TryParse(SLP_P_Date.StartDate, out S_Date))
                {
                    ParameterList.Add(SLP_P_Date.StartDate);
                }
                else
                {
                    ParameterList.Add(SLP_P_Date.EndDate);
                }

                if (DateTime.TryParse(SLP_P_Date.EndDate, out E_Date))
                {
                    ParameterList.Add(SLP_P_Date.EndDate);
                }
                else
                {
                    ParameterList.Add(SLP_P_Date.StartDate);
                }
                ParameterList.Add(SLP_RootNo.Text);

                Dt = BCO.PrintRpt(ParameterList);

                if (Dt.Rows.Count > 0)
                {

                    ExportReport(Dt);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(Page, this.GetType(), "CGR051.aspx", "alert(' 查無資料 ');", true);
                }
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
    }