示例#1
0
        /// <summary>
        /// PSS03報表
        /// </summary>
        /// <param name="ParameterList">變數清單</param>
        /// <returns>回傳查詢結果</returns>
        public DataTable PSS03_1(ArrayList ParameterList, out DateTime D_START_DATE, out DateTime D_END_DATE, out string V_ADJ_IN_DESC, out string V_ADJ_OUT_DESC)
        {
            PSSModel.RecordingPSSDiffRpt bco = new PSSModel.RecordingPSSDiffRpt(ConntionDB);
            DataTable Dt = new DataTable();

            if (ParameterList[1].ToString() == "") ParameterList[1] = System.DBNull.Value;
            if (ParameterList[6].ToString() == "0")
                Dt = bco.QueryPSSDiffRpt(ParameterList, out D_START_DATE, out D_END_DATE, out V_ADJ_IN_DESC, out V_ADJ_OUT_DESC);
            else
                Dt = bco.QueryPSSAllRpt(ParameterList, out D_START_DATE, out D_END_DATE, out V_ADJ_IN_DESC, out V_ADJ_OUT_DESC);

            //if (Dt.Rows.Count == 0)
            //{
            //    throw new Exception("查無資料");
            //}
            //else
            //{
                return Dt;
            //}
        }
示例#2
0
    protected void btnExport_Click(object sender, EventArgs e)
    {
        try
        {
            this.btnExport.Attributes.Add("onclick", "OffPanel('" + this.ErrorMsgLabel.ClientID + "');");
            this.ErrorMsgLabel.Text = "";

            #region 檢查條件
            this.ErrorMsgLabel.Text = "";
            string s_CheckPage = CheckPage(sender);

            if (s_CheckPage != string.Empty)
            {
                this.ErrorMsgLabel.Text = s_CheckPage;
                return;
            }

            #endregion

            #region 傳入參數
            ParameterList.Clear();
            ParameterList = this.GetParameter();

            #endregion

            #region 取得資料

            DataTable dt_Return = new DataTable();
            DateTime D_START_DATE, D_END_DATE;
            string V_ADJ_IN_DESC, V_ADJ_OUT_DESC;
            BCO.RecordingPSSDiffRpt bco = new BCO.RecordingPSSDiffRpt(ConntionDB);
            if (rblRptType.Items[0].Selected)
                dt_Return = bco.QueryPSSDiffRpt(ParameterList, out D_START_DATE, out D_END_DATE, out V_ADJ_IN_DESC, out V_ADJ_OUT_DESC);
            else
                dt_Return = bco.QueryPSSAllRpt(ParameterList, out D_START_DATE, out D_END_DATE, out V_ADJ_IN_DESC, out V_ADJ_OUT_DESC);

            #endregion

            ShowReport(dt_Return, "XLS", D_START_DATE, D_END_DATE, V_ADJ_IN_DESC, V_ADJ_OUT_DESC);
        }
        catch (Exception ex)
        {
            this.ErrorMsgLabel.Text = ex.ToString();
        }
        finally { }
    }