Ejemplo n.º 1
0
        /// <summary>
        /// 產生CAM08報表
        /// </summary>
        /// <param name="ParameterList">變數清單</param>
        /// <returns>回傳查詢結果</returns>
        public DataTable CAM08_1(ArrayList ParameterList)
        {
            CAMModel.ReportMonthSumSummary BCO = new CAMModel.ReportMonthSumSummary(ConntionDB);
            DataTable Dt;

            if (ParameterList[10].ToString() == "0")//彙總
            {
                if (ParameterList[11].ToString() == "0")//金額(牌價)
                {
                    Dt = BCO.GetCAM08R01Data(ParameterList);
                }
                else if (ParameterList[11].ToString() == "2")//金額(成本)
                {
                    Dt = BCO.GetCAM08R13Data(ParameterList);
                }
                else//數量
                {
                    Dt = BCO.GetCAM08R07Data(ParameterList);
                }
            }
            else//明細
            {
                if (ParameterList[11].ToString() == "0")//金額(牌價)
                {
                    Dt = BCO.GetCAM08R02Data(ParameterList);
                }
                else if (ParameterList[11].ToString() == "2")//金額(成本)
                {
                    Dt = BCO.GetCAM08R14Data(ParameterList);
                }
                else//數量
                {
                    Dt = BCO.GetCAM08R08Data(ParameterList);
                }
            }

            if (Dt.Rows.Count > 0)
            {
                return Dt;
            }
            else
            {
                throw new Exception("查無資料!!");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 產生CAM08報表
        /// </summary>
        /// <param name="ParameterList">變數清單</param>
        /// <returns>回傳查詢結果</returns>
        public DataTable CAM08_2(ArrayList ParameterList)
        {
            CAMModel.ReportMonthSumSummary BCO = new CAMModel.ReportMonthSumSummary(ConntionDB);
            DataTable Dt;

            if (ParameterList[12].ToString() == "0")//彙總
            {
                if (ParameterList[13].ToString() == "0")//金額
                {
                    Dt = BCO.GetCAM08R06Data(ParameterList);
                }
                else//數量
                {
                    Dt = BCO.GetCAM08R12Data(ParameterList);
                }
            }
            else//明細
            {
                if (ParameterList[13].ToString() == "0")//金額
                {
                    Dt = BCO.GetCAM08R05Data(ParameterList);
                }
                else//數量
                {
                    Dt = BCO.GetCAM08R11Data(ParameterList);
                }
            }

            if (Dt.Rows.Count > 0)
            {
                return Dt;
            }
            else
            {
                throw new Exception("查無資料!!");
            }
        }
Ejemplo n.º 3
0
    protected void but_Print1_Click(object sender, EventArgs e)
    {
        try
        {
            string strRptName = "";

            DataTable dt = new DataTable();

            BCO.ReportMonthSumSummary bco = new BCO.ReportMonthSumSummary(ConntionDB);

            ParameterList.Clear();


            if (((Button)sender).CommandName == "SALE_PDF" || ((Button)sender).CommandName == "SALE_EXEC")
            {
                ParameterList.Add(slp_Z_O.Text);
                ParameterList.Add(slp_SAL_ID.Text);
                ParameterList.Add(slp_GROUP_NO_S.Text);
                ParameterList.Add(slp_GROUP_NO_E.Text);
                ParameterList.Add(txtPAY_RFNO.Text);
                ParameterList.Add(txtRFNO.Text);
                ParameterList.Add(slp_STORE.Text);
                ParameterList.Add(slp_ROOTNO.Text);
                ParameterList.Add(slp_BUS_DATE.StartDate);
                ParameterList.Add(slp_BUS_DATE.EndDate);

                if (rdoREPORT_KIND1_1.SelectedValue == "0")//彙總
                {
                    if (rdoREPORT_KIND2_1.SelectedValue == "0")//金額
                    {
                        dt = bco.GetCAM08R01Data(ParameterList);
                        strRptName = "01";
                    }
                    else//數量
                    {
                        dt = bco.GetCAM08R07Data(ParameterList);
                        strRptName = "07";
                    }
                }
                else//明細
                {
                    if (rdoREPORT_KIND2_1.SelectedValue == "0")//金額
                    {
                        dt = bco.GetCAM08R02Data(ParameterList);
                        strRptName = "02";
                    }
                    else//數量
                    {
                        dt = bco.GetCAM08R08Data(ParameterList);
                        strRptName = "08";
                    }
                }
            }
            else
            {
                ParameterList.Add(slp_Z_O1.Text);
                ParameterList.Add(slp_SAL_ID1.Text);
                ParameterList.Add(slp_GROUP_NO_S1.Text);
                ParameterList.Add(slp_GROUP_NO_E1.Text);
                ParameterList.Add(txtPAY_RFNO1.Text);
                ParameterList.Add(txtRFNO1.Text);
                ParameterList.Add(slp_STORE1.Text);
                ParameterList.Add(slp_ROOTNO1.Text);
                ParameterList.Add(slp_BUS_YM_S.Text);
                ParameterList.Add(slp_BUS_YM_E.Text);
                ParameterList.Add(slp_ROLE.Text);
                ParameterList.Add(rdoAC_CLOSE.SelectedValue);

                if (rdoREPORT_KIND1_2.SelectedValue == "0")//彙總
                {
                    if (rdoREPORT_KIND2_2.SelectedValue == "0")//金額
                    {
                        dt = bco.GetCAM08R06Data(ParameterList);
                        strRptName = "06";
                    }
                    else//數量
                    {
                        dt = bco.GetCAM08R12Data(ParameterList);
                        strRptName = "12";
                    }
                }
                else//明細
                {
                    if (rdoREPORT_KIND2_2.SelectedValue == "0")//金額
                    {
                        dt = bco.GetCAM08R05Data(ParameterList);
                        strRptName = "05";
                    }
                    else//數量
                    {
                        dt = bco.GetCAM08R11Data(ParameterList);
                        strRptName = "11";
                    }
                }

            }

            if (dt.Rows.Count == 0)
            {
                this.ErrorMsgLabel.Text = "查無資料";
                return;
            }
            else
            {
                if (((Button)sender).CommandName == "SALE_PDF" || ((Button)sender).CommandName == "SETTLE_PDF")
                {
                    ShowReport(dt, strRptName, "PDF");
                }
                else
                {
                    ShowReport(dt, strRptName, "XLS");
                }
            }
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }