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(); }
    }
Example #2
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(); }
    }
Example #3
0
    protected void btnOVER_Click(object sender, EventArgs e)
    {
        try
        {
            string strCHECK = Check_PageCondition(false);
            if (strCHECK != "")
            {
                ErrorMsgLabel.Text = strCHECK;
                return;
            }
            else
            {
                #region 呼叫BCO

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

                ParameterList.Clear();
                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(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));

                DataTable dt = new DataTable();

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

                dt = bco.GetCAM14R01Data(ParameterList);

                if (dt.Rows.Count == 0)
                {
                    this.ErrorMsgLabel.Text = "查無資料";
                    return;
                }
                else
                {
                    ShowReport(dt, ((Button)sender).CommandName);
                }
                #endregion
            }

        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message.Split(Environment.NewLine.Replace(Environment.NewLine, "~").ToCharArray())[0];  //直接取第一個
        }
        finally { Finally_Function(); }
    }
Example #4
0
    protected void btnTRAN_CNT_Click(object sender, EventArgs e)
    {
        try
        {
            double dblSETTLED = 0;
            double dblUNSETTLE = 0;
            double dblTOTALSETTLE = 0;
            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(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));
                DataTable dt = new DataTable();

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

                dt = bco.CheckNotCountingTransactionQuality(ParameterList);

                for (int k = 0; k <= dt.Rows.Count - 1; k++)
                {
                    if (dt.Rows[k]["AC_STATUS"].ToString() == "1" || dt.Rows[k]["AC_STATUS"].ToString() == "2")//1.未彙總結算,2.進行彙總結算中
                    {
                        dblUNSETTLE += double.Parse(dt.Rows[k]["AC_STATUS_QTY"].ToString());
                    }
                    else if (
                        dt.Rows[k]["AC_STATUS"].ToString() == "4" ||
                        dt.Rows[k]["AC_STATUS"].ToString() == "5" ||
                        dt.Rows[k]["AC_STATUS"].ToString() == "6" ||
                        dt.Rows[k]["AC_STATUS"].ToString() == "7"
                        )//4.已彙總結算,5.人為註記已結算,6.已開立銷項發票,7.已開立銷項折讓
                    {
                        dblSETTLED += double.Parse(dt.Rows[k]["AC_STATUS_QTY"].ToString());
                    }
                    else
                    {
                        //其它非規範狀態都不計算
                        //CASE:進貨單未確定出入庫0
                    }
                    dblTOTALSETTLE += double.Parse(dt.Rows[k]["AC_STATUS_QTY"].ToString());
                }
                RightMsgLabel.Text = "總數" + dblTOTALSETTLE.ToString() + "筆,已結" + dblSETTLED.ToString() + "筆,未結" + dblUNSETTLE.ToString() + "筆    [執行時間:" + System.DateTime.Now.ToString("yyyy/MM/dd hh:mm") + "]";

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