Exemplo n.º 1
0
    protected void btnUnSETTLE_Check_Click(object sender, EventArgs e)
    {
        try
        {
            string strCHECK = Check_PageCondition(false);
            if (strCHECK != "")
            {
                ErrorMsgLabel.Text = strCHECK;
                return;
            }
            else
            {
                #region 呼叫BCO

                CAMModel.ProcessStoresMonthCounting bco = new CAMModel.ProcessStoresMonthCounting(ConntionDB);

                ParameterList.Clear();
                ParameterList.Add(bco.GetValueSetParameter(SLP_SETTLE_YM.Text, "string", false));
                ParameterList.Add(bco.GetValueSetParameter(SLP_SETTLE_DATE.StartDate, "date", false));
                ParameterList.Add(bco.GetValueSetParameter(SLP_SETTLE_DATE.EndDate, "date", false));
                ParameterList.Add(bco.GetValueSetParameter(slp_GROUP_NO_S.Text, "string", false));
                ParameterList.Add(bco.GetValueSetParameter(slp_GROUP_NO_E.Text, "string", false));
                ParameterList.Add(bco.GetValueSetParameter(txtPAY_RFNO.Text, "string", false));
                ParameterList.Add(bco.GetValueSetParameter(txtRFNO.Text, "string", false));
                ParameterList.Add(bco.GetValueSetParameter(slp_STORE.Text, "string", false));
                ParameterList.Add(bco.GetValueSetParameter(SLP_RootNo.Text, "string", false));
                ParameterList.Add(bco.GetValueSetParameter(rdoPAY_TYPE1.Checked ? "1" : (rdoPAY_TYPE2.Checked ? "2" : "3"), "string", false));
                ParameterList.Add(bco.GetValueSetParameter(slpPROMOTE_ID_S.Text, "string", false));
                ParameterList.Add(bco.GetValueSetParameter(slpPROMOTE_ID_E.Text, "string", false));
                ParameterList.Add(bco.GetValueSetParameter(txtBUS_NO.Text, "string", false));

                DataTable dtResult = bco.GetUnSETTLE_Check(ParameterList);

                if (dtResult.Rows.Count == 0)
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel11, this.GetType(), "ClientScript", string.Format("alert('查無資料');"), true);
                }
                else
                {
                    Export_Excel(dtResult);
                }
                #endregion
            }

        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }