Example #1
0
    protected void btnSETTLE_CANCLE_Click(object sender, EventArgs e)
    {
        try
        {
            string[] bResult;
            string strCHECK = Check_PageCondition(true);
            if (strCHECK != "")
            {
                ErrorMsgLabel.Text = strCHECK;
                return;
            }
            else
            {
                #region 呼叫BCO

                CAMModel.CAMCommon bco1 = new CAMModel.CAMCommon();

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

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

                bResult = bco.CancelStoreCloseCounting(ParameterList);

                //20121121 曾怡婷確認取消帳差計算
                //ParameterList.Clear();
                //ParameterList.Add(bco1.GetValueSetParameter(SLP_SETTLE_YM.Text, "string", false));
                //ParameterList.Add(bco1.GetValueSetParameter(SLP_SETTLE_DATE.StartDate, "date", false));
                //ParameterList.Add(bco1.GetValueSetParameter(SLP_SETTLE_DATE.EndDate, "date", false));
                //ParameterList.Add(bco1.GetValueSetParameter(Session["UID"].ToString(), "string", false));

                //bco.ProcessAcctDiff(ParameterList);

                if (bResult[2] == "0")//成功
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel11, this.GetType(), "ClientScript", string.Format("alert('解除結算成功:成功復原筆數" + bResult[0] + "筆,無法復原筆數" + bResult[1] + "筆 [執行時間:" + System.DateTime.Now.ToString("yyyy/MM/dd hh:mm") + "]');"), true);
                }
                else//失敗
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel11, this.GetType(), "ClientScript", string.Format("alert('解除結算失敗:" + bResult[3] + " [執行時間:" + System.DateTime.Now.ToString("yyyy/MM/dd hh:mm") + "]');"), true);
                }
                #endregion
            }
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }