Exemplo n.º 1
0
    protected void but_Print_Click(object sender, EventArgs e)
    {
        try
        {
            ParameterList.Clear();
            ParameterList.Add(slp_ACCT_MONTH_S.Text);
            ParameterList.Add(slp_ACCT_MONTH_E.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_PROFIT_CENTER_S.Text);
            ParameterList.Add(slp_PROFIT_CENTER_E.Text);
            ParameterList.Add(slp_STORE.Text);
            ParameterList.Add(slp_ROOT_NO.Text);
            ParameterList.Add(slp_TAX_TYPE.Text);

            DataTable dt = new DataTable();

            ReportChainAcctDiff bco = new ReportChainAcctDiff(ConntionDB);

            if (this.rdoRPT_TYPE.SelectedIndex == 1)
            {
                dt = bco.GetCAM30R01Data(ParameterList);
            }
            else
            {
                dt = bco.GetCAM30R02Data(ParameterList);
            }

            if (dt.Rows.Count == 0)
            {
                this.ErrorMsgLabel.Text = "查無資料";
                return;
            }
            else
            {
                ShowReport(dt, ((Button)sender).CommandName);
            }
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }
Exemplo n.º 2
0
    protected void but_Print2_Click(object sender, EventArgs e)
    {
        try
        {
            if (slpTAB3_CloseYM_E.Text == "")
                slpTAB3_CloseYM_E.Text = slpTAB3_CloseYM_B.Text;
            if (slpTAB3_PayDate.EndDate == "")
                slpTAB3_PayDate.EndDate = slpTAB3_PayDate.StartDate;
            if (slpTAB3_SignDate.EndDate == "")
                slpTAB3_SignDate.EndDate = slpTAB3_SignDate.StartDate;
            if (slpTAB3_StoreGroup_E.Text == "")
                slpTAB3_StoreGroup_E.Text = slpTAB3_StoreGroup_B.Text;
            if (slpTAB3_CHAN_NO_E.Text == "")
                slpTAB3_CHAN_NO_E.Text = slpTAB3_CHAN_NO_B.Text;
            if (slpTAB3_STORE_E.Text == "")
                slpTAB3_STORE_E.Text = slpTAB3_STORE_B.Text;
            if (txtTAB3_RFNO_E.Text == "")
                txtTAB3_RFNO_E.Text = txtTAB3_RFNO_B.Text;
            if (slpTAB3_ITEM_E.Text == "")
                slpTAB3_ITEM_E.Text = slpTAB3_ITEM_B.Text;
            if (txtTAB3_PERIOD_E.Text == "")
                txtTAB3_PERIOD_E.Text = txtTAB3_PERIOD_B.Text;

            if ((slpTAB3_CloseYM_B.Text == "") && (slpTAB3_PayDate.StartDate == "") && (slpTAB3_SignDate.StartDate == ""))
            {
                this.ErrorMsgLabel.Text = "結帳年月/入帳日期/簽收日期至少要輸入一個條件";
                return;
            }
            string V_CLOSE_MONTH_S = slpTAB3_CloseYM_B.Text;
            string V_CLOSE_MONTH_E = slpTAB3_CloseYM_E.Text;
            string D_PAY_DATE_S = slpTAB3_PayDate.StartDate;
            string D_PAY_DATE_E = slpTAB3_PayDate.EndDate;
            string D_SIGN_DATE_S = slpTAB3_SignDate.StartDate;
            string D_SIGN_DATE_E = slpTAB3_SignDate.EndDate;
            string V_GROUP_NO_S = slpTAB3_StoreGroup_B.Text;
            string V_GROUP_NO_E = slpTAB3_StoreGroup_E.Text;
            string V_CHAN_NO_S = slpTAB3_CHAN_NO_B.Text;
            string V_CHAN_NO_E = slpTAB3_CHAN_NO_E.Text;
            string V_STORE_S = slpTAB3_STORE_B.Text;
            string V_STORE_E = slpTAB3_STORE_E.Text;
            string V_PAY_RFNO_S = txtTAB3_RFNO_B.Text.Trim();
            string V_PAY_RFNO_E = txtTAB3_RFNO_E.Text.Trim();
            string V_ROOT_NO = rbtTAB3_Root.SelectedValue;
            string V_STAKIND = string.Empty;
            if (chkTAB3_STAKIND.Items[0].Selected == true)
                V_STAKIND = "1";
            else
                V_STAKIND = "0";
            if (chkTAB3_STAKIND.Items[1].Selected == true)
                V_STAKIND += "1";
            else
                V_STAKIND += "0";
            if (chkTAB3_STAKIND.Items[2].Selected == true)
                V_STAKIND += "1";
            else
                V_STAKIND += "0";
            if (chkTAB3_STAKIND.Items[3].Selected == true)
                V_STAKIND += "1";
            else
                V_STAKIND += "0";

            if(V_STAKIND=="0000")
            {
                this.ErrorMsgLabel.Text = "單別至少要勾選一種類型";
                return;
            }

            string V_TAX_TYPE = rbtTAB3_TAX_TYPE.SelectedValue;
            string V_ITEM_S = slpTAB3_ITEM_B.Text;
            string V_ITEM_E = slpTAB3_ITEM_E.Text;
            string V_PERIOD_S = txtTAB3_PERIOD_B.Text;
            string V_PERIOD_E = txtTAB3_PERIOD_E.Text;
            string V_RPT_DATA = rbtTAB3_RPT_DATA.SelectedValue;

            DataTable dtResult = new DataTable();

            ReportChainAcctDiff bco = new ReportChainAcctDiff(ConntionDB);

            //0.V_CLOSE_MONTH_S  VDS_CAM_PAY_ITEM.CLOSE_MONTH%TYPE,  --結帳年月起
            //1.V_CLOSE_MONTH_E  VDS_CAM_PAY_ITEM.CLOSE_MONTH%TYPE,  --結帳年月迄
            //2.D_PAY_DATE_S     DATE,                               --入帳日起
            //3.D_PAY_DATE_E     DATE,                               --入帳日迄
            //4.D_SIGN_DATE_S    DATE,                               --簽收日起
            //5.D_SIGN_DATE_E    DATE,                               --簽收日迄
            //6.V_GROUP_NO_S     VDS_STM_STOREGROUP.CODE%TYPE,       --店群起
            //7.V_GROUP_NO_E     VDS_STM_STOREGROUP.CODE%TYPE,       --店群迄
            //8.V_CHAN_NO_S      VDS_CAM_PAY_ITEM.CHAN_NO%TYPE,      --通路起
            //9.V_CHAN_NO_E      VDS_CAM_PAY_ITEM.CHAN_NO%TYPE,      --通路迄
            //10.V_STORE_S        VDS_CAM_PAY_ITEM.STORE%TYPE,        --店號起
            //11.V_STORE_E        VDS_CAM_PAY_ITEM.STORE%TYPE,        --店號迄
            //12.V_PAY_RFNO_S     VDS_STM_ACCOUNT_PROPERTY.PAY_RFNO%TYPE, --結帳統編起
            //13.V_PAY_RFNO_E     VDS_STM_ACCOUNT_PROPERTY.PAY_RFNO%TYPE, --結帳統編迄
            //14.V_ROOT_NO        VDS_CAM_PAY_ITEM.ROOT_NO%TYPE,      --群分類 (1:雜誌 2:圖書)   
            //15.V_STAKIND        VARCHAR2, --來源區分 (1:進貨,2:退貨,3:補帳,4:調撥)        
            //16.V_TAX_TYPE       VDS_CAM_PAY_ITEM.TAX_TYPE%TYPE,     --稅別(0:應稅 1:免稅)
            //17.V_ITEM_S         VDS_CAM_PAY_ITEM.ITEM%TYPE,         --品號起
            //18.V_ITEM_E         VDS_CAM_PAY_ITEM.ITEM%TYPE,         --品號迄
            //19.V_PERIOD_S       VDS_CAM_PAY_ITEM.PERIOD%TYPE,       --期別起
            //20.V_PERIOD_E       VDS_CAM_PAY_ITEM.PERIOD%TYPE,       --期別迄
            //21.V_RPT_DATA       VARCHAR2, --報表資料 (1:取全部,0:只有差異才取)
            ParameterList.Clear();
            ParameterList.Add(V_CLOSE_MONTH_S);
            ParameterList.Add(V_CLOSE_MONTH_E);
            ParameterList.Add(D_PAY_DATE_S);
            ParameterList.Add(D_PAY_DATE_E);
            ParameterList.Add(D_SIGN_DATE_S);
            ParameterList.Add(D_SIGN_DATE_E);
            ParameterList.Add(V_GROUP_NO_S);
            ParameterList.Add(V_GROUP_NO_E);
            ParameterList.Add(V_CHAN_NO_S);
            ParameterList.Add(V_CHAN_NO_E);
            ParameterList.Add(V_STORE_S);
            ParameterList.Add(V_STORE_E);
            ParameterList.Add(V_PAY_RFNO_S);
            ParameterList.Add(V_PAY_RFNO_E);
            ParameterList.Add(V_ROOT_NO);
            ParameterList.Add(V_STAKIND);
            ParameterList.Add(V_TAX_TYPE);
            ParameterList.Add(V_ITEM_S);
            ParameterList.Add(V_ITEM_E);
            ParameterList.Add(V_PERIOD_S);
            ParameterList.Add(V_PERIOD_E);
            ParameterList.Add(V_RPT_DATA);

            if (this.rdoRPT_TYPE.SelectedValue == "0")
            {
                dtResult = bco.GetCAM30R08Data(ParameterList);
            }

            if (dtResult.Rows.Count == 0)
            {
                this.ErrorMsgLabel.Text = "查無資料";
                return;
            }
            else
            {
                ShowReport2(dtResult, ((Button)sender).CommandName);
            }
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }
Exemplo n.º 3
0
    protected void but_Print1_Click(object sender, EventArgs e)
    {
        try
        {
            if (slp_BUS_DATE.StartDate == "" && slp_BUS_DATE.EndDate == "" && SLP_PAY_MONTH_S.Text == "" && SLP_PAY_MONTH_E.Text == "")
            {
                this.ErrorMsgLabel.Text = "【銷貨日期】與【PAY結帳年月】請擇一輸入";
                return;
            }

            if (slp_BUS_DATE.StartDate != "" && slp_BUS_DATE.EndDate == "")
            {
                this.ErrorMsgLabel.Text = "銷貨日期_起 如有輸入 迄 也要有";
                return;
            }

            if (slp_BUS_DATE.StartDate == "" && slp_BUS_DATE.EndDate != "")
            {
                this.ErrorMsgLabel.Text = "銷貨日期_迄 如有輸入 起 也要有";
                return;
            }

            if (SLP_PAY_MONTH_S.Text != "" && SLP_PAY_MONTH_E.Text == "")
            {
                this.ErrorMsgLabel.Text = "PAY 結帳年月_起 如有輸入 迄 也要有";
                return;
            }

            if (SLP_PAY_MONTH_S.Text == "" && SLP_PAY_MONTH_E.Text != "")
            {
                this.ErrorMsgLabel.Text = "PAY 結帳年月_迄 如有輸入 起 也要有";
                return;
            }

            CAMCommon bco1 = new CAMCommon();

            ParameterList.Clear();
            ParameterList.Add(bco1.GetValueSetParameter(slp_BUS_DATE.StartDate, "date", false));
            ParameterList.Add(bco1.GetValueSetParameter(slp_BUS_DATE.EndDate, "date", false));
            ParameterList.Add(bco1.GetValueSetParameter(SLP_PAY_MONTH_S.Text, "string", false));
            ParameterList.Add(bco1.GetValueSetParameter(SLP_PAY_MONTH_E.Text, "string", false));
            ParameterList.Add(bco1.GetValueSetParameter(slp_BUS_YM.Text, "string", false));
            ParameterList.Add(bco1.GetValueSetParameter(slp_GROUP_NO_S1.Text, "string", false));
            ParameterList.Add(bco1.GetValueSetParameter(slp_GROUP_NO_E1.Text, "string", false));
            ParameterList.Add(bco1.GetValueSetParameter(slp_STORE1.Text, "string", false));
            ParameterList.Add(bco1.GetValueSetParameter(txtCHAN_SOURCE_NO.Text, "string", false));
            ParameterList.Add(bco1.GetValueSetParameter(chkSTAKind.Items[0].Selected && chkSTAKind.Items[1].Selected ? "0" : (chkSTAKind.Items[0].Selected ? "1" : chkSTAKind.Items[1].Selected ? "2" : "3"), "string", false));
            ParameterList.Add(bco1.GetValueSetParameter(rdoRPT_DATA.SelectedValue, "string", false));

            DataTable dt = new DataTable();

            ReportChainAcctDiff bco = new ReportChainAcctDiff(ConntionDB);

            if (rdoRPT_TYPE1.SelectedIndex == 0)
            {
                dt = bco.GetCAM30R06Data(ParameterList);
            }
            else if (rdoRPT_TYPE1.SelectedIndex == 1)
            {
                dt = bco.GetCAM30R07Data(ParameterList);
            }
            else if (rdoRPT_TYPE1.SelectedIndex == 2)
            {
                dt = bco.GetCAM30R05Data(ParameterList);
            }
            else if (rdoRPT_TYPE1.SelectedIndex == 3)
            {
                dt = bco.GetCAM30R09Data(ParameterList);
            }
            else
            {
                this.ErrorMsgLabel.Text = "X";
                return;
            }

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