Exemple #1
0
    private void QueryData()
    {
        #region

        #region 傳入參數

        ArrayList ParameterList = new ArrayList();

        ParameterList.Clear();
        ParameterList.Add(GetValueSetParameter(this.slp_TRANS_DATE.Text, "date", false));
        ParameterList.Add(GetValueSetParameter(this.slp_ST_ACCEPT_DATE.Text, "date", false));
        ParameterList.Add(Session["UID"].ToString());
        ParameterList.Add(string.Format("{0}_{1}", PageTimeStamp.Value, Session["UID"].ToString()));

        #endregion

        #region 取得資料

        ArrayList arl_Return = new ArrayList();

        BCO.ProcessCRMOverDu bco = new BCO.ProcessCRMOverDu(ConntionDB);
        //2010/06/25 modified for new spec
        //arl_Return = bco.QueryForOverDu(ParameterList);
        arl_Return = bco.QueryForOverDu2(ParameterList);

        #endregion

        #region 資料與GridView繫結

        DataTable dt_Return = new DataTable();

        if (arl_Return[0].ToString() == string.Empty)
        { dt_Return = (DataTable)arl_Return[1]; }

        //抓取本頁初次登記的時間
        string SessionIDName = string.Format("{0}_{1}", PAGE_DT_01, PageTimeStamp.Value);
        Session["SessionID"] = SessionIDName;

        Session[SessionIDName] = dt_Return;
        this.gv_OverDu.DataSource = dt_Return;
        this.gv_OverDu.PageSize = (TextBoxPagesize_Query.Text == "") ? 20 : (int.Parse(TextBoxPagesize_Query.Text) <= 0) ? 20 : int.Parse(TextBoxPagesize_Query.Text);
        this.gv_OverDu.DataBind();

        if (dt_Return == null || (dt_Return != null && dt_Return.Rows.Count <= 0))
        {
            if (btn_Export.Visible == true)
            {
                btn_Export.Enabled = false;
            }
        }
        else
        {
            if (btn_Export.Visible == true)
            {
                btn_Export.Enabled = true;
            }
        }


        #endregion

        #region 檢查回傳資料

        string s_Err_Msg = string.Empty;
        s_Err_Msg = arl_Return[0].ToString();

        if (s_Err_Msg == string.Empty)
        {
            if (dt_Return.Rows.Count == 0)
            {
                this.hid_FmOp_Step.Value = "查無資料";
                this.ErrorMsgLabel.Text = "查無資料";
            }
            else
            {
                this.hid_FmOp_Step.Value = "0";
                this.RightMsgLabel.Text = "查詢成功";
            }
        }
        else
        {
            this.hid_FmOp_Step.Value = "查詢資料發生錯誤";
            this.ErrorMsgLabel.Text = s_Err_Msg;
        }

        #endregion

        hiddenProcessingID.Value = "";
        hiddenProcessingIDCounts.Value = "";
        #endregion
    }
Exemple #2
0
    /// <summary>
    /// BUTTON [訂單庫存檢查]鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_Check_Stock_Click(object sender, EventArgs e)
    {
        #region
        string s_ERR_STOCK_CNT = string.Empty; //記錄異常筆數

        try
        {
            #region 設定頁面狀態

            int i_FmOp_Step = -1;

            try
            { i_FmOp_Step = int.Parse(this.hid_FmOp_Step.Value); }
            catch
            {
                this.ErrorMsgLabel.Text = "頁面狀態錯誤";
                return;
            }

            if (i_FmOp_Step < 2)
            {
                this.ErrorMsgLabel.Text = "請先執行[店主檔檢查]鈕";
                return;
            }

            this.hid_FmOp_Step.Value = "BUTTON [訂單庫存檢查]鈕開始";

            #endregion

            #region 傳入參數
            ArrayList ParameterList = new ArrayList();

            ParameterList.Clear();
            ParameterList.Add(GetValueSetParameter(this.slp_TRANS_DATE.Text, "string", false));
            ParameterList.Add(GetValueSetParameter(this.slp_ST_ACCEPT_DATE.Text, "string", false));
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add(string.Format("{0}_{1}", PageTimeStamp.Value, Session["UID"].ToString()));
            ParameterList.Add(hiddenProcessingID.Value);

            #endregion

            #region 訂單庫存檢查

            ArrayList arl_Return_CheckStock = new ArrayList();

            BCO.ProcessCRMOverDu bco = new BCO.ProcessCRMOverDu(ConntionDB);
            //2010/06/25 modified for new spec
            //arl_Return_CheckStock = bco.CheckStock(ParameterList, null);
            arl_Return_CheckStock = bco.CheckStock2(ParameterList, null);

            #endregion

            #region 檢查訂單庫存檢查的回傳資料

            string s_Err_Msg_CheckStock = string.Empty;
            s_Err_Msg_CheckStock = arl_Return_CheckStock[0].ToString();
            s_ERR_STOCK_CNT = arl_Return_CheckStock[1].ToString();

            if (s_Err_Msg_CheckStock != string.Empty)
            {
                this.hid_FmOp_Step.Value = "BUTTON [訂單庫存檢查]鈕發生錯誤";
                this.ErrorMsgLabel.Text = s_Err_Msg_CheckStock;
                return;
            }

            #endregion

            #region 重新查詢資料

            ParameterList.Clear();
            ParameterList.Add(GetValueSetParameter(this.slp_TRANS_DATE.Text, "date", false));
            ParameterList.Add(GetValueSetParameter(this.slp_ST_ACCEPT_DATE.Text, "date", false));
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add(string.Format("{0}_{1}", PageTimeStamp.Value, Session["UID"].ToString()));

            DataTable dt_Return = new DataTable();
            //2010/06/25 modified for new spec
            //dt_Return = bco.QueryForOverDuForCheck(ParameterList);
            dt_Return = bco.QueryForOverDuForCheck2(ParameterList);



            #region 資料與GridView繫結
            //抓取本頁初次登記的時間
            string SessionIDName = string.Format("{0}_{1}", PAGE_DT_01, PageTimeStamp.Value);
            Session["SessionID"] = SessionIDName;

            Session[SessionIDName] = dt_Return;
            this.gv_OverDu.DataSource = dt_Return;
            this.gv_OverDu.DataBind();

            #endregion

            #endregion

            #region 檢查回傳資料

            if (dt_Return == null || dt_Return.Rows.Count < 1)
            {
                this.hid_FmOp_Step.Value = "查無資料";
                this.ErrorMsgLabel.Text = "查無資料";
            }
            else
            {
                this.hid_FmOp_Step.Value = "4";
                if (s_ERR_STOCK_CNT != "" && s_ERR_STOCK_CNT != "0")
                {
                    this.ErrorMsgLabel.Text = "訂單庫存檢查完成,但有庫存異常!";
                }
                else
                {
                    this.RightMsgLabel.Text = "訂單庫存檢查成功";
                }
            }

            #endregion
        }
        catch (Exception ex)
        {
            this.hid_FmOp_Step.Value = "BUTTON [訂單庫存檢查]鈕發生錯誤";
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {
            Set_but_Check_Stock_Click_PageStatus(s_ERR_STOCK_CNT);
        }
        #endregion
    }
Exemple #3
0
    /// <summary>
    /// BUTTON [轉手開配本]鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_CreateDisRecord_Click(object sender, EventArgs e)
    {
        #region
        string s_HANDLE_COUNT = string.Empty;
        string s_SUCCESS_COUNT = string.Empty;
        BCO.CRMCommon CRMComm = new BCO.CRMCommon();

        try
        {
            #region 設定頁面狀態

            int i_FmOp_Step = -1;

            try
            { i_FmOp_Step = int.Parse(this.hid_FmOp_Step.Value); }
            catch
            {
                this.ErrorMsgLabel.Text = "頁面狀態錯誤";
                return;
            }

            if (i_FmOp_Step < 4)
            {
                this.ErrorMsgLabel.Text = "請先執行[訂單庫存檢查]鈕";
                return;
            }

            this.hid_FmOp_Step.Value = "BUTTON [轉手開配本]鈕開始";

            #endregion

            #region 傳入參數
            ArrayList ParameterList = new ArrayList();

            ParameterList.Clear();
            ParameterList.Add(GetValueSetParameter(this.slp_TRANS_DATE.Text, "string", false));
            ParameterList.Add(GetValueSetParameter(this.slp_ST_ACCEPT_DATE.Text, "string", false));
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add(string.Format("{0}_{1}", PageTimeStamp.Value, Session["UID"].ToString()));
            ParameterList.Add(hiddenProcessingID.Value);

            #endregion

            #region 轉手開配本

            ArrayList arl_Return = new ArrayList();

            BCO.ProcessCRMOverDu bco = new BCO.ProcessCRMOverDu(ConntionDB);
            //2010/06/25 modified for new spec
            //arl_Return = bco.ProcessCreateDisRecord(ParameterList, null);
            arl_Return = bco.ProcessCreateDisRecord2(ParameterList, null);


            #endregion

            #region 檢查轉手開配本的回傳資料

            string s_Err_Msg = string.Empty;
            s_Err_Msg = arl_Return[0].ToString();

            if (s_Err_Msg != string.Empty)
            {
                this.hid_FmOp_Step.Value = "BUTTON [轉手開配本]鈕發生錯誤";
                this.ErrorMsgLabel.Text = s_Err_Msg;
            }
            else
            {
                s_HANDLE_COUNT = arl_Return[1].ToString();
                s_SUCCESS_COUNT = arl_Return[2].ToString();
                this.hid_FmOp_Step.Value = "6";
                this.RightMsgLabel.Text = "轉手開配本成功";

                #region 預設POP查詢使用參數
                string SessionIdName = "POP_QueryDisNo_" + PageTimeStamp.Value;
                Session[SessionIdName] = null;
                ParameterList.Clear();
                ParameterList.Add(CRMComm.GetValueSetParameter("1", "string", false));
                ParameterList.Add(CRMComm.GetValueSetParameter(this.slp_TRANS_DATE.Text, "string", false));
                ParameterList.Add(CRMComm.GetValueSetParameter(this.slp_ST_ACCEPT_DATE.Text, "string", false));
                ParameterList.Add(CRMComm.GetValueSetParameter("", "string", false)); //0代表未逾期客訂,1代表是逾期客訂
                ParameterList.Add(CRMComm.GetValueSetParameter("", "string", false));//擷轉序號起
                ParameterList.Add(CRMComm.GetValueSetParameter("", "string", false));//擷轉序號迄
                ParameterList.Add(Session["UID"].ToString());
                Session[SessionIdName] = ParameterList;
                #endregion

                //顯示配本序號
                string s_ScriptManager_Script = string.Empty;
                s_ScriptManager_Script += "alert('逾期客訂轉手開單產生成功');";
                s_ScriptManager_Script += string.Format(@"POP_QueryDisNo('{0}','{1}','{2}','{3}','{4}','{5}');",
                                                        "1", //逾期客訂固定為雜誌
                                                        this.slp_TRANS_DATE.Text,
                                                        this.slp_ST_ACCEPT_DATE.Text,
                                                        "1", //逾期客訂
                                                        "",  //擷轉序號起迄為空值
                                                        "");
                ScriptManager.RegisterStartupScript(this.up_Msg, typeof(UpdatePanel), "CRM101", s_ScriptManager_Script, true);
            }

            #endregion
        }
        catch (Exception ex)
        {
            this.hid_FmOp_Step.Value = "BUTTON [轉手開配本]鈕發生錯誤";
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {
            CRMComm = null;
            Set_but_CreateDisRecord_Click_PageStatus(s_HANDLE_COUNT, s_SUCCESS_COUNT);
        }
        #endregion
    }