Exemplo n.º 1
0
    /// <summary>
    /// 設定頁面載入時,各個模式的畫面預設值

    /// </summary>
    private void SetPageStartValue()
    {
        #region 新增狀態

        if (this.hid_PageStatus.Value == "INSERT")
        {
            #region Tab_Up
            #region 設定初始值
            if (this.slp_up_CHAN_NO.Text == string.Empty ||
                this.slp_up_STORE.Text == string.Empty ||
                this.slp_up_SALE_ID.Text == string.Empty ||
                this.slp_up_Z_O.Text == string.Empty)
            {
                this.slp_up_CHAN_NO.Text = string.Empty;//通路
                this.slp_up_STORE.Text = string.Empty;//門市
                this.slp_up_Z_O.Text = string.Empty;//營業所
                this.slp_up_SALE_ID.Text = string.Empty;//營業人員
            }

            #region 設定訂單來源

            DataTable dt_Return = new DataTable();
            ArrayList ParameterList = new ArrayList();//20091117

            ParameterList.Clear();
            ParameterList.Add(Session["UID"].ToString());//V_USERCODE
            ParameterList.Add(Session["UID"].ToString());//V_LOG_UPDATEUID

            BCO.MaintainCRMPublic bco = new BCO.MaintainCRMPublic(ConntionDB);
            dt_Return = bco.QUERY_LOGIN_CODEANDNAME(ParameterList);

            if (dt_Return.Rows.Count == 0 ||
                dt_Return.Rows[0]["NAME"].ToString() != "顧客服務Team")//訂單來源
            { ((DropDownList)((ASP.sys_slp_slp_enumbase_ascx)drop_up_ORDER_TYPE).FindControl("D1")).SelectedValue = "0"; }
            else
            { ((DropDownList)((ASP.sys_slp_slp_enumbase_ascx)drop_up_ORDER_TYPE).FindControl("D1")).SelectedValue = "1"; }

            #endregion

            this.slp_up_BUSUID.Text = Session["UID"].ToString();//訂單維護者
            this.slp_up_BUSDATE.Text = DateTime.Today.ToString("yyyy/MM/dd");//DateTime.Now.ToShortDateString();//訂單日期


            this.txt_up_PO_SOURCE_NO.Text = string.Empty;//PO單號預設
            this.txt_up_CODE.Text = "自動產生";//訂單編號
            this.txt_up_CRM_NO.Text = string.Empty;//流水編號
            slp_up_Z_O.ReadOnly = true;
            txt_up_CODE.Enabled = false;

            if (this.slp_up_CHAN_NO.Text != string.Empty && this.slp_up_STORE.Text != string.Empty)
            {
                #region 從資料庫查詢資料

                // ArrayList ParameterList = new ArrayList();//20091117

                ParameterList.Clear();
                ParameterList.Add(this.slp_up_STORE.Text);//門市
                ParameterList.Add(this.slp_up_CHAN_NO.Text);//通路
                ParameterList.Add(Session["UID"].ToString());
                //2009-06-01 cyhsu add 新增記錄 STORE and CHAN_NO
                s_CHAN_NO = this.slp_up_CHAN_NO.Text;
                s_STORE = this.slp_up_STORE.Text;

                //DataTable dt_Return = new DataTable();
                BCO.MaintainStore bco1 = new BCO.MaintainStore(ConntionDB);
                dt_Return = bco1.QUERY_STORE_BY_STOREANDCHAN(ParameterList);
                if (dt_Return.Rows.Count == 0)
                {
                    ScriptManager.RegisterStartupScript(Page, this.GetType(), "CRM041.aspx",
                        "alert('查無門市資料');document.getElementById('" +
                        this.slp_up_STORE.TextBox_Code.ClientID +
                        "').focus();document.getElementById('" +
                        this.slp_up_STORE.TextBox_Code.ClientID + "').select();", true);
                }
                else
                {
                    if (this.hid_PageStatus.Value == "INSERT")
                    {
                        if (dt_Return.Rows[0]["MDC_END_DATE"].ToString() != string.Empty &&
                            ((DateTime)dt_Return.Rows[0]["MDC_END_DATE"]) < DateTime.Today)
                        {
                            throw new Exception("非有效門市,不可新增");
                        }
                    }
                    slp_up_CHAN_NO.Text = dt_Return.Rows[0]["CHAN_NO"].ToString();
                    slp_up_Z_O.Text = dt_Return.Rows[0]["Z_O"].ToString();
                    slp_up_SALE_ID.Text = dt_Return.Rows[0]["SAL_ID"].ToString();

                    #region 取得通路PO控制設定

                    GetChainPOSetting(dt_Return.Rows[0]["CHAN_NO"].ToString(),
                                      dt_Return.Rows[0]["STORE"].ToString());

                    #endregion

                    dt_Return.Dispose();
                }
                #endregion
            }
            #endregion

            #endregion
        }

        #endregion

        #region 查詢狀態

        else if (this.hid_PageStatus.Value == "QUERY")
        {
            #region Tab_Up

            #region 設定初始值

            this.slp_up_CHAN_NO.Text = string.Empty;//通路
            this.slp_up_STORE.Text = string.Empty;//門市
            this.slp_up_Z_O.Text = string.Empty;//營業所
            this.slp_up_BUSDATE.Text = string.Empty;//訂單日期
            this.slp_up_SALE_ID.Text = string.Empty;//營業人員
            this.slp_up_BUSUID.Text = string.Empty;//訂單維護者
            ((DropDownList)((ASP.sys_slp_slp_enumbase_ascx)drop_up_ORDER_TYPE).FindControl("D1")).SelectedIndex = 0;//訂單來源
            this.txt_up_PO_SOURCE_NO.Text = string.Empty;//PO單號預設
            this.txt_up_CODE.Enabled = true;
            this.txt_up_CODE.Text = string.Empty;//訂單編號
            this.txt_up_CRM_NO.Text = string.Empty;//流水編號

            #endregion

            #endregion
        }

        #endregion

        #region 檢視狀態

        else if (this.hid_PageStatus.Value == "VIEW")
        { }

        #endregion

        #region 編輯狀態

        else if (this.hid_PageStatus.Value == "EDIT")
        {
            this.gv_Detail.DataSource = dt_Detail;
            this.gv_Detail.PageSize = 10;
            this.gv_Detail.PageIndex = 0;
            this.gv_Detail.DataBind();
            Panel1.Height = gv_Detail.Rows.Count * 45 + 60;
        }

        #endregion

        if (this.hid_PageStatus.Value == "INSERT")
        {
            DropDownList DL = ((DropDownList)((ASP.sys_slp_slp_enumbase_ascx)drop_up_ORDER_TYPE).FindControl("D1"));
            if (DL.SelectedValue == "全部")
            {
                DL.Items.Remove(DL.SelectedItem);
            }
            //((DropDownList)((ASP.sys_slp_slp_enumbase_ascx)drop_up_ORDER_TYPE).FindControl("D1")).Items.RemoveAt(0);
        }
        else if (this.hid_PageStatus.Value == "QUERY")
        {
            if (((DropDownList)((ASP.sys_slp_slp_enumbase_ascx)drop_up_ORDER_TYPE).FindControl("D1")).Items.Count != 0)
                if (((DropDownList)((ASP.sys_slp_slp_enumbase_ascx)drop_up_ORDER_TYPE).FindControl("D1")).Items[0].Value != "")
                    ((DropDownList)((ASP.sys_slp_slp_enumbase_ascx)drop_up_ORDER_TYPE).FindControl("D1")).Items.Insert(0, new ListItem("全部", ""));
            ((DropDownList)((ASP.sys_slp_slp_enumbase_ascx)drop_up_ORDER_TYPE).FindControl("D1")).SelectedIndex = 0;
        }
        try
        {
            AuthorityControls(this);
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
    }
Exemplo n.º 2
0
    protected void gv_Detail_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        #region 設定 GridView Button 的隱藏與顯示狀態


        if (e.Row.RowType != DataControlRowType.Pager)
        {
            if (this.hid_PageStatus.Value == "INSERT" ||
                this.hid_PageStatus.Value == "EDIT")
            {
                e.Row.Cells[14].Visible = false;//門市進貨單

                e.Row.Cells[15].Visible = false;//訂單履歷
                e.Row.Cells[16].Visible = true;//刪除
                e.Row.Cells[17].Visible = true;//編輯
            }
            else if (this.hid_PageStatus.Value == "VIEW")
            {
                e.Row.Cells[14].Visible = true;//門市進貨單

                e.Row.Cells[15].Visible = true;//訂單履歷
                e.Row.Cells[16].Visible = false;//刪除
                e.Row.Cells[17].Visible = false;//編輯
            }

            e.Row.Cells[18].Visible = false;//ID
            e.Row.Cells[19].Visible = false;//PID
            e.Row.Cells[20].Visible = false;//結案狀態
        }

        #endregion

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            #region [品名]設定

            if (e.Row.Cells[4].Text.Trim() == "No Data")
            { e.Row.Cells[4].Text = string.Empty; }

            #endregion

            #region [逾期客訂]設定

            if (e.Row.Cells[7].Text == "0")
            { e.Row.Cells[7].Text = "否"; }
            else if (e.Row.Cells[7].Text == "1")
            { e.Row.Cells[7].Text = "是"; }

            #endregion

            #region [訂單狀態]設定

            DataTable dt_Return = new DataTable();
            ArrayList ParameterList = new ArrayList();//20091117

            ParameterList.Clear();
            ParameterList.Add("CRMProcessDescription");//V_ENUM
            ParameterList.Add(e.Row.Cells[11].Text);//N_ENUMVALUE
            ParameterList.Add(Session["UID"].ToString());

            BCO.MaintainCRMPublic bco = new BCO.MaintainCRMPublic(ConntionDB);
            dt_Return = bco.QUERY_SYS_ENUMBASE(ParameterList);

            if (dt_Return.Rows.Count > 0)
            { e.Row.Cells[11].Text = dt_Return.Rows[0]["ENUMTYPENAME"].ToString(); }

            #endregion

            #region [門市進貨單]設定

            if (this.hid_PageStatus.Value == "VIEW")
            {
                Button but_gv_StoreGoods = (Button)e.Row.Cells[14].Controls[0];
                //if (e.Row.Cells[13].Text.ToString().Trim().Length > 0)
                //{
                try
                {
                    DateTime.Parse(e.Row.Cells[13].Text.Trim());
                    but_gv_StoreGoods.Visible = true;

                    but_gv_StoreGoods.Attributes["onclick"] += String.Format(@"AddIFrameTab('門市進退貨單查詢','{0}'); ",
                                                      Application["AppSite_RootDir"] + "CAM/CAM231.aspx?Code=CAM23&mode=QUERY&Store=" + this.slp_up_STORE.Text);


                }
                catch
                { but_gv_StoreGoods.Visible = false; }
                //}
            }

            #endregion

            #region [刪除]設定

            Button but_gv_Delete = (Button)e.Row.Cells[16].Controls[0];
            but_gv_Delete.Visible = true;
            if (e.Row.Cells[20].Text.ToString() == "25") //未結案
            {
                but_gv_Delete.Attributes.Add("onclick", @"if(window.confirm('確認要刪除?') == false){return;}");
            }
            else
            {
                but_gv_Delete.Visible = false;
            }

            #endregion

            #region [編輯]設定

            Button but_gv_Edit = (Button)e.Row.Cells[17].Controls[0];
            but_gv_Edit.Visible = true;
            if (e.Row.Cells[20].Text.ToString() == "25") //未結案
            {
                but_gv_Edit.Attributes.Add("onclick", "CallServer_gv_Edit('新增或編輯模式按下GridView[編輯]鈕<partition>" + e.Row.Cells[18].Text + "');");
            }
            else
            {
                but_gv_Edit.Visible = false;
            }

            #endregion
        }
    }
Exemplo n.º 3
0
    private void txt_STORE_Onblur()
    {
        if (slp_STORE.Text.Trim().Length == 0) return;

        TextBox txt_Up_CHAN_NO = (TextBox)this.slp_Up_CHAN_NO.FindControl("TextBoxCode");//上方通路
        TextBox txt_STORE = (TextBox)this.slp_STORE.FindControl("TextBoxCode");//上方門市

        try
        {
            ArrayList ParameterList = new ArrayList();//20091117

            ParameterList.Clear();
            ParameterList.Add(slp_STORE.Text);
            ParameterList.Add(slp_Up_CHAN_NO.Text);
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add(DateTime.Now);

            BCO.MaintainCRMPublic bco = new BCO.MaintainCRMPublic(ConntionDB);
            DataTable dt_Return = bco.QuerySwitch(BCO.MaintainCRMPublic.QueryType.QueryStore, ParameterList);

            if (dt_Return.Rows.Count == 0)
            {
                if (this.hid_Page_Status.Value == "INSERT")
                {
                    slp_Z_O.Text = "";
                    slp_SAL_ID.Text = "";
                    txt_ROUTD_ID.Text = "";
                    txt_ROUTD_STEP.Text = "";
                    txt_STORE_TEL_AREA.Text = "";
                    txt_STORE_TEL_NO.Text = "";
                    txt_STORE_FAX_AREA.Text = "";
                    txt_STORE_FAX_NO.Text = "";
                    txt_STORE_ADDRESS.Text = "";
                }
                ScriptManager.RegisterStartupScript(Page, this.GetType(), "CRM011.aspx", "alert('查無資料');document.getElementById('" + txt_STORE.ClientID + "').focus();document.getElementById('" + txt_STORE.ClientID + "').select();", true);
            }
            else if (this.hid_Page_Status.Value == "INSERT")
            {
                slp_Up_CHAN_NO.Text = dt_Return.Rows[0]["CHAN_NO"].ToString();
                slp_Z_O.Text = dt_Return.Rows[0]["Z_O"].ToString();
                slp_SAL_ID.Text = dt_Return.Rows[0]["SAL_ID"].ToString();
                txt_ROUTD_ID.Text = dt_Return.Rows[0]["ROUTE_ID"].ToString();
                txt_ROUTD_STEP.Text = dt_Return.Rows[0]["ROUTE_STEP"].ToString();
                txt_STORE_TEL_AREA.Text = dt_Return.Rows[0]["STORE_TEL_AREA"].ToString();
                txt_STORE_TEL_NO.Text = dt_Return.Rows[0]["STORE_TEL_NO"].ToString();
                txt_STORE_FAX_AREA.Text = dt_Return.Rows[0]["STORE_FAX_AREA"].ToString();
                txt_STORE_FAX_NO.Text = dt_Return.Rows[0]["STORE_FAX_NO"].ToString();
                txt_STORE_ADDRESS.Text = dt_Return.Rows[0]["STORE_ADDRESS"].ToString();
            }
            else if (this.hid_Page_Status.Value == "QUERY")
            {
                slp_Up_CHAN_NO.Text = dt_Return.Rows[0]["CHAN_NO"].ToString();
            }

        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "CRM011.aspx", "alert('" + ex.Message + "');document.getElementById('" + txt_STORE.ClientID + "').focus();document.getElementById('" + txt_STORE.ClientID + "').select();", true);
        }
    }
Exemplo n.º 4
0
    /// <summary>
    /// 通路資料讀取
    /// </summary>
    private void CheckStoreInformation()
    {
        string s_GridViewName = string.Empty;
        string s_GridView_CheckBoxName = string.Empty;

        #region 從資料庫讀取通路資料,並將資料放入XML
        ArrayList ParameterList = new ArrayList();//20091117

        ParameterList.Clear();//先清空傳放參數的ArrayList
        CRMModel.MaintainCRMPublic BCO = new CRMModel.MaintainCRMPublic(ConnectionDB);
        BCO.QuerySwitch(PIC.VDS2G.BSM.CRM.CRMCommon.QueryType.CRM122_Store_Chain_All, ParameterList);
        DataTable dt_Store_Chain = BCO.QuerySwitch(CRMModel.MaintainChainMessage.QueryType.CRM122_Store_Chain_All, ParameterList);
        dt_Store_Chain.TableName = "Store_Chain";
        xml_Store_Chain.InnerHtml = dt_Store_Chain.DataSet.GetXml();

        #endregion

        int i_Edit_txt_Chk_GridView_Count = 0;//計算GrideView 中有被 Checked 的筆數

        if (FormView1.CurrentMode == FormViewMode.ReadOnly)
        {
            s_GridViewName = "Item_GridView";
            s_GridView_CheckBoxName = "Item_chb_Code";
        }
        else if (FormView1.CurrentMode == FormViewMode.Insert)
        {
            s_GridViewName = "Insert_GridView";
        }
        else if (FormView1.CurrentMode == FormViewMode.Edit)
        {
            s_GridViewName = "Edit_GridView";
            s_GridView_CheckBoxName = "Edit_chb_Code";
        }

        ((GridView)FormView1.FindControl(s_GridViewName)).DataSource = dt_Store_Chain.DefaultView;
        ((GridView)FormView1.FindControl(s_GridViewName)).DataBind();

        //如果不是新增狀態,才必須做以下動作
        if (FormView1.CurrentMode == FormViewMode.ReadOnly || FormView1.CurrentMode == FormViewMode.Edit)
        {
            #region 使用XML轉回DataSet

            DataSet ds_Detail = new DataSet();
            System.IO.StringReader sr = new System.IO.StringReader(xml_DetailOLDData.InnerHtml);
            ds_Detail.ReadXml(sr);

            #endregion
            
            if (ds_Detail.Tables.Count != 0)
            {
                for (int i = 0; i < ds_Detail.Tables[0].Rows.Count; i++)
                {
                    for (int s = 0; s < ((GridView)FormView1.FindControl(s_GridViewName)).Rows.Count; s++)
                    {
                        if (ds_Detail.Tables[0].Rows[i]["CHAN_NO"].ToString() == ((CheckBox)((GridView)FormView1.FindControl(s_GridViewName)).Rows[s].FindControl(s_GridView_CheckBoxName)).Text)
                        {
                            ((CheckBox)((GridView)FormView1.FindControl(s_GridViewName)).Rows[s].FindControl(s_GridView_CheckBoxName)).Checked = true;

                            if (FormView1.CurrentMode == FormViewMode.Edit)
                            {
                                i_Edit_txt_Chk_GridView_Count += 1;
                            }
                        }//if
                    }//for
                }//for
            }
        }
    }
Exemplo n.º 5
0
    private void txt_Up_CHAN_NO_Onblur()
    {
        if ((slp_Up_CHAN_NO.Text.Trim().Length == 0) || (slp_Up_CHAN_NO.Text.Trim().Length == 2))
        { return; }

        TextBox txt_Up_CHAN_NO = (TextBox)this.slp_Up_CHAN_NO.FindControl("TextBoxCode");//上方通路
        TextBox txt_STORE = (TextBox)this.slp_STORE.FindControl("TextBoxCode");//上方門市
        if (slp_STORE.Text.Trim() == string.Empty)
        {
            return;
        }
        try
        {
            ArrayList ParameterList = new ArrayList();//20091117

            ParameterList.Clear();
            ParameterList.Add(slp_STORE.Text);
            ParameterList.Add(slp_Up_CHAN_NO.Text);
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add(DateTime.Now);

            BCO.MaintainCRMPublic bco = new BCO.MaintainCRMPublic(ConntionDB);
            DataTable dt_Return = bco.QuerySwitch(BCO.MaintainCRMPublic.QueryType.QueryStore, ParameterList);

            if (dt_Return.Rows.Count == 0)
            { slp_STORE.Text = ""; }

        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(Page, this.GetType(), "CRM011.aspx", "alert('" + ex.Message + "');document.getElementById('" + txt_Up_CHAN_NO.ClientID + "').focus();document.getElementById('" + txt_Up_CHAN_NO.ClientID + "').select();", true);
        }
    }
Exemplo n.º 6
0
    /// <summary>
    /// 將變更後的內部變量this.CallBackValue返回給前台JavaScript方法ReceiveServerData(string Value)。

    /// </summary>
    /// <returns></returns>
    string ICallbackEventHandler.GetCallbackResult()
    {
        if ((this.hid_Page_Status.Value == "INSERT" || this.hid_Page_Status.Value == "QUERY") &&
            CallBackValue != string.Empty)
        {
            string s_CHAN_NO = string.Empty;
            string s_STORE = string.Empty;
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            CallBackValue = CallBackValue.Trim();
            string[] s_Client_String = System.Text.RegularExpressions.Regex.Split(CallBackValue, "<partition>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);

            ArrayList ParameterList = new ArrayList();//20091117

            if (s_Client_String[0] == "門市")
            {
                #region 離開欄位[@門市]時

                s_STORE = s_Client_String[1];//門市
                s_CHAN_NO = s_Client_String[2];//通路

                try
                {

                    ParameterList.Clear();
                    ParameterList.Add(s_STORE);
                    ParameterList.Add(s_CHAN_NO);
                    ParameterList.Add(Session["UID"].ToString());
                    ParameterList.Add(DateTime.Now);

                    BCO.MaintainCRMPublic bco = new BCO.MaintainCRMPublic(ConntionDB);
                    DataTable dt_Return = bco.QuerySwitch(BCO.MaintainCRMPublic.QueryType.QueryStore, ParameterList);

                    if (dt_Return.Rows.Count == 0)
                    { CallBackValue = "STORE<partition>FALSE<partition>" + this.hid_Page_Status.Value + "<partition>查無資料"; }
                    else if (this.hid_Page_Status.Value == "INSERT")
                    {
                        sb.Append("STORE<partition>");
                        sb.Append("TRUE<partition>");
                        sb.Append("INSERT<partition>");
                        sb.Append(dt_Return.Rows[0]["CHAN_NO"].ToString() + "<partition>");
                        sb.Append(dt_Return.Rows[0]["Z_O"].ToString() + "<partition>");
                        sb.Append(dt_Return.Rows[0]["SAL_ID"].ToString() + "<partition>");
                        sb.Append(dt_Return.Rows[0]["ROUTE_ID"].ToString() + "<partition>");
                        sb.Append(dt_Return.Rows[0]["ROUTE_STEP"].ToString() + "<partition>");
                        sb.Append(dt_Return.Rows[0]["STORE_TEL_AREA"].ToString() + "<partition>");
                        sb.Append(dt_Return.Rows[0]["STORE_TEL_NO"].ToString() + "<partition>");
                        sb.Append(dt_Return.Rows[0]["STORE_FAX_AREA"].ToString() + "<partition>");
                        sb.Append(dt_Return.Rows[0]["STORE_FAX_NO"].ToString() + "<partition>");
                        sb.Append(dt_Return.Rows[0]["STORE_ADDRESS"].ToString());

                        CallBackValue = sb.ToString();
                    }
                    else if (this.hid_Page_Status.Value == "QUERY")
                    {
                        sb.Append("STORE<partition>");
                        sb.Append("TRUE<partition>");
                        sb.Append("QUERY<partition>");
                        sb.Append(dt_Return.Rows[0]["CHAN_NO"].ToString());

                        CallBackValue = sb.ToString();
                    }

                }
                catch (Exception ex)
                {
                    CallBackValue = "STORE<partition>FALSE<partition>" + this.hid_Page_Status.Value + "<partition>" + ex.ToString();
                }

                #endregion
            }
            else if (s_Client_String[0] == "通路")
            {
                #region 離開欄位[@通路]時

                s_STORE = s_Client_String[2];//門市
                s_CHAN_NO = s_Client_String[1];//通路

                try
                {
                    ParameterList.Clear();
                    ParameterList.Add(s_STORE);
                    ParameterList.Add(s_CHAN_NO);
                    ParameterList.Add(Session["UID"].ToString());
                    ParameterList.Add(DateTime.Now);

                    BCO.MaintainCRMPublic bco = new BCO.MaintainCRMPublic(ConntionDB);
                    DataTable dt_Return = bco.QuerySwitch(BCO.MaintainCRMPublic.QueryType.QueryStore, ParameterList);

                    if (dt_Return.Rows.Count == 0)
                    { CallBackValue = "CHAN_NO<partition>NOHAVE"; }
                    else
                    { CallBackValue = "CHAN_NO<partition>HAVE"; }
                }
                catch (Exception ex)
                {
                    CallBackValue = "CHAN_NO<partition>FALSE<partition>" + ex.ToString();
                }

                #endregion
            }
        }
        else
        { CallBackValue = string.Empty; }

        return CallBackValue;
    }
Exemplo n.º 7
0
    /// <summary>
    /// BUTTON 上面的新增鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_Up_Insert_Click(object sender, EventArgs e)
    {
        //System.Threading.Thread.Sleep(2000);
        try
        {
            if (this.hid_Page_Status.Value == "QUERY" ||
                this.hid_Page_Status.Value == "INSERT" ||
                this.hid_Page_Status.Value == "VIEW")
            {
                #region 設定各個欄位的預設值

                string s_BUSDATE = string.Empty;

                BCO.MaintainCRMPublic bco = new BCO.MaintainCRMPublic(ConntionDB);
                ArrayList ParameterList = new ArrayList();//20091117

                ParameterList.Clear();
                ParameterList.Add(Session["UID"].ToString());
                ParameterList.Add(DateTime.Now);
                // 2009-05-13 cyhsu changed
                //s_BUSDATE = DateTime.Parse(bco.QuerySwitch(BCO.MaintainCRMPublic.QueryType.QueryAPLDATE, ParameterList).Rows[0]["APL_DATE"].ToString()).ToString("yyyy/MM/dd");
                s_BUSDATE = System.DateTime.Now.ToString("yyyy/MM/dd");

                //Master
                this.slp_Up_CHAN_NO.Text = String.Empty;//通路
                this.slp_Z_O.Text = String.Empty;//營業所
                this.txt_CODE.Text = "自動產生";//流水編號
                this.slp_STORE.Text = String.Empty;//門市
                this.slp_Up_BUSDATE.Text = s_BUSDATE;//處理日期
                this.txt_ANSWER_TIME.Text = DateTime.Now.ToString("HH:mm");//接聽時間 yyyy/MM/dd HH:mm:ss
                this.slp_SAL_ID.Text = String.Empty;//營業人員
                this.slp_BUSUID.Text = Session["UID"].ToString();//處理人員
                this.txt_ROUTD_ID.Text = String.Empty;//路線
                this.txt_ROUTD_STEP.Text = String.Empty;//路順
                this.txt_STORE_TEL_AREA.Text = String.Empty;//電話-區域號碼
                this.txt_STORE_TEL_NO.Text = String.Empty;//電話號碼
                this.txt_STORE_FAX_AREA.Text = String.Empty;//傳真-區域號碼
                this.txt_STORE_FAX_NO.Text = String.Empty;//傳真號碼
                this.txt_STORE_ADDRESS.Text = String.Empty;//地址
                this.txt_DEAL_CONTENT.Text = String.Empty;//處理內容

                //Detail
                this.chkbl_Detail.Enabled = true;
                foreach (ListItem li in this.chkbl_Detail.Items)
                { li.Selected = false; }

                #endregion

                #region 設定頁面模式

                this.hid_Page_Status.Value = "INSERT";
                this.txt_Page_Status.Text = "INSERT";

                #endregion
            }
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
        finally { GetPageDefault(); }
    }
Exemplo n.º 8
0
    //protected void chb_down_CRM_CONFIRM_DATE_CheckedChanged(object sender, EventArgs e)
    //{
    //    if (chb_down_CRM_CONFIRM_DATE.Checked || chb_down_UNIT_CONFIRM_DATE.Checked) slp_down_PROC_FLAG.ReadOnly = true;
    //    else slp_down_PROC_FLAG.ReadOnly = false;

    //    if (chb_down_CRM_CONFIRM_DATE.Checked)
    //        slp_down_CRM_CONFIRM_DATE.Text = DateTime.Today.ToShortDateString();
    //    else
    //    {
    //        if (ViewState["UNIT_CONFIRM"] != null)
    //        {
    //            if (ViewState["UNIT_CONFIRM"].ToString() != "")
    //                ScriptManager.RegisterStartupScript(Page, this.GetType(), "CRM032", "if(confirm('客服單位已簽核,確定要取消簽核?')__doPostBack(document.all['" + UpdatePanel7.ClientID + "'].id,'clearChargeDate');", true);
    //        }
    //        else if (ViewState["CRM_CONFIRM"] != null)
    //        {
    //            if (ViewState["CRM_CONFIRM"].ToString() != "")
    //                ScriptManager.RegisterStartupScript(Page, this.GetType(), "CRM032", "if(confirm('確定要取消簽核?')__doPostBack(document.all['" + UpdatePanel7.ClientID + "'].id,'clearChargeDate');", true);
    //        }
    //        slp_down_CRM_CONFIRM_DATE.Text = "";
    //    }
    //}
    //protected void chb_down_UNIT_CONFIRM_DATE_CheckedChanged(object sender, EventArgs e)
    //{
    //    if (chb_down_CRM_CONFIRM_DATE.Checked || chb_down_UNIT_CONFIRM_DATE.Checked) slp_down_PROC_FLAG.ReadOnly = true;
    //    else slp_down_PROC_FLAG.ReadOnly = false;

    //    if (chb_down_UNIT_CONFIRM_DATE.Checked)
    //        slp_down_UNIT_CONFIRM_DATE.Text = DateTime.Today.ToShortDateString();
    //    else
    //    {
    //        if (ViewState["CRM_CONFIRM"] != null)
    //        {
    //            if (ViewState["CRM_CONFIRM"].ToString() != "")
    //                ScriptManager.RegisterStartupScript(Page, this.GetType(), "CRM032", "if(confirm('負責單位主管已簽核,確定要取消簽核?')__doPostBack(document.all['" + UpdatePanel8.ClientID + "'].id,'clearUnitDate');", true);
    //        }
    //        else if (ViewState["UNIT_CONFIRM"] != null)
    //        {
    //            if (ViewState["UNIT_CONFIRM"].ToString() != "")
    //                ScriptManager.RegisterStartupScript(Page, this.GetType(), "CRM032", "if(confirm('確定要取消簽核?')__doPostBack(document.all['" + UpdatePanel8.ClientID + "'].id,'clearUnitDate');", true);
    //        }
    //        slp_down_UNIT_CONFIRM_DATE.Text = "";
    //    }
    //}

    private void RetrievePROC_MAN(string PROC_UNIT, string PROC_MAN, string proc_man)
    {
        BCO.MaintainCRMPublic bco = new BCO.MaintainCRMPublic(ConntionDB);

        ParameterList.Clear();
        ParameterList.Add(PROC_UNIT);                   //V_ROLECODE
        ParameterList.Add(PROC_MAN);                    // V_USERCODE
        ParameterList.Add(9999);                        //N_ENUMVALUE
        ParameterList.Add(Session["UID"].ToString());   //V_LOG_UPDATEUID
        DataTable dt = bco.QueryUserByRole(ParameterList);
        if (dt.Rows.Count > 0)
        {
            if (PROC_MAN == "")
            {
                slp_down_PROC_MAN.Items.Clear();
                foreach (DataRow dr in dt.Rows)
                    slp_down_PROC_MAN.Items.Add(new ListItem(dr["USERCODE"].ToString() + " " + dr["USERNAME"].ToString(), dr["USERCODE"].ToString()));

                if (proc_man != "")
                    foreach (ListItem li in slp_down_PROC_MAN.Items)
                    {
                        li.Selected = (li.Value == proc_man ? true : false);
                        if (li.Selected) break;
                    }
            }
            else if (PROC_UNIT == "")
            {
                slp_down_PROC_UNIT.Text = dt.Rows[0]["Rolecode"].ToString();
                RetrievePROC_MAN(slp_down_PROC_UNIT.Text, "", proc_man);
            }
        }
        else slp_down_PROC_MAN.Items.Clear();
    }
Exemplo n.º 9
0
    /// <summary>
    /// 將變更後的內部變量this.CallBackValue返回給前台JavaScript方法ReceiveServerData(string Value)。

    /// </summary>
    /// <returns></returns>
    string ICallbackEventHandler.GetCallbackResult()
    {
        if (CallBackValue != string.Empty)
        {
            string s_CHAN_NO = string.Empty;
            string s_STORE = string.Empty;
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            CallBackValue = CallBackValue.Trim();

            #region 離開欄位[@門市]時


            s_STORE = CallBackValue;//門市

            s_CHAN_NO = string.Empty;//通路

            try
            {
                ArrayList ParameterList = new ArrayList();

                ParameterList.Clear();
                ParameterList.Add(s_STORE);
                ParameterList.Add(s_CHAN_NO);
                ParameterList.Add(Session["UID"].ToString());
                ParameterList.Add(DateTime.Now);

                BCO.MaintainCRMPublic bco = new BCO.MaintainCRMPublic(ConntionDB);
                DataTable dt_Return = bco.QuerySwitch(BCO.MaintainCRMPublic.QueryType.QueryStore, ParameterList);

                if (dt_Return.Rows.Count == 0)
                { CallBackValue = "STORE<partition>FALSE<partition>查無資料"; }
                else
                {
                    sb.Append("STORE<partition>");
                    sb.Append("TRUE<partition>");
                    sb.Append(dt_Return.Rows[0]["CHAN_NO"].ToString());

                    CallBackValue = sb.ToString();
                }
            }
            catch (Exception ex)
            { CallBackValue = "STORE<partition>FALSE<partition>" + ex.ToString(); }

            #endregion
        }

        return CallBackValue;
    }