Exemplo n.º 1
0
    /// <summary>
    /// 將變更後的內部變量this.CallBackValue返回給前台JavaScript方法ReceiveServerData(string Value)。

    /// </summary>
    /// <returns></returns>
    string ICallbackEventHandler.GetCallbackResult()
    {
        if (CallBackValue != string.Empty)
        {
            try
            {
                #region 取得頁面元件
                TextBox txt_up_CHAN_NO = (TextBox)((ASP.stm_slp_slp_storechain_ascx)slp_up_CHAN_NO).FindControl("TextBoxCode");//通路
                TextBox txt_up_CHAN_NAME = (TextBox)((ASP.stm_slp_slp_storechain_ascx)slp_up_CHAN_NO).FindControl("TextBoxName");//通路名稱

                TextBox txt_up_STORE = (TextBox)((ASP.stm_slp_slp_store_ascx)slp_up_STORE).FindControl("TextBoxCode");//門市

                TextBox txt_up_Z_O = (TextBox)((ASP.sys_slp_slp_codefile_ascx)slp_up_Z_O).FindControl("TextBoxCode");//營業所
                TextBox txt_up_Z_O_NAME = (TextBox)((ASP.sys_slp_slp_codefile_ascx)slp_up_Z_O).FindControl("TextBoxName");//營業所名稱

                TextBox txt_up_BUSDATE = (TextBox)((ASP.wui_slp_slp_slpdate_ascx)slp_up_BUSDATE).FindControl("TextBoxCode");//訂單日期
                TextBox txt_up_SALE_ID = (TextBox)((ASP.sys_slp_slp_user_ascx)slp_up_SALE_ID).FindControl("TextBoxCode");//營業人員
                TextBox txt_up_SALE_NAME = (TextBox)((ASP.sys_slp_slp_user_ascx)slp_up_SALE_ID).FindControl("TextBoxName");//營業人員名稱

                TextBox txt_up_BUSUID = (TextBox)((ASP.sys_slp_slp_user_ascx)slp_up_BUSUID).FindControl("TextBoxCode");//訂單維護者

                Image img_up_CHAN_NO = (Image)((ASP.stm_slp_slp_storechain_ascx)slp_up_CHAN_NO).FindControl("Image1");//通路img
                Image img_up_STORE = (Image)((ASP.stm_slp_slp_store_ascx)slp_up_STORE).FindControl("Image1");//門市img
                Image img_up_BUSDATE = (Image)((ASP.wui_slp_slp_slpdate_ascx)slp_up_BUSDATE).FindControl("Image1");//訂單日期img
                Image img_up_SALE_ID = (Image)((ASP.sys_slp_slp_user_ascx)slp_up_SALE_ID).FindControl("Image1");//營業人員img
                Image img_up_BUSUID = (Image)((ASP.sys_slp_slp_user_ascx)slp_up_BUSUID).FindControl("Image1");//訂單維護者img
                Image img_down_ITEM = (Image)((ASP.itm_slp_slp_sku_ascx)slp_down_ITEM).FindControl("Image1");//品號img
                Image img_down_REQUEST_QTY = (Image)((ASP.wui_slp_slp_slpquantity_ascx)slp_down_REQUEST_QTY).FindControl("Image1");//訂貨量img
                Image img_down_RTN_DDL = (Image)((ASP.wui_slp_slp_slpdate_ascx)slp_down_RTN_DDL).FindControl("Image1");//退書截止日img

                TextBox txt_down_ITEM = (TextBox)((ASP.itm_slp_slp_sku_ascx)slp_down_ITEM).FindControl("TextBoxCode");//品號
                TextBox txt_down_ITEM_NAME = (TextBox)((ASP.itm_slp_slp_sku_ascx)slp_down_ITEM).FindControl("TextBoxName");//品名
                TextBox txt_down_REQUEST_QTY = (TextBox)((ASP.wui_slp_slp_slpquantity_ascx)slp_down_REQUEST_QTY).FindControl("TextBoxCode");//訂貨量
                TextBox txt_down_REQUEST_QTY_NAME = (TextBox)((ASP.wui_slp_slp_slpquantity_ascx)slp_down_REQUEST_QTY).FindControl("TextBoxName");//訂貨量名稱
                TextBox txt_down_RTN_DDL = (TextBox)((ASP.wui_slp_slp_slpdate_ascx)slp_down_RTN_DDL).FindControl("TextBoxCode");//退書截止日
                CheckBox chk_down_IS_OVERDUE = (CheckBox)((ASP.wui_slp_slp_boolean_ascx)slp_down_IS_OVERDUE).FindControl("C1");//逾期客訂
                #endregion
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Remove(0, sb.Length);
                CallBackValue = CallBackValue.Trim();
                string[] s_Client_String = System.Text.RegularExpressions.Regex.Split(CallBackValue, "<partition>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
                ArrayList ParameterList = new ArrayList();//20091117

                #region 新增模式下異動欄位[門市]

                if (s_Client_String[0] == "新增模式下異動欄位[門市]")
                {
                    if (dtChainPOSetting != null)
                    { dtChainPOSetting = null; }

                    s_STORE = s_Client_String[1].ToString().Trim();//門市
                    s_CHAN_NO = s_Client_String[2].ToString().Trim();//通路

                    #region 從資料庫查詢資料

                    ParameterList.Clear();
                    ParameterList.Add(s_Client_String[1]);//門市
                    ParameterList.Add(s_Client_String[2]);//通路
                    ParameterList.Add(Session["UID"].ToString());

                    DataTable dt_Return = new DataTable();
                    BCO.MaintainStore bco = new BCO.MaintainStore(ConntionDB);
                    dt_Return = bco.QUERY_STORE_BY_STOREANDCHAN(ParameterList);

                    #endregion

                    #region 設定回傳Client端資訊
                    if (dt_Return.Rows.Count == 0)
                    {
                        sb.Append("新增模式下異動欄位[門市]<partition>");
                        sb.Append("FALSE<partition>");
                        sb.Append("查無門市資料<partition>");
                        sb.Append(txt_up_STORE.ClientID + "<partition>");//設定焦點的欄位
                        sb.Append(txt_up_CHAN_NO.ClientID + "<partition>");
                        sb.Append(txt_up_Z_O.ClientID + "<partition>");
                        sb.Append(txt_up_SALE_ID.ClientID);
                    }
                    else
                    {
                        sb.Append("新增模式下異動欄位[門市]<partition>");
                        sb.Append("TRUE<partition>");
                        sb.Append(dt_Return.Rows[0]["CHAN_NO"].ToString() + "<partition_Detail>" + txt_up_CHAN_NO.ClientID + "<partition>");
                        sb.Append(dt_Return.Rows[0]["Z_O"].ToString() + "<partition_Detail>" + txt_up_Z_O.ClientID + "<partition>");
                        //sb.Append(dt_Return.Rows[0]["SAL_ID"].ToString() + "<partition_Detail>" + txt_up_SALE_ID.ClientID);
                        sb.Append(dt_Return.Rows[0]["SAL_ID"].ToString() + "<partition_Detail>" + txt_up_SALE_ID.ClientID + "<partition>");

                        sb.Append("<partition_Detail>" + txt_up_CHAN_NAME.ClientID + "<partition>");
                        sb.Append("<partition_Detail>" + txt_up_Z_O_NAME.ClientID + "<partition>");
                        sb.Append("<partition_Detail>" + txt_up_SALE_NAME.ClientID);

                        #region 取得通路PO控制設定

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

                        #endregion
                    }
                    #endregion
                }

                #endregion

                #region 新增或編輯模式下異動欄位[二段碼]

                else if (s_Client_String[0] == "新增或編輯模式下異動欄位[二段碼]")
                {
                    #region 從資料庫查詢資料:群分類、品號、期別

                    ParameterList.Clear();
                    ParameterList.Add(s_Client_String[1]);//通路
                    ParameterList.Add(s_Client_String[2]);//一段碼
                    ParameterList.Add(s_Client_String[3]);//二段碼

                    ParameterList.Add(Session["UID"].ToString());

                    DataTable dt_Return = new DataTable();
                    BCO.QueryCRMCommon bco = new BCO.QueryCRMCommon(ConntionDB);
                    dt_Return = bco.QueryItemPeriodInfoByBarcode(ParameterList);

                    #endregion

                    if (dt_Return.Rows.Count == 0)
                    {
                        sb.Append("新增或編輯模式下異動欄位[二段碼]<partition>");
                        sb.Append("FALSE<partition>");
                        sb.Append("此一段碼/二段碼不存在對應商品期別資訊,請重新輸入<partition>");
                        sb.Append(this.txt_down_BARCODE.ClientID + "<partition>");//設定焦點的欄位

                        sb.Append(this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");
                        sb.Append(txt_down_ITEM.ClientID + "<partition>");
                        sb.Append(this.txt_down_PERIOD.ClientID + "<partition>");
                        sb.Append(txt_down_RTN_DDL.ClientID);
                    }
                    else
                    {
                        sb.Append("新增或編輯模式下異動欄位[二段碼]<partition>");
                        sb.Append("TRUE<partition>");
                        sb.Append(dt_Return.Rows[0]["ITEM"].ToString() + "<partition_Detail>" + txt_down_ITEM.ClientID + "<partition>");
                        sb.Append(dt_Return.Rows[0]["PERIOD"].ToString() + "<partition_Detail>" + this.txt_down_PERIOD.ClientID + "<partition>");
                        sb.Append(DateTime.Parse(dt_Return.Rows[0]["RTN_DDL"].ToString()).ToString("yyyy/MM/dd") + "<partition_Detail>" + txt_down_RTN_DDL.ClientID);

                        //期別或品號有異動時,重取庫存
                        if (s_ITEM != dt_Return.Rows[0]["ITEM"].ToString() ||
                            s_PERIOD != dt_Return.Rows[0]["PERIOD"].ToString()
                           )

                        { dtStock = null; }
                        s_ROOT_NO = dt_Return.Rows[0]["ROOT_NO"].ToString();
                        s_ITEM = dt_Return.Rows[0]["ITEM"].ToString();
                        s_PERIOD = dt_Return.Rows[0]["PERIOD"].ToString();

                        GetStock(s_ROOT_NO, s_ITEM, s_PERIOD);
                    }
                }

                #endregion

                #region 新增或編輯模式下異動欄位[一段碼]onchange

                else if (s_Client_String[0] == "新增或編輯模式下異動欄位[一段碼]onchange")
                {
                    #region  根據一段碼帶出品號,最大發行期別,二段碼
                    ParameterList.Clear();
                    ParameterList.Add(s_Client_String[1]);//通路
                    ParameterList.Add(s_STORE);//通路
                    ParameterList.Add(s_Client_String[3]);//一段碼
                    ParameterList.Add(string.Empty);//二段碼
                    ParameterList.Add(Session["UID"].ToString());

                    DataTable dt_Return = new DataTable();
                    BCO.QueryCRMCommon bco = new BCO.QueryCRMCommon(ConntionDB);
                    dt_Return = bco.QueryItemPeriodInfoByBarcode2(ParameterList);


                    #endregion

                    if (dt_Return.Rows.Count == 0)
                    {
                        sb.Append("新增或編輯模式下異動欄位[一段碼]onchange<partition>");
                        sb.Append("FALSE<partition>");
                        sb.Append("此一段碼不存在已發行對應商品期別資訊,請重新輸入<partition>");
                        sb.Append(this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");
                        sb.Append(txt_down_ITEM.ClientID + "<partition>");
                        sb.Append(this.txt_down_PERIOD.ClientID + "<partition>");
                        sb.Append(txt_down_RTN_DDL.ClientID + "<partition>");
                        sb.Append(this.txt_down_RECOMMAND_LOCATION.ClientID + "<partition>");//建議儲區
                        sb.Append(this.txt_down_BARCODE.ClientID);//設定焦點的欄位

                    }
                    else
                    {
                        if (dt_Return.Rows[0]["CAN_DELIVER"].ToString() == "1")
                        {
                            //期別或品號有異動時,重取庫存
                            dtStock = null;
                            s_ROOT_NO = dt_Return.Rows[0]["ROOT_NO"].ToString();
                            s_ITEM = dt_Return.Rows[0]["ITEM"].ToString();
                            s_PERIOD = dt_Return.Rows[0]["PERIOD"].ToString();

                            GetStock(s_ROOT_NO, s_ITEM, s_PERIOD);

                            sb.Append("新增或編輯模式下異動欄位[一段碼]onchange<partition>");//找到對應商品期別資訊,設定商品期別
                            sb.Append("TRUE<partition>");
                            sb.Append(s_ITEM + "<partition_Detail>" + txt_down_ITEM.ClientID + "<partition>");
                            sb.Append(dt_Return.Rows[0]["PERIOD_BARCODE"].ToString() + "<partition_Detail>" + this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");
                            sb.Append(DateTime.Parse(dt_Return.Rows[0]["RTN_DDL"].ToString()).ToString("yyyy/MM/dd") + "<partition_Detail>" + txt_down_RTN_DDL.ClientID + "<partition>");
                            sb.Append(s_PERIOD + "<partition_Detail>" + this.txt_down_PERIOD.ClientID);
                        }
                        else
                        {
                            sb.Append("新增或編輯模式下異動欄位[一段碼]onchange<partition>");
                            sb.Append("FALSE<partition>");
                            sb.Append("此一段碼對應品號" + s_ITEM + "客服區域限制不可出貨,請重新輸入<partition>");
                            sb.Append(this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");
                            sb.Append(txt_down_ITEM.ClientID + "<partition>");
                            sb.Append(this.txt_down_PERIOD.ClientID + "<partition>");
                            sb.Append(txt_down_RTN_DDL.ClientID + "<partition>");
                            sb.Append(this.txt_down_RECOMMAND_LOCATION.ClientID + "<partition>");//建議儲區
                            sb.Append(this.txt_down_BARCODE.ClientID);//設定焦點的欄位
                        }
                    }
                    //sb.Append("新增或編輯模式下異動欄位[一段碼]onchange<partition>");
                    //sb.Append("TRUE<partition>");
                    //sb.Append(txt_down_ITEM.ClientID + "<partition>"); //異動一段碼時,清空 Item、 Period 、退貨日、儲區、逾期客訂,設定焦點到ITEM
                    //sb.Append(this.txt_down_PERIOD.ClientID + "<partition>"); //期別
                    //sb.Append(this.txt_down_PERIOD_BARCODE.ClientID + "<partition>"); //二段碼
                    //sb.Append(txt_down_RTN_DDL.ClientID + "<partition>"); //預定退貨日
                    //sb.Append(this.txt_down_RECOMMAND_LOCATION);//建議儲區

                }

                #endregion

                #region 新增或編輯模式下異動欄位[品號/品名]

                else if (s_Client_String[0] == "新增或編輯模式下異動欄位[品號/品名]")
                {
                    //s_PMA = string.Empty;//大分類
                    //s_ROOT_NO = string.Empty;//群分類
                    s_ITEM = s_Client_String[1].ToString().Trim();//品號

                    #region 從資料庫查詢資料

                    ParameterList.Clear();
                    ParameterList.Add(s_Client_String[1]);//品號
                    ParameterList.Add(s_CHAN_NO);//通路
                    ParameterList.Add(s_STORE);//門市                    
                    ParameterList.Add(Session["UID"].ToString());

                    DataTable dt_Return_1 = new DataTable();
                    BCO.QueryCRMCommon bco = new BCO.QueryCRMCommon(ConntionDB);
                    dt_Return_1 = bco.GetMaxDeiveryPeriod2(ParameterList);

                    #endregion

                    if (dt_Return_1 == null || dt_Return_1.Rows.Count == 0 ||
                        dt_Return_1.Rows[0]["PERIOD"].ToString() == string.Empty)
                    {
                        sb.Length = 0;
                        sb.Append("新增或編輯模式下異動欄位[品號/品名]<partition>");
                        sb.Append("FALSE<partition>");
                        sb.Append("查無資料<partition>");
                        sb.Append(txt_down_ITEM.ClientID);//設定焦點的欄位

                    }
                    else
                    {
                        //設定品號、期別
                        s_ITEM = s_Client_String[1];
                        s_PERIOD = dt_Return_1.Rows[0]["PERIOD"].ToString();
                        //設定群分類、大分類
                        s_PMA = dt_Return_1.Rows[0]["PMA"].ToString();//大分類
                        s_ROOT_NO = dt_Return_1.Rows[0]["ROOT_NO"].ToString();//群分類

                        if (dt_Return_1.Rows[0]["CAN_DELIVER"].ToString() == "1")
                        {
                            sb.Length = 0;
                            sb.Append("新增或編輯模式下異動欄位[品號/品名]<partition>");
                            sb.Append("TRUE<partition>");
                            sb.Append(dt_Return_1.Rows[0]["PERIOD"].ToString() + "<partition_Detail>" + this.txt_down_PERIOD.ClientID);
                        }
                        else
                        {
                            sb.Length = 0;
                            sb.Append("新增或編輯模式下異動欄位[品號/品名]<partition>");
                            sb.Append("FALSE<partition>");
                            sb.Append("客服區域限制不可出貨<partition>");
                            sb.Append(txt_down_ITEM.ClientID);//設定焦點的欄位
                        }

                        #region  OLD 取得商品主檔資訊

                        //DataTable dt_Return_2 = new DataTable();

                        //ParameterList.Clear();
                        //BCO_ITM.SQLHelper.SQLWhere(ref ParameterList, DbType.String, "MA.ITEM", s_Client_String[1], "=", "and");

                        //BCO_ITM.MaintainSKU bco_itm = new BCO_ITM.MaintainSKU(ConntionDB);
                        //dt_Return_2 = bco_itm.QuerySKUByFind_1(ParameterList);

                        //if (dt_Return_2 != null && dt_Return_2.Rows.Count != 0)
                        //{
                        //    s_PMA = dt_Return_2.Rows[0]["PMA"].ToString();//大分類

                        //    s_ROOT_NO = dt_Return_2.Rows[0]["ROOT_NO"].ToString();//群分類
                        //}
                        //else
                        //{
                        //    sb = sb.Remove(0, sb.Length);
                        //    sb.Append("新增或編輯模式下異動欄位[品號/品名]<partition>");
                        //    sb.Append("FALSE<partition>");
                        //    sb.Append("商品主檔中無對應品號<partition>");
                        //    sb.Append(txt_down_ITEM.ClientID);//設定焦點的欄位

                        //}

                        #endregion
                    }
                }

                #endregion

                #region 新增或編輯模式下異動欄位[期別]

                else if (s_Client_String[0] == "新增或編輯模式下異動欄位[期別]")
                {
                    //期別或品號有異動時,重取庫存
                    if (s_ITEM != s_Client_String[3].ToString().Trim() ||
                          s_PERIOD != s_Client_String[4].ToString().Trim()
                       )

                    { dtStock = null; }

                    s_CHAN_NO = s_Client_String[1].ToString().Trim();//通路
                    s_STORE = s_Client_String[2].ToString().Trim();//門市

                    if (s_ITEM != s_Client_String[3].ToString().Trim())
                    {

                    }
                    s_ITEM = s_Client_String[3].ToString().Trim();//品號
                    s_PERIOD = s_Client_String[4].ToString().Trim();//期別


                    #region 檢查書店是否有未結案同品項訂單


                    if (s_Client_String[8] == string.Empty)
                    {

                        #region 從資料庫查詢資料

                        ParameterList.Clear();
                        ParameterList.Add(s_Client_String[1]);//通路
                        ParameterList.Add(s_Client_String[2]);//門市

                        ParameterList.Add(s_Client_String[3]);//品號
                        ParameterList.Add(s_Client_String[4]);//期別
                        ParameterList.Add(Session["UID"].ToString());
                        ParameterList.Add(this.txt_up_CODE.Text);//訂單單號

                        DataTable dt_Return_1 = new DataTable();
                        BCO.RecordCRMOrder bco_Record = new BCO.RecordCRMOrder(ConntionDB);
                        dt_Return_1 = bco_Record.CheckOrderItemExist(ParameterList);

                        #endregion

                        if (dt_Return_1.Rows.Count > 0)
                        {
                            sb.Append("新增或編輯模式下異動欄位[期別]<partition>");
                            sb.Append("檢查書店是否有未結案同品項訂單<partition>");
                            sb.Append("該門市已存在未結案之同品項訂單於訂單標號:[" + dt_Return_1.Rows[0]["CRM_REQUEST_NO"].ToString() + "],不可新增<partition>");
                            sb.Append(this.txt_down_PO_SOURCE_NO.ClientID + "<partition>");//設定焦點的欄位

                            sb.Append(chk_down_IS_OVERDUE.ClientID + "<partition>");//逾期客訂
                            sb.Append(this.txt_down_PO_SOURCE_NO.ClientID + "<partition>");//PO單號
                            sb.Append(this.txt_down_BARCODE.ClientID + "<partition>");//一段碼
                            sb.Append(this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");//二段碼

                            sb.Append(txt_down_ITEM.ClientID + "<partition>");//品號
                            sb.Append(txt_down_ITEM_NAME.ClientID + "<partition>");//品名
                            sb.Append(this.txt_down_PERIOD.ClientID + "<partition>");//期別
                            sb.Append(txt_down_REQUEST_QTY.ClientID + "<partition>");//訂貨量

                            sb.Append(txt_down_REQUEST_QTY_NAME.ClientID + "<partition>");//訂貨量名稱

                            sb.Append(txt_down_RTN_DDL.ClientID + "<partition>");//退書截止日
                            sb.Append(this.txt_down_RECOMMAND_LOCATION.ClientID);//建議儲區

                            return sb.ToString();
                        }
                    }

                    #endregion

                    #region 檢查牌價是否已經正確建立

                    ParameterList.Clear();
                    ParameterList.Add(s_Client_String[2]);//門市
                    ParameterList.Add(s_Client_String[3]);//品號
                    ParameterList.Add(s_Client_String[4]);//期別
                    ParameterList.Add(DateTime.Today.ToString("yyyy/MM/dd")); // 系統日
                    ParameterList.Add(Session["UID"].ToString());
                    PIC.VDS2G.BSM.ALO.ProcessALOCommon co_process = new PIC.VDS2G.BSM.ALO.ProcessALOCommon(ConntionDB);
                    string sRes = co_process.CheckStAcceptDisPrice(ParameterList);
                    //bool bRes = co_process.CheckStAcceptDisPrice(ParameterList, null);
                    if (sRes != string.Empty)
                    {
                        sb.Append("新增或編輯模式下異動欄位[期別]<partition>");
                        sb.Append("檢查牌價是否已經正確建立<partition>");
                        sb.Append("期別" + s_PERIOD + "牌價未生效[" + sRes + "],不可新增<partition>");
                        sb.Append(this.txt_down_PERIOD.ClientID + "<partition>");//設定焦點的欄位

                        sb.Append(chk_down_IS_OVERDUE.ClientID + "<partition>");//逾期客訂
                        sb.Append(this.txt_down_PO_SOURCE_NO.ClientID + "<partition>");//PO單號
                        sb.Append(this.txt_down_BARCODE.ClientID + "<partition>");//一段碼
                        sb.Append(this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");//二段碼

                        sb.Append(txt_down_ITEM.ClientID + "<partition>");//品號
                        sb.Append(txt_down_ITEM_NAME.ClientID + "<partition>");//品名
                        sb.Append(this.txt_down_PERIOD.ClientID + "<partition>");//期別
                        sb.Append(txt_down_REQUEST_QTY.ClientID + "<partition>");//訂貨量

                        sb.Append(txt_down_REQUEST_QTY_NAME.ClientID + "<partition>");//訂貨量名稱

                        sb.Append(txt_down_RTN_DDL.ClientID + "<partition>");//退書截止日
                        sb.Append(this.txt_down_RECOMMAND_LOCATION.ClientID);//建議儲區
                        return sb.ToString();
                    }

                    #endregion

                    #region 設定二段碼、退書截止日與逾期客訂

                    string s_down_BARCODE = string.Empty;//一段碼
                    string s_down_PERIOD_BARCODE = string.Empty;//二段碼

                    string s_down_RTN_DDL = string.Empty;//退書截止日

                    s_down_BARCODE = s_Client_String[5];
                    s_down_PERIOD_BARCODE = s_Client_String[6];
                    s_down_RTN_DDL = s_Client_String[7];
                    BCO.QueryCRMCommon bco_Common = new BCO.QueryCRMCommon(ConntionDB);

                    // 不管原來有沒有值,只要品號改變,都重新查詢
                    //if (s_Client_String[5] == string.Empty ||//一段碼
                    //    s_Client_String[6] == string.Empty ||//二段碼

                    //    s_Client_String[7] == string.Empty)//退書截止日
                    //{
                    ParameterList.Clear();
                    ParameterList.Add(s_Client_String[1]);//通路
                    ParameterList.Add(s_Client_String[3]);//品號
                    ParameterList.Add(s_Client_String[4]);//期別
                    ParameterList.Add(Session["UID"].ToString());

                    DataTable dt_Return_2 = new DataTable();

                    dt_Return_2 = bco_Common.QueryItemPeriodInfo(ParameterList);

                    if (dt_Return_2.Rows.Count > 0)//有找到資料
                    {
                        s_down_BARCODE = dt_Return_2.Rows[0]["BARCODE"].ToString();
                        s_down_PERIOD_BARCODE = dt_Return_2.Rows[0]["PERIOD_BARCODE"].ToString();
                        s_down_RTN_DDL = DateTime.Parse(dt_Return_2.Rows[0]["RTN_DDL"].ToString()).ToString("yyyy/MM/dd");

                    }
                    else//查無資料
                    {
                        sb.Append("新增或編輯模式下異動欄位[期別]<partition>");
                        sb.Append("設定二段碼、退書截止日與逾期客訂<partition>");
                        sb.Append("查無[一段碼][二段碼][退書截止日],無法新增<partition>");
                        sb.Append(this.txt_down_PO_SOURCE_NO.ClientID + "<partition>");//設定焦點的欄位

                        sb.Append(chk_down_IS_OVERDUE.ClientID + "<partition>");//逾期客訂
                        sb.Append(this.txt_down_PO_SOURCE_NO.ClientID + "<partition>");//PO單號
                        sb.Append(this.txt_down_BARCODE.ClientID + "<partition>");//一段碼
                        sb.Append(this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");//二段碼

                        sb.Append(txt_down_ITEM.ClientID + "<partition>");//品號
                        sb.Append(txt_down_ITEM_NAME.ClientID + "<partition>");//品名
                        sb.Append(this.txt_down_PERIOD.ClientID + "<partition>");//期別
                        sb.Append(txt_down_REQUEST_QTY.ClientID + "<partition>");//訂貨量

                        sb.Append(txt_down_REQUEST_QTY_NAME.ClientID + "<partition>");//訂貨量名稱

                        sb.Append(txt_down_RTN_DDL.ClientID + "<partition>");//退書截止日
                        sb.Append(this.txt_down_RECOMMAND_LOCATION.ClientID);//建議儲區

                        return sb.ToString();
                    }
                    //}

                    #endregion

                    #region 逾期客訂確認

                    TimeSpan time = new TimeSpan(11, 00, 00);
                    bool b_down_IS_OVERDUE = false;
                    DateTime d_Now;
                    DateTime d_RTN_DDL;

                    d_Now = DateTime.Now;
                    d_RTN_DDL = DateTime.Parse(s_down_RTN_DDL);

                    if (d_Now.DayOfWeek == DayOfWeek.Saturday ||
                        d_Now.DayOfWeek == DayOfWeek.Sunday ||
                        (d_Now.DayOfWeek == DayOfWeek.Friday && d_Now.TimeOfDay.CompareTo(time) >= 0))
                    {
                        //if (d_RTN_DDL.AddDays(-5).ToShortDateString().CompareTo(d_Now.ToShortDateString()) <= 0)
                        if (d_RTN_DDL.AddDays(-5).ToString("yyyy/MM/dd").CompareTo(d_Now.ToString("yyyy/MM/dd")) <= 0)
                        {
                            b_down_IS_OVERDUE = true;
                            b_IS_OVERDUE = true;
                        }
                    }
                    else
                    {
                        //if (d_RTN_DDL.AddDays(-2).ToShortDateString().CompareTo(d_Now.ToShortDateString()) <= 0)
                        if (d_RTN_DDL.AddDays(-2).ToString("yyyy/MM/dd").CompareTo(d_Now.ToString("yyyy/MM/dd")) <= 0)
                        {
                            b_down_IS_OVERDUE = true;
                            b_IS_OVERDUE = true;
                        }
                    }

                    //[@逾期客訂].檢查結果為True時,顯示Confirm訊息『商品已逾期,不可退貨,確定要新增?』

                    //使用者確認要新增時,可繼續編輯。

                    //使用者選擇不新增時,取消本筆明細新增。

                    if (b_down_IS_OVERDUE == true)
                    {
                        sb.Append("新增或編輯模式下異動欄位[期別]<partition>");
                        sb.Append("[逾期客訂]檢查結果為TRUE<partition>");
                        sb.Append(chk_down_IS_OVERDUE.ClientID + "<partition>");//逾期客訂
                        sb.Append(s_ROOT_NO + "<partition>");//群分類

                        sb.Append(s_Client_String[3] + "<partition>");//品號
                        sb.Append(s_Client_String[4] + "<partition>");//期別
                        sb.Append(s_down_BARCODE + "<partition_Detail>" + this.txt_down_BARCODE.ClientID + "<partition>");//一段碼
                        sb.Append(s_down_PERIOD_BARCODE + "<partition_Detail>" + this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");//二段碼

                        sb.Append(s_down_RTN_DDL + "<partition_Detail>" + txt_down_RTN_DDL.ClientID);//退書截止日

                        return sb.ToString();
                    }
                    else
                    {
                        sb.Append("新增或編輯模式下異動欄位[期別]<partition>");
                        sb.Append("[逾期客訂]檢查結果為FALSE<partition>");
                        sb.Append(chk_down_IS_OVERDUE.ClientID + "<partition>");//逾期客訂
                        sb.Append(s_down_BARCODE + "<partition_Detail>" + this.txt_down_BARCODE.ClientID + "<partition>");//一段碼
                        sb.Append(s_down_PERIOD_BARCODE + "<partition_Detail>" + this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");//二段碼

                        sb.Append(s_down_RTN_DDL + "<partition_Detail>" + txt_down_RTN_DDL.ClientID);//退書截止日
                    }

                    #endregion

                    #region 取得庫存資訊

                    GetStock(s_ROOT_NO, s_Client_String[3], s_Client_String[4]);

                    #endregion
                }

                #endregion

                #region 新增或編輯模式下異動欄位[期別]Confirm後

                else if (s_Client_String[0] == "新增或編輯模式下異動欄位[期別]Confirm後")
                {
                    if (dtStock != null)
                    { dtStock = null; }

                    if (s_Client_String[1] == "TRUE")//繼續編輯。
                    {
                        #region 取得商品主檔資訊

                        if (s_PMA == String.Empty || s_ROOT_NO == String.Empty)
                        {
                            DataTable dt_Return_2 = new DataTable();

                            ParameterList.Clear();
                            BCO_ITM.SQLHelper.SQLWhere(ref ParameterList, DbType.String, "MA.ITEM", slp_down_ITEM.Text, "=", "and");

                            BCO_ITM.MaintainSKU bco_itm = new BCO_ITM.MaintainSKU(ConntionDB);
                            dt_Return_2 = bco_itm.QuerySKUByFind_1(ParameterList);

                            if (dt_Return_2 != null && dt_Return_2.Rows.Count != 0)
                            {
                                s_PMA = dt_Return_2.Rows[0]["PMA"].ToString();//大分類

                                s_ROOT_NO = dt_Return_2.Rows[0]["ROOT_NO"].ToString();//群分類
                            }
                            else
                            {
                                sb = sb.Remove(0, sb.Length);
                                sb.Append("新增或編輯模式下異動欄位[期別]Confirm後<partition>");
                                sb.Append("FALSE<partition>");
                                sb.Append("商品主檔中無對應品號<partition>");
                                sb.Append(txt_down_ITEM.ClientID);//設定焦點的欄位
                            }
                        }

                        #endregion

                        #region 取得庫存資訊

                        GetStock(s_ROOT_NO, s_Client_String[3], s_Client_String[4]);
                        #endregion
                    }
                    else if (s_Client_String[1] == "FALSE")//取消本筆明細新增。
                    {
                        #region 清空靜態變數

                        dtStock = null;//異動欄位[期別]
                        s_PMA = string.Empty;//大分類(異動欄位[品號/品名])
                        s_ROOT_NO = string.Empty;//群分類(異動欄位[品號/品名])
                        s_SRC_LOCATE_TYPE = string.Empty;//建議儲區類別(異動欄位[訂貨量])

                        #endregion

                        #region 計算 dt_Detail 的筆數


                        int i_dt_Detail_Count = 0;
                        if (dt_Detail != null)
                        {
                            if (dt_Detail.GetChanges(DataRowState.Deleted) == null)
                            { i_dt_Detail_Count = dt_Detail.Rows.Count; }
                            else
                            { i_dt_Detail_Count = dt_Detail.Rows.Count - dt_Detail.GetChanges(DataRowState.Deleted).Rows.Count; }
                        }

                        #endregion

                        sb.Append("新增或編輯模式下異動欄位[期別]Confirm後<partition>");
                        sb.Append(i_dt_Detail_Count.ToString() + "<partition>");//dt_Detail的筆數
                        sb.Append(this.hid_PageStatus.ClientID + "<partition>");//hid_PageStatus
                        sb.Append(this.panel_Down_AddDetail.ClientID + "<partition>");//panel_Down_AddDetail
                        sb.Append(this.panel_Down_Button.ClientID + "<partition>");//panel_Down_Button
                        sb.Append(chk_down_IS_OVERDUE.ClientID + "<partition>");//逾期客訂
                        sb.Append(this.txt_down_PO_SOURCE_NO.ClientID + "<partition>");//PO單號
                        sb.Append(this.txt_down_BARCODE.ClientID + "<partition>");//一段碼
                        sb.Append(this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");//二段碼
                        sb.Append(txt_down_ITEM.ClientID + "<partition>");//品號
                        sb.Append(txt_down_ITEM_NAME.ClientID + "<partition>");//品名
                        sb.Append(this.txt_down_PERIOD.ClientID + "<partition>");//期別
                        sb.Append(txt_down_REQUEST_QTY.ClientID + "<partition>");//訂貨量
                        sb.Append(txt_down_REQUEST_QTY_NAME.ClientID + "<partition>");//訂貨量名稱
                        sb.Append(txt_down_RTN_DDL.ClientID + "<partition>");//退書截止日
                        sb.Append(this.txt_down_RECOMMAND_LOCATION.ClientID + "<partition>");//建議儲區
                        sb.Append(txt_up_CHAN_NO.ClientID + "<partition>");//通路
                        sb.Append(txt_up_STORE.ClientID + "<partition>");//門市
                        sb.Append(txt_up_Z_O.ClientID + "<partition>");//營業所
                        sb.Append(txt_up_BUSDATE.ClientID + "<partition>");//訂單日期
                        sb.Append(txt_up_SALE_ID.ClientID + "<partition>");//營業人員
                        sb.Append(txt_up_BUSUID.ClientID + "<partition>");//訂單維護者
                        sb.Append(((DropDownList)((ASP.sys_slp_slp_enumbase_ascx)drop_up_ORDER_TYPE).FindControl("D1")).ClientID + "<partition>");//訂單來源
                        sb.Append(this.txt_up_PO_SOURCE_NO.ClientID + "<partition>");//PO單號預設
                        sb.Append(this.txt_up_CODE.ClientID + "<partition>");//訂單編號
                        sb.Append(this.txt_up_CRM_NO.ClientID + "<partition>");//流水編號
                        sb.Append(img_up_CHAN_NO.ClientID + "<partition>");//通路img
                        sb.Append(img_up_STORE.ClientID + "<partition>");//門市img
                        sb.Append(img_up_BUSDATE.ClientID + "<partition>");//訂單日期img
                        sb.Append(img_up_SALE_ID.ClientID + "<partition>");//營業人員img
                        sb.Append(img_up_BUSUID.ClientID);//訂單維護者img
                    }
                }

                #endregion

                #region 新增或編輯模式下異動欄位[訂貨量]

                else if (s_Client_String[0] == "新增或編輯模式下異動欄位[訂貨量]")
                {

                    #region 判斷庫存是否足夠
                    if ((dtStock == null) || (dtStock.Rows.Count < 1))
                    {

                        GetStock(s_ROOT_NO, s_ITEM, s_PERIOD);
                    }
                    if (((dtStock == null) || (dtStock.Rows.Count < 1)) &&
                        (s_ROOT_NO != "2"))
                    {

                        sb.Append("新增或編輯模式下異動欄位[訂貨量]<partition>");
                        sb.Append("FALSE<partition>");
                        sb.Append("庫存量不足,請取消新增<partition>");
                        sb.Append(txt_down_REQUEST_QTY.ClientID + "<partition>");//設定焦點的欄位 
                        sb.Append(this.txt_down_RECOMMAND_LOCATION.ClientID);

                        return sb.ToString();
                    }
                    #endregion

                    DataView dvStock = new DataView(dtStock.Copy());

                    s_SRC_LOCATE_TYPE = string.Empty;
                    int i_REQUEST_QTY = 0;//畫面上使用者輸入的"訂貨量"
                    int i_ONHD_QTY = 0;//現有庫存量
                    int i_RESERVE_QTY = 0;//配本保留數
                    int i_Final_QTY = 0;//庫存儲區可配量
                    int i_DIS_ENABLE = 0;//可配量
                    string s_SRC_LOCATE_NO = string.Empty;//VDS_CRM_ORDER_DETL.SRC_LOCATE_NO欄位

                    i_REQUEST_QTY = int.Parse(s_Client_String[1]);

                    // 2009-07-30 cyshu 修改,逾期客訂可取退貨儲區庫存
                    #region [@群分類]=1(雜誌) 時

                    //if (s_ROOT_NO == "1" && s_Client_String[2] == "false")
                    if (s_ROOT_NO == "1")
                    {
                        #region 先檢查庫存儲區可用庫存

                        dvStock.RowFilter = "LOCATETYPE = '2'";
                        dvStock.Sort = "ONHD_QTY DESC";
                        #region Old Source
                        //if (dvStock.Count > 0)
                        //{
                        //    i_ONHD_QTY = 0;
                        //    i_RESERVE_QTY = 0;
                        //    for (int i = 0; i < dvStock.Count; i++)
                        //    {
                        //        i_ONHD_QTY += int.Parse(dvStock[i]["ONHD_QTY"].ToString());
                        //        i_RESERVE_QTY += int.Parse(dvStock[i]["RESERVE_QTY"].ToString());
                        //    }
                        //}
                        #endregion

                        #region new code
                        i_ONHD_QTY = 0;
                        i_RESERVE_QTY = 0;
                        bool b_Locate_Stock = false; //庫存儲區
                        for (int i = 0; i < dvStock.Count; i++)
                        {
                            i_ONHD_QTY = int.Parse(dvStock[i]["ONHD_QTY"].ToString());
                            i_RESERVE_QTY = int.Parse(dvStock[i]["RESERVE_QTY"].ToString());
                            i_Final_QTY = i_ONHD_QTY - i_RESERVE_QTY;//庫存儲區可配量
                            if (i_Final_QTY >= i_REQUEST_QTY)
                            {
                                s_SRC_LOCATE_TYPE = "2";
                                s_SRC_LOCATE_NO = dvStock[i]["LOCATE_NO"].ToString();//現有庫存儲區
                                try
                                {
                                    i_DIS_ENABLE = int.Parse(dvStock[0]["ONHD_QTY"].ToString()) - int.Parse(dvStock[0]["RESERVE_QTY"].ToString());
                                }
                                catch { i_DIS_ENABLE = 0; }
                                b_Locate_Stock = true;
                                break;
                            }
                        }
                        if (!b_Locate_Stock) //庫存儲區庫存不足
                        {

                            if (s_PMA == "13" ||
                                s_PMA == "14" ||
                                s_PMA == "15" ||
                                s_PMA == "16")
                            {
                                #region 外雜
                                sb.Append("新增或編輯模式下異動欄位[訂貨量]<partition>");
                                sb.Append("FALSE<partition>");
                                sb.Append("外雜D儲區庫存量不足,無法新增訂單<partition>");
                                sb.Append(txt_down_REQUEST_QTY.ClientID + "<partition>");//設定焦點的欄位

                                sb.Append(this.txt_down_RECOMMAND_LOCATION.ClientID);

                                return sb.ToString();
                                #endregion
                            }
                            else
                            {
                                #region 檢查退貨儲區可用庫存

                                i_ONHD_QTY = 0;
                                i_RESERVE_QTY = 0;
                                i_Final_QTY = 0;
                                i_DIS_ENABLE = 0;
                                s_SRC_LOCATE_NO = string.Empty;

                                dvStock.RowFilter = "LOCATETYPE = '1'";
                                for (int i = 0; i < dvStock.Count; i++)
                                {
                                    i_ONHD_QTY += int.Parse(dvStock[i]["ONHD_QTY"].ToString());
                                    i_RESERVE_QTY += int.Parse(dvStock[i]["RESERVE_QTY"].ToString());
                                }

                                i_Final_QTY = i_ONHD_QTY - i_RESERVE_QTY;

                                if (i_Final_QTY >= i_REQUEST_QTY)
                                {
                                    s_SRC_LOCATE_TYPE = "1";//退貨儲區
                                    s_SRC_LOCATE_NO = dvStock[0]["LOCATE_NO"].ToString();//現有庫存量最大的儲區
                                    i_DIS_ENABLE = int.Parse(dvStock[0]["ONHD_QTY"].ToString()) - int.Parse(dvStock[0]["RESERVE_QTY"].ToString());
                                }
                                else
                                {
                                    sb.Append("新增或編輯模式下異動欄位[訂貨量]<partition>");
                                    sb.Append("FALSE<partition>");
                                    sb.Append("庫存量不足,請取消新增<partition>");
                                    sb.Append(txt_down_REQUEST_QTY.ClientID + "<partition>");//設定焦點的欄位 
                                    sb.Append(this.txt_down_RECOMMAND_LOCATION.ClientID);

                                    return sb.ToString();
                                }
                                #endregion
                            }

                        }
                        #endregion new code

                        #region old code2
                        //i_Final_QTY = i_ONHD_QTY - i_RESERVE_QTY;//庫存儲區可配量

                        //// 庫存儲區可配量 >= 訂量時,設定建議儲區 = 庫存儲區
                        //if (i_Final_QTY >= i_REQUEST_QTY)
                        //{
                        //    s_SRC_LOCATE_TYPE = "2";//庫存儲區
                        //    s_SRC_LOCATE_NO = dvStock[0]["LOCATE_NO"].ToString();//現有庫存量最大的儲區
                        //    try
                        //    {
                        //        i_DIS_ENABLE = int.Parse(dvStock[0]["ONHD_QTY"].ToString()) - int.Parse(dvStock[0]["RESERVE_QTY"].ToString());
                        //    }
                        //    catch { i_DIS_ENABLE = 0; }
                        //}
                        //else
                        //{
                        //    if (s_PMA == "13" ||
                        //        s_PMA == "14" ||
                        //        s_PMA == "15" ||
                        //        s_PMA == "16")
                        //    {
                        //        sb.Append("新增或編輯模式下異動欄位[訂貨量]<partition>");
                        //        sb.Append("FALSE<partition>");
                        //        sb.Append("外雜D儲區庫存量不足,無法新增訂單<partition>");
                        //        sb.Append(txt_down_REQUEST_QTY.ClientID + "<partition>");//設定焦點的欄位

                        //        sb.Append(this.txt_down_RECOMMAND_LOCATION.ClientID);

                        //        return sb.ToString();
                        //    }
                        //    else
                        //    {
                        //        #region 檢查退貨儲區可用庫存

                        //        i_ONHD_QTY = 0;
                        //        i_RESERVE_QTY = 0;
                        //        i_Final_QTY = 0;
                        //        i_DIS_ENABLE = 0;
                        //        s_SRC_LOCATE_NO = string.Empty;

                        //        dvStock.RowFilter = "LOCATETYPE = '1'";
                        //        for (int i = 0; i < dvStock.Count; i++)
                        //        {
                        //            i_ONHD_QTY += int.Parse(dvStock[i]["ONHD_QTY"].ToString());
                        //            i_RESERVE_QTY += int.Parse(dvStock[i]["RESERVE_QTY"].ToString());
                        //        }

                        //        i_Final_QTY = i_ONHD_QTY - i_RESERVE_QTY;

                        //        if (i_Final_QTY >= i_REQUEST_QTY)
                        //        {
                        //            s_SRC_LOCATE_TYPE = "1";//退貨儲區
                        //            s_SRC_LOCATE_NO = dvStock[0]["LOCATE_NO"].ToString();//現有庫存量最大的儲區
                        //            i_DIS_ENABLE = int.Parse(dvStock[0]["ONHD_QTY"].ToString()) - int.Parse(dvStock[0]["RESERVE_QTY"].ToString());
                        //        }
                        //        else
                        //        {
                        //            sb.Append("新增或編輯模式下異動欄位[訂貨量]<partition>");
                        //            sb.Append("FALSE<partition>");
                        //            sb.Append("庫存量不足,請取消新增<partition>");
                        //            sb.Append(txt_down_REQUEST_QTY.ClientID + "<partition>");//設定焦點的欄位 
                        //            sb.Append(this.txt_down_RECOMMAND_LOCATION.ClientID);

                        //            return sb.ToString();
                        //        }

                        //        #endregion
                        //    }
                        //}

                        #endregion old code2
                        #endregion
                    }

                    #endregion

                    #region [@群分類]=2(圖書)

                    else
                    {
                        dvStock.RowFilter = "LOCATETYPE = '2'";
                        dvStock.Sort = "ONHD_QTY DESC";

                        if (dvStock.Count > 0)
                        {
                            // 先作預設值
                            s_SRC_LOCATE_TYPE = "2"; // 庫存儲區
                            s_SRC_LOCATE_NO = dvStock[0]["LOCATE_NO"].ToString();//現有庫存量最大的儲區

                            for (int i = 0; i < dvStock.Count; i++)
                            {
                                i_ONHD_QTY += int.Parse(dvStock[i]["ONHD_QTY"].ToString());
                                i_RESERVE_QTY += int.Parse(dvStock[i]["RESERVE_QTY"].ToString());
                            }

                            i_Final_QTY = i_ONHD_QTY - i_RESERVE_QTY;

                            if (i_Final_QTY >= i_REQUEST_QTY)
                            {
                                s_SRC_LOCATE_TYPE = "2";//庫存儲區
                                s_SRC_LOCATE_NO = dvStock[0]["LOCATE_NO"].ToString();//現有庫存量最大的儲區
                                i_DIS_ENABLE = int.Parse(dvStock[0]["ONHD_QTY"].ToString()) - int.Parse(dvStock[0]["RESERVE_QTY"].ToString());
                            }
                            else //圖書庫存不足仍可新增
                            {
                                s_SRC_LOCATE_TYPE = "2";//庫存儲區
                                s_SRC_LOCATE_NO = "D";
                                i_DIS_ENABLE = 0;
                                sb.Append("新增或編輯模式下異動欄位[訂貨量]<partition>");
                                sb.Append("TRUE_ALERT<partition>");
                                sb.Append("圖書庫存不足,確認要新增?<partition>");
                                sb.Append(s_SRC_LOCATE_NO + "<partition_Detail>" + this.txt_down_RECOMMAND_LOCATION.ClientID + "<partition>");
                                sb.Append(i_DIS_ENABLE.ToString() + "<partition_Detail>" + this.hid_DIS_ENABLE.ClientID);
                                return sb.ToString();
                            }
                        }
                        else //圖書庫存不足仍可新增
                        {
                            #region 圖書庫存不足仍可新增
                            s_SRC_LOCATE_TYPE = "2";//庫存儲區
                            s_SRC_LOCATE_NO = "D";
                            i_DIS_ENABLE = 0;
                            sb.Append("新增或編輯模式下異動欄位[訂貨量]<partition>");
                            sb.Append("TRUE_ALERT<partition>");
                            sb.Append("圖書庫存不足,確認要新增?<partition>");
                            sb.Append(s_SRC_LOCATE_NO + "<partition_Detail>" + this.txt_down_RECOMMAND_LOCATION.ClientID + "<partition>");
                            sb.Append(i_DIS_ENABLE.ToString() + "<partition_Detail>" + this.hid_DIS_ENABLE.ClientID);
                            return sb.ToString();
                            #endregion
                        }
                    }

                    #endregion

                    if (sb.ToString() == string.Empty)
                    {
                        if (i_REQUEST_QTY > 100)
                        {
                            sb.Append("新增或編輯模式下異動欄位[訂貨量]<partition>");
                            sb.Append("TRUE_ALERT<partition>");
                            sb.Append("訂貨量大於100<partition>");
                            sb.Append(s_SRC_LOCATE_NO + "<partition_Detail>" + this.txt_down_RECOMMAND_LOCATION.ClientID + "<partition>");
                            sb.Append(i_DIS_ENABLE.ToString() + "<partition_Detail>" + this.hid_DIS_ENABLE.ClientID);

                            return sb.ToString();
                        }
                        else
                        {
                            sb.Append("新增或編輯模式下異動欄位[訂貨量]<partition>");
                            sb.Append("TRUE_NO_ALERT<partition>");
                            sb.Append(s_SRC_LOCATE_NO + "<partition_Detail>" + this.txt_down_RECOMMAND_LOCATION.ClientID + "<partition>");
                            sb.Append(i_DIS_ENABLE.ToString() + "<partition_Detail>" + this.hid_DIS_ENABLE.ClientID);

                            return sb.ToString();
                        }
                    }
                }

                #endregion

                #region 新增或編輯模式按下明細區[取消]鈕

                else if (s_Client_String[0] == "新增或編輯模式按下明細區[取消]鈕")
                {
                    #region 清空靜態變數

                    dtStock = null;//異動欄位[期別]
                    s_PMA = string.Empty;//大分類(異動欄位[品號/品名])
                    s_ROOT_NO = string.Empty;//群分類(異動欄位[品號/品名])
                    s_SRC_LOCATE_TYPE = string.Empty;//建議儲區類別(異動欄位[訂貨量])
                    sb.Remove(0, sb.Length);

                    #endregion

                    #region 計算 dt_Detail 的筆數

                    int i_dt_Detail_Count = 0;
                    if (dt_Detail != null)
                    {
                        if (dt_Detail.GetChanges(DataRowState.Deleted) == null)
                        { i_dt_Detail_Count = dt_Detail.Rows.Count; }
                        else
                        { i_dt_Detail_Count = dt_Detail.Rows.Count - dt_Detail.GetChanges(DataRowState.Deleted).Rows.Count; }
                    }

                    #endregion

                    sb.Append("新增或編輯模式按下明細區[取消]鈕<partition>");
                    sb.Append(i_dt_Detail_Count.ToString() + "<partition>");//dt_Detail的筆數
                    sb.Append(this.hid_PageStatus.ClientID + "<partition>");//hid_PageStatus
                    sb.Append(this.panel_Down_AddDetail.ClientID + "<partition>");//panel_Down_AddDetail
                    sb.Append(this.panel_Down_Button.ClientID + "<partition>");//panel_Down_Button
                    sb.Append(chk_down_IS_OVERDUE.ClientID + "<partition>");//逾期客訂
                    sb.Append(this.txt_down_PO_SOURCE_NO.ClientID + "<partition>");//PO單號
                    sb.Append(this.txt_down_BARCODE.ClientID + "<partition>");//一段碼
                    sb.Append(this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");//二段碼
                    sb.Append(txt_down_ITEM.ClientID + "<partition>");//品號
                    sb.Append(txt_down_ITEM_NAME.ClientID + "<partition>");//品名
                    sb.Append(this.txt_down_PERIOD.ClientID + "<partition>");//期別
                    sb.Append(txt_down_REQUEST_QTY.ClientID + "<partition>");//訂貨量
                    //sb.Append(txt_down_REQUEST_QTY_NAME.ClientID + "<partition>");//訂貨量名稱
                    sb.Append(txt_down_RTN_DDL.ClientID + "<partition>");//退書截止日
                    sb.Append(this.txt_down_RECOMMAND_LOCATION.ClientID + "<partition>");//建議儲區
                    sb.Append(txt_up_CHAN_NO.ClientID + "<partition>");//通路
                    sb.Append(txt_up_STORE.ClientID + "<partition>");//門市
                    sb.Append(txt_up_Z_O.ClientID + "<partition>");//營業所
                    sb.Append(txt_up_BUSDATE.ClientID + "<partition>");//訂單日期
                    sb.Append(txt_up_SALE_ID.ClientID + "<partition>");//營業人員
                    sb.Append(txt_up_BUSUID.ClientID + "<partition>");//訂單維護者
                    sb.Append(((DropDownList)((ASP.sys_slp_slp_enumbase_ascx)drop_up_ORDER_TYPE).FindControl("D1")).ClientID + "<partition>");//訂單來源
                    sb.Append(this.txt_up_PO_SOURCE_NO.ClientID + "<partition>");//PO單號預設
                    sb.Append(this.txt_up_CODE.ClientID + "<partition>");//訂單編號
                    sb.Append(this.txt_up_CRM_NO.ClientID + "<partition>");//流水編號
                    sb.Append(img_up_CHAN_NO.ClientID + "<partition>");//通路img
                    sb.Append(img_up_STORE.ClientID + "<partition>");//門市img
                    sb.Append(img_up_BUSDATE.ClientID + "<partition>");//訂單日期img
                    sb.Append(img_up_SALE_ID.ClientID + "<partition>");//營業人員img
                    sb.Append(img_up_BUSUID.ClientID);//訂單維護者img
                }

                #endregion

                #region 新增或編輯模式按下GridView[編輯]鈕


                else if (s_Client_String[0] == "新增或編輯模式按下GridView[編輯]鈕")
                {
                    DataRow dRow = dt_Detail.Select("ID = " + s_Client_String[1])[0];
                    string s_IS_OVERDUE;
                    //改為已擷轉仍可修改 
                    //if (dRow["TRANS_RESULT"].ToString() == "1")//已擷轉
                    //{ sb.Append("此筆訂單品項已擷轉,不可編輯或刪除\r\n"); }

                    if (dRow["STATUS"].ToString() == "75")//已結案
                    { sb.Append("此筆訂單品項已結案,不可編輯或刪除\r\n"); }

                    #region 編輯前檢查錯誤


                    if (sb.ToString() != string.Empty)
                    {
                        sb.Insert(0, "新增或編輯模式按下GridView[編輯]鈕_編輯前檢查FALSE<partition>");
                        return sb.ToString();
                    }

                    #endregion

                    #region 取得庫存
                    i_Curr_Order_Qty = 0;
                    s_ROOT_NO = dRow["ROOT_NO"].ToString(); //群分類
                    s_ITEM = dRow["ITEM"].ToString();    //品號
                    s_PERIOD = dRow["PERIOD"].ToString();  //期別
                    i_Curr_Order_Qty = (dRow["REQUEST_QTY"].ToString().Trim() == string.Empty) ? 0 : int.Parse(dRow["REQUEST_QTY"].ToString().Trim());
                    s_SRC_LOCATE_NO = dRow["SRC_LOCATE_NO"].ToString();//原儲區
                    //取得目前庫存
                    dtStock = null;
                    GetStock(s_ROOT_NO, s_ITEM, s_PERIOD);
                    //編輯模式下,可用庫存應加上原訂單需求量
                    AddStockForEditMode(s_SRC_LOCATE_NO, i_Curr_Order_Qty);
                    #endregion

                    #region 編輯前檢查正確
                    s_IS_OVERDUE = (dRow["IS_OVERDUE"].ToString() == "0") ? "false" : "true";

                    sb.Append("新增或編輯模式按下GridView[編輯]鈕_編輯前檢查TRUE<partition>");
                    sb.Append(txt_up_CHAN_NO.ClientID + "<partition>");//通路
                    sb.Append(txt_up_STORE.ClientID + "<partition>");//門市

                    sb.Append(txt_down_ITEM.ClientID + "<partition>");//品號
                    sb.Append(this.txt_down_PERIOD.ClientID + "<partition>");//期別
                    sb.Append(this.txt_down_BARCODE.ClientID + "<partition>");//一段碼
                    sb.Append(this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");//二段碼

                    sb.Append(txt_down_RTN_DDL.ClientID + "<partition>");//退書截止日
                    sb.Append(this.panel_Down_AddDetail.ClientID + "<partition>");//panel_Down_AddDetail
                    sb.Append(this.panel_Down_Button.ClientID + "<partition>");//panel_Down_Button
                    sb.Append(s_IS_OVERDUE + "<partition_Detail>" + chk_down_IS_OVERDUE.ClientID + "<partition>");//逾期客訂
                    sb.Append(dRow["PO_SOURCE_NO"].ToString() + "<partition_Detail>" + this.txt_down_PO_SOURCE_NO.ClientID + "<partition>");//PO單號
                    sb.Append(dRow["BARCODE"].ToString() + "<partition_Detail>" + this.txt_down_BARCODE.ClientID + "<partition>");//一段碼
                    sb.Append(dRow["PERIOD_BARCODE"].ToString() + "<partition_Detail>" + this.txt_down_PERIOD_BARCODE.ClientID + "<partition>");//二段碼

                    sb.Append(dRow["ITEM"].ToString() + "<partition_Detail>" + txt_down_ITEM.ClientID + "<partition>");//品號
                    sb.Append(dRow["ITEM_NAME"].ToString() + "<partition_Detail>" + txt_down_ITEM_NAME.ClientID + "<partition>");//品名
                    sb.Append(dRow["PERIOD"].ToString() + "<partition_Detail>" + this.txt_down_PERIOD.ClientID + "<partition>");//期別
                    sb.Append(dRow["REQUEST_QTY"].ToString() + "<partition_Detail>" + txt_down_REQUEST_QTY.ClientID + "<partition>");//訂貨量

                    //sb.Append(dRow["REQUEST_QTY"].ToString() + ".0000<partition_Detail>" + txt_down_REQUEST_QTY_NAME.ClientID + "<partition>");//訂貨量名稱

                    sb.Append(DateTime.Parse(dRow["RTN_DDL"].ToString()).ToString("yyyy/MM/dd") + "<partition_Detail>" + txt_down_RTN_DDL.ClientID + "<partition>");//退書截止日
                    sb.Append(dRow["SRC_LOCATE_NO"].ToString() + "<partition_Detail>" + this.txt_down_RECOMMAND_LOCATION.ClientID + "<partition>");//建議儲區
                    sb.Append(dRow["ID"].ToString() + "<partition_Detail>" + this.hid_ID.ClientID);//hid_ID

                    #endregion
                }

                #endregion

                #region 新增或編輯模式按下明細區[新增明細]鈕

                else if (s_Client_String[0] == "新增或編輯模式按下明細區[新增明細]鈕")
                {
                    #region 清空靜態變數

                    dtStock = null;//異動欄位[期別]
                    s_PMA = string.Empty;//大分類(異動欄位[品號/品名])
                    s_ROOT_NO = string.Empty;//群分類(異動欄位[品號/品名])
                    s_SRC_LOCATE_TYPE = string.Empty;//建議儲區類別(異動欄位[訂貨量])

                    #endregion
                }

                #endregion

                #region 新增模式異動欄位[流水編號]

                else if (s_Client_String[0] == "新增模式異動欄位[流水編號]")
                {
                    #region 檢查是否為有效流水編號


                    DataTable dt_Return = new DataTable();

                    ParameterList.Clear();
                    ParameterList.Add(s_Client_String[1]);//流水編號
                    ParameterList.Add(Session["UID"].ToString());
                    ParameterList.Add(DateTime.Now);

                    BCO.RecordCRMRecord bco = new BCO.RecordCRMRecord(ConntionDB);
                    dt_Return = bco.QueryCRMRecordByCode_CheckExist(ParameterList);

                    if (dt_Return.Rows.Count == 0)
                    {
                        sb.Append("新增模式異動欄位[流水編號]<partition>");
                        sb.Append("FALSE<partition>");
                        sb.Append(this.txt_up_CRM_NO.ClientID + "<partition>");
                        sb.Append("[流水編號]不為存在的有效編號");
                    }

                    #endregion
                }

                #endregion

                CallBackValue = sb.ToString();
            }
            catch (Exception ex)
            { CallBackValue = "發生例外錯誤<partition>" + ex.Message; }
        }

        return CallBackValue;
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            this.ErrorMsgLabel.Text = string.Empty;
            this.RightMsgLabel.Text = string.Empty;

            if (!IsPostBack)
            {
                //寫入首次載入Page TimeStamp
                PageTimeStamp.Value = string.Format("{0}{1}{2}{3}{4}{5}",
                                                    DateTime.Now.Year.ToString(),
                                                    DateTime.Now.Month.ToString().PadLeft(2, '0'),
                                                    DateTime.Now.Day.ToString().PadLeft(2, '0'),
                                                    DateTime.Now.Hour.ToString().PadLeft(2, '0'),
                                                    DateTime.Now.Minute.ToString().PadLeft(2, '0'),
                                                    DateTime.Now.Second.ToString().PadLeft(2, '0')
                                                    );
                Initialization_Component();//設定GridView預設的狀態
                ToolBarInit();

                // 移到最前面加 client event 
                #region Attributes

                TextBox txt_Up_CHAN_NO = (TextBox)this.slp_Up_CHAN_NO.FindControl("TextBoxCode");//上方通路
                TextBox txt_STORE = (TextBox)this.slp_STORE.FindControl("TextBoxCode");//上方門市
                TextBox txt_up_BUSDATE = (TextBox)((ASP.wui_slp_slp_slpdate_ascx)slp_Up_BUSDATE).FindControl("TextBoxCode");//來電日期
                //TextBox txt_up_ANSWER_TIME = (TextBox)((ASP.wui_slp_slp_time_ascx)txt_ANSWER_TIME).FindControl("TextBoxCode");//回答時間
                TextBox txt_up_ANSWER_TIME = (TextBox)(FinfControlEx(this.txt_ANSWER_TIME, "TextBoxCode"));

                this.but_Up_Insert.Attributes.Add("onclick", "but_Click_Begin('" + this.but_Up_Insert.UniqueID + "');");
                this.but_Up_Query.Attributes.Add("onclick", "but_Click_Begin('" + this.but_Up_Query.UniqueID + "');");
                this.but_Up_Save.Attributes.Add("onclick", "  ('" + this.but_Up_Save.UniqueID + "');");
                this.but_Up_Delete.OnClientClick = "return but_Click_Begin_For_Delete('" + this.but_Up_Delete.UniqueID + "','確認要刪除?');";
                this.but_Up_Edit.Attributes.Add("onclick", "but_Click_Begin('" + this.but_Up_Edit.UniqueID + "');");
                //this.but_Up_Cancel.Attributes.Add("onclick", "but_Click_Begin('" + this.but_Up_Cancel.UniqueID + "');");
                this.but_Down_Query.Attributes.Add("onclick", "but_Click_Begin('" + this.but_Down_Query.UniqueID + "');");
                this.but_Down_Record_Three.Attributes.Add("onclick", "but_Click_Begin('" + this.but_Down_Record_Three.UniqueID + "');");
                // 增加 電話/傳真不可輸入數字以外的字元
                this.txt_STORE_TEL_AREA.Attributes["onkeypress"] += String.Format(@"return check_intkey({0});", this.txt_STORE_TEL_AREA.ClientID);
                this.txt_STORE_TEL_NO.Attributes["onkeypress"] += String.Format(@"return check_intkey({0});", this.txt_STORE_TEL_NO.ClientID);
                this.txt_STORE_FAX_AREA.Attributes["onkeypress"] += String.Format(@"return check_intkey({0});", this.txt_STORE_FAX_AREA.ClientID);
                this.txt_STORE_FAX_NO.Attributes["onkeypress"] += String.Format(@"return check_intkey({0});", this.txt_STORE_FAX_NO.ClientID);

                //this.txt_DEAL_CONTENT.Attributes["onkeypress"] += String.Format(@"return limit_length({0},{1});", this.txt_DEAL_CONTENT.ClientID, this.txt_DEAL_CONTENT.MaxLength);
                //this.txt_STORE_ADDRESS.Attributes["onkeypress"] += String.Format(@"return limit_length({0},{1});", this.txt_STORE_ADDRESS.ClientID, this.txt_STORE_ADDRESS.MaxLength);


                //this.txt_CODE.Attributes.Add("onblur", "Check_Code('輸入字串不符合流水編號格式!');");
                this.txt_CODE.Attributes["onblur"] += "Check_Code('輸入字串不符合流水編號格式!');";
                this.Form.Attributes.Add("onkeypress", "return WebForm_FireDefaultButton_Self();");//預設系統功能鍵

                #region AJAX 設定通路 & 設定參考門市資料

                string strJs;
                // 2009-07-21 cyhsu mark 改由JS呼叫隱藏button.click取代
                //strJs = "if (document.getElementById('" + txt_Up_CHAN_NO.ClientID + "').value != '') " +
                //        "{ __doPostBack(document.all['" + up_Master.ClientID + "'].id,'txt_Up_CHAN_NO_Onblur'); " +
                //        "} if (" + this.slp_Z_O.TextBox_Code.ClientID + " != null) { " +
                //                  this.slp_Z_O.TextBox_Code.ClientID + ".select(); " +
                //                  this.slp_Z_O.TextBox_Code.ClientID + ".focus();} ";


                //txt_Up_CHAN_NO.Attributes["onblur"] += strJs;
                //strJs = "if (document.getElementById('" + txt_STORE.ClientID + "').value != '') " + 
                //        "{__doPostBack(document.all['" + up_Master.ClientID + "'].id,'txt_STORE_Onblur');" +
                //        "} if (" + this.slp_Up_CHAN_NO.TextBox_Code.ClientID + " != null) { " +
                //                  this.slp_Up_CHAN_NO.TextBox_Code.ClientID + ".select(); " +
                //                  this.slp_Up_CHAN_NO.TextBox_Code.ClientID + ".focus();} ";
                //txt_STORE.Attributes["onblur"] += strJs;

                //txt_Up_CHAN_NO.Attributes["onblur"] += "__doPostBack(document.all['" + up_Master.ClientID + "'].id,'txt_Up_CHAN_NO_Onblur');";
                //txt_STORE.Attributes["onblur"] += "__doPostBack(document.all['" + up_Master.ClientID + "'].id,'txt_STORE_Onblur');";

                // 2009-07-21 cyhsu mark 改由JS呼叫隱藏button.click取代


                //+"if (document.getElementById('" + txt_Up_CHAN_NO.ClientID + "')!= null) " +
                // "{ document.getElementById('" + txt_Up_CHAN_NO.ClientID + "').select();" +
                // "  document.getElementById('" + txt_Up_CHAN_NO.ClientID + "').focus(); }";

                //        txt_STORE.Attributes.Add("onblur", @"
                //if(document.all['" + this.hid_Page_Status.ClientID + @"'].value == 'INSERT' ||
                //    document.all['" + this.hid_Page_Status.ClientID + @"'].value == 'QUERY')
                //{
                //    if(this.value != '')
                //    {CallServer_Store('門市<partition>' + this.value + '<partition>' + document.all['" + txt_Up_CHAN_NO.ClientID + @"'].value);}
                //}");

                //        txt_Up_CHAN_NO.Attributes.Add("onblur", @"
                //                if(document.all['" + this.hid_Page_Status.ClientID + @"'].value == 'INSERT' ||
                //                    document.all['" + this.hid_Page_Status.ClientID + @"'].value == 'QUERY')
                //                {
                //                    CallServer_Chan_No('通路<partition>' + this.value + '<partition>' + document.all['" + txt_STORE.ClientID + @"'].value);
                //                }");

                //       RegClientScript();

                #endregion


                #region 設定TabIndex
                this.slp_Up_CHAN_NO.TextBox_Code.TabIndex = 11;
                this.slp_Z_O.TextBox_Code.TabIndex = 12;
                this.txt_CODE.TabIndex = 13;
                this.slp_STORE.TextBox_Code.TabIndex = 14;
                txt_up_BUSDATE.TabIndex = 15;
                txt_up_ANSWER_TIME.TabIndex = 16;
                this.slp_SAL_ID.TextBox_Code.TabIndex = 17;
                this.slp_BUSUID.TextBox_Code.TabIndex = 18;
                this.txt_ROUTD_ID.TabIndex = 19;
                this.txt_ROUTD_STEP.TabIndex = 20;
                this.txt_STORE_TEL_AREA.TabIndex = 21;
                this.txt_STORE_TEL_NO.TabIndex = 22;
                this.txt_STORE_FAX_AREA.TabIndex = 23;
                this.txt_STORE_FAX_NO.TabIndex = 24;
                this.txt_STORE_ADDRESS.TabIndex = 25;
                this.chkbl_Detail.TabIndex = 26;
                this.txt_DEAL_CONTENT.TabIndex = 27;
                this.but_Up_Insert.TabIndex = 28;
                this.but_Up_Save.TabIndex = 29;
                this.but_Up_Query.TabIndex = 30;
                this.but_Up_Edit.TabIndex = 31;
                this.but_Up_Cancel.TabIndex = 32;
                this.but_Up_Delete.TabIndex = 33;
                #endregion

                #endregion


                #region 讀取客戶訊息資料

                GetCustomerMessage();

                #endregion

                #region 依照參數來設定哪一種模式的畫面

                if (Request["CRM011_CODE"] == null)
                {
                    #region 設定 Page_Status 狀態

                    //模式指定
                    string mode = "QUERY";
                    try { mode = Request["mode"].ToString(); }
                    catch { mode = "INSERT"; }

                    //權限控管
                    if (mode == "INSERT")
                        if (!CanCreate)
                            mode = "QUERY";
                    //該頁面共有4種狀態
                    //查詢 QUERY
                    //檢視 VIEW
                    //新增 INSERT
                    //編輯 EDIT

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

                    // todo : 為了在檢視模式下可以按新增按鈕,先用mode去判斷是否執行but_Up_Insert_Click
                    //        待調整 by cyhsu 2009.03.
                    if ((mode != "QUERY") && (mode != null))
                    {
                        if (mode == "INSERT")
                        {
                            but_Up_Insert_Click(null, null);
                        }
                    }
                    GetPageDefault();//設定各種模式預設值

                    #endregion
                }
                else
                {//代表是從查詢前三筆紀錄連過來的

                    #region 讀取 VDS_CRM_RECORD_MAIN 資料

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

                    ParameterList.Clear();
                    ParameterList.Add(Request["CRM011_CODE"].ToString());
                    ParameterList.Add(Session["UID"].ToString());
                    ParameterList.Add(DateTime.Now);

                    BCO.RecordCRMRecord bco_Main = new BCO.RecordCRMRecord(ConntionDB);
                    ds_Return = bco_Main.QueryCRMRecordByCode(ParameterList);

                    #endregion

                    #region 使用XML放置到前端資料

                    #region 將空白的資料做處理
                    GetDataSetBeforeSaveXML(ref ds_Return);
                    #endregion

                    xml_OLDData.InnerHtml = ds_Return.GetXml();

                    #endregion

                    #region 設定各個欄位

                    this.slp_Up_CHAN_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CHAN_NO"].ToString();//通路
                    this.slp_Z_O.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["Z_O"].ToString();//營業所
                    this.txt_CODE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CODE"].ToString();//流水編號
                    this.slp_STORE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["STORE"].ToString();//門市
                    this.slp_Up_BUSDATE.Text = ((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSDATE"]).ToShortDateString();//處理日期
                    this.txt_ANSWER_TIME.Text = ((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ANSWER_TIME"]).ToString("HH:mm");//接聽時間 yyyy/MM/dd HH:mm:ss
                    this.slp_SAL_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["SAL_ID"].ToString();//營業人員
                    this.slp_BUSUID.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSUID"].ToString();//處理人員
                    this.txt_ROUTD_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_ID"].ToString();//路線
                    this.txt_ROUTD_STEP.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_STEP"].ToString();//路順
                    this.txt_STORE_TEL_AREA.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_AREA"].ToString();//電話-區域號碼
                    this.txt_STORE_TEL_NO.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_NO"].ToString();//電話號碼
                    this.txt_STORE_FAX_AREA.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_AREA"].ToString();//傳真-區域號碼
                    this.txt_STORE_FAX_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_NO"].ToString();//傳真號碼
                    this.txt_STORE_ADDRESS.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_ADDRESS"].ToString();//地址
                    this.txt_DEAL_CONTENT.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["DEAL_CONTENT"].ToString();//處理內容

                    foreach (DataRow dRow in ds_Return.Tables["VDS_CRM_RECORD_DETL"].Rows)
                    {
                        chkbl_Detail.Items.FindByValue(dRow["ONLINE_NO"].ToString()).Selected = true;
                    }

                    #endregion

                    #region 設定 Page_Status 狀態

                    //該頁面共有4種狀態

                    //查詢 QUERY
                    //檢視 VIEW
                    //新增 INSERT
                    //編輯 EDIT

                    this.hid_Page_Status.Value = "VIEW";
                    this.txt_Page_Status.Text = "VIEW";
                    GetPageDefault();//設定各種模式預設值


                    #endregion
                }

                #endregion
            }
            else
            {

                //if (Request.Form["__EVENTARGUMENT"] == "txt_STORE_Onblur")
                //    txt_STORE_Onblur();
                //if (Request.Form["__EVENTARGUMENT"] == "txt_Up_CHAN_NO_Onblur")
                //{
                //    txt_Up_CHAN_NO_Onblur();
                //}
                //else if (Request.Form["__EVENTARGUMENT"] == "txt_STORE_Onblur")
                //    txt_STORE_Onblur();


            }

            #region ToolBar 設定

            //WUI_GMToolbarV uc = (WUI_GMToolbarV)this.GMToolbar1;
            //uc.Btn_Find += new WUI_GMToolbarV.UCDelegate(this.UC_Find);
            //uc.Btn_New += new WUI_GMToolbarV.UCDelegate(this.UC_New);
            //uc.Btn_Edit += new WUI_GMToolbarV.UCDelegate(this.UC_Edit);
            //uc.Btn_Save += new WUI_GMToolbarV.UCDelegate(this.UC_Save);
            //uc.Btn_Delete += new WUI_GMToolbarV.UCDelegate(this.UC_Delete);
            //uc.Btn_FindExport += new WUI_GMToolbarV.UCDelegate(UC_Export);
            //uc.Btn_Copy += new WUI_GMToolbarV.UCDelegate(UC_Copy);

            #endregion

        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {
            AuthorityControls(this);
        }
    }
Exemplo n.º 3
0
    /// <summary>
    /// 流水編號
    /// </summary>
    /// <param name="strUserID"></param>
    /// <param name="strPageTimeStamp"></param>
    /// <param name="strOtherParam"></param>
    /// <returns></returns>
    private string GetValueByPageMethod_CHECKCRMNO(string strUserID, string strPageTimeStamp, string strOtherParam)
    {
        #region
        string strRtn = "", strTemp1 = "";
        try
        {
            #region

            #region 檢查是否為有效流水編號

            DataTable dt_Return = new DataTable();
            ParameterList.Clear();
            ParameterList.Add(strOtherParam);//流水編號
            ParameterList.Add(strUserID);
            ParameterList.Add(DateTime.Now);

            BCO_CRM.RecordCRMRecord BCO = new BCO_CRM.RecordCRMRecord(ConntionDB);
            dt_Return = BCO.QueryCRMRecordByCode_CheckExist(ParameterList);
            BCO.CloseConnection();

            if (dt_Return == null || dt_Return.Rows.Count == 0)
            {
                #region

                strTemp1 = string.Format("[流水編號]不為存在的有效編號");

                #endregion
            }

            #endregion

            #endregion
        }
        catch (Exception ex)
        {
            throw ex;
        }

        return strRtn = string.Format("{0}", strTemp1);
        #endregion
    }
Exemplo n.º 4
0
    /// <summary>
    /// BUTTON 上面的編輯鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_Up_Edit_Click(object sender, EventArgs e)
    {
        #region
        //System.Threading.Thread.Sleep(2000);
        try
        {
            if (this.hid_Page_Status.Value == "VIEW")
            {
                #region 檢查必填欄位

                if (this.txt_CODE.Text.Trim() == string.Empty)
                {
                    System.Web.UI.ScriptManager.RegisterStartupScript(this.up_Button, this.GetType(), "TO_CRM011.aspx", "alert('\"流水編號\"不可為空白')", true);
                    return;
                }

                #endregion

                #region 查詢結果,根據畫面上"流水編號"這一個欄位


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

                ParameterList.Clear();
                ParameterList.Add(this.txt_CODE.Text.Trim());
                ParameterList.Add(Session["UID"].ToString());
                ParameterList.Add(DateTime.Now);

                BCO.RecordCRMRecord bco = new BCO.RecordCRMRecord(ConntionDB);
                ds_Return = bco.QueryCRMRecordByCode(ParameterList);

                #endregion

                #region 使用XML放置到前端資料

                #region 將空白的資料做處理
                GetDataSetBeforeSaveXML(ref ds_Return);
                #endregion


                xml_OLDData.InnerHtml = ds_Return.GetXml();

                #endregion

                #region 設定各個欄位

                this.slp_Up_CHAN_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CHAN_NO"].ToString();//通路
                this.slp_Z_O.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["Z_O"].ToString();//營業所
                this.txt_CODE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CODE"].ToString();//流水編號
                this.slp_STORE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["STORE"].ToString();//門市

                this.slp_Up_BUSDATE.Text = ((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSDATE"]).ToShortDateString();//處理日期
                this.txt_ANSWER_TIME.Text = ((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ANSWER_TIME"]).ToString("HH:mm");//接聽時間 yyyy/MM/dd HH:mm:ss
                this.slp_SAL_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["SAL_ID"].ToString();//營業人員
                this.slp_BUSUID.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSUID"].ToString();//處理人員
                this.txt_ROUTD_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_ID"].ToString();//路線
                this.txt_ROUTD_STEP.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_STEP"].ToString();//路順
                this.txt_STORE_TEL_AREA.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_AREA"].ToString();//電話-區域號碼

                this.txt_STORE_TEL_NO.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_NO"].ToString();//電話號碼
                this.txt_STORE_FAX_AREA.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_AREA"].ToString();//傳真-區域號碼

                this.txt_STORE_FAX_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_NO"].ToString();//傳真號碼
                this.txt_STORE_ADDRESS.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_ADDRESS"].ToString();//地址
                this.txt_DEAL_CONTENT.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["DEAL_CONTENT"].ToString();//處理內容

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

                foreach (DataRow dRow in ds_Return.Tables["VDS_CRM_RECORD_DETL"].Rows)
                { chkbl_Detail.Items.FindByValue(dRow["ONLINE_NO"].ToString()).Selected = true; }

                #endregion

                #region 設定頁面模式

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

                #endregion

                #region 設定各欄位模式ReadOnly

                this.slp_Up_CHAN_NO.ReadOnly = true;
                this.slp_Z_O.ReadOnly = true;
                this.txt_CODE.ReadOnly = true;
                this.txt_CODE.CssClass = "readtxtbox";
                this.slp_STORE.ReadOnly = true;
                this.slp_Up_BUSDATE.ReadOnly = true;
                this.txt_ANSWER_TIME.ReadOnly = true;
                this.slp_SAL_ID.ReadOnly = true;
                this.slp_BUSUID.ReadOnly = true;
                this.txt_ROUTD_ID.ReadOnly = true;
                this.txt_ROUTD_ID.CssClass = "readtxtbox";
                this.txt_ROUTD_STEP.ReadOnly = true;
                this.txt_ROUTD_STEP.CssClass = "readtxtbox";
                this.txt_STORE_TEL_AREA.ReadOnly = true;
                this.txt_STORE_TEL_AREA.CssClass = "readtxtbox";
                this.txt_STORE_TEL_NO.ReadOnly = true;
                this.txt_STORE_TEL_NO.CssClass = "readtxtbox";
                this.txt_STORE_FAX_AREA.ReadOnly = true;
                this.txt_STORE_FAX_AREA.CssClass = "readtxtbox";
                this.txt_STORE_FAX_NO.ReadOnly = true;
                this.txt_STORE_FAX_NO.CssClass = "readtxtbox";
                this.txt_STORE_ADDRESS.ReadOnly = true;
                this.txt_STORE_ADDRESS.CssClass = "readtxtbox";
                this.txt_DEAL_CONTENT.ReadOnly = false;
                this.txt_DEAL_CONTENT.CssClass = "";
                this.chkbl_Detail.Enabled = true;
                #endregion
            }
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
        finally { GetPageDefault(); }
        #endregion
    }
Exemplo n.º 5
0
    private void QueryRecordMainFromToolbar(string s_Code, BrowseType bt)
    {
        #region

        try
        {

            BCO.RecordCRMRecord bco = new BCO.RecordCRMRecord(ConntionDB);
            ArrayList ParameterList = new ArrayList();


            #region 查詢指定之CODE
            ParameterList.Clear();
            ParameterList.Add(txt_CODE.Text);
            ParameterList.Add(slp_STORE.Text);
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add(bt.ToString());
            string strCodeWanted = "";
            strCodeWanted = bco.QueryRecordMainByTool(ParameterList);
            #endregion

            #region 查詢條件設定
            ParameterList.Clear();
            ParameterList.Add(null);
            ParameterList.Add(strCodeWanted);
            ParameterList.Add(null);
            ParameterList.Add(null);
            ParameterList.Add(null);
            ParameterList.Add(null);
            ParameterList.Add(null);
            ParameterList.Add(null);
            ParameterList.Add(null);
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add(DateTime.Now);
            #endregion

            #region 取得查詢資料

            DataSet ds_Return = new DataSet();

            ds_Return = bco.QueryCRMRecordByFind2(ParameterList);

            if (ds_Return.Tables.Count == 0)
            {//沒查到資料

                System.Web.UI.ScriptManager.RegisterStartupScript(this.up_Button, this.GetType(), "TO_CRM011.aspx", "alert('查無資料')", true);

                #region 設定頁面模式

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

                #endregion

                return;
            }
            else
            {//有查到資料

                #region 使用XML放置到前端資料

                #region 將空白的資料做處理
                GetDataSetBeforeSaveXML(ref ds_Return);
                #endregion


                xml_OLDData.InnerHtml = ds_Return.GetXml();

                #endregion

                #region 設定各個欄位


                this.slp_Up_CHAN_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CHAN_NO"].ToString();//通路
                this.slp_Z_O.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["Z_O"].ToString();//營業所
                this.txt_CODE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CODE"].ToString();//流水編號
                this.slp_STORE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["STORE"].ToString();//門市

                this.slp_Up_BUSDATE.Text = ((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSDATE"]).ToShortDateString();//處理日期
                this.txt_ANSWER_TIME.Text = ((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ANSWER_TIME"]).ToString("HH:mm");//接聽時間 yyyy/MM/dd HH:mm:ss
                this.slp_SAL_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["SAL_ID"].ToString();//營業人員
                this.slp_BUSUID.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSUID"].ToString();//處理人員
                this.txt_ROUTD_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_ID"].ToString();//路線
                this.txt_ROUTD_STEP.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_STEP"].ToString();//路順
                this.txt_STORE_TEL_AREA.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_AREA"].ToString();//電話-區域號碼

                this.txt_STORE_TEL_NO.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_NO"].ToString();//電話號碼
                this.txt_STORE_FAX_AREA.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_AREA"].ToString();//傳真-區域號碼

                this.txt_STORE_FAX_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_NO"].ToString();//傳真號碼
                this.txt_STORE_ADDRESS.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_ADDRESS"].ToString();//地址
                this.txt_DEAL_CONTENT.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["DEAL_CONTENT"].ToString();//處理內容

                foreach (DataRow dRow in ds_Return.Tables["VDS_CRM_RECORD_DETL"].Rows)
                {
                    chkbl_Detail.Items.FindByValue(dRow["ONLINE_NO"].ToString()).Selected = true;
                }

                #endregion

                #region 設定頁面模式

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

                #endregion

                #region 設定各欄位模式ReadOnly

                this.slp_Up_CHAN_NO.ReadOnly = true;
                this.slp_Z_O.ReadOnly = true;
                this.txt_CODE.ReadOnly = true;
                this.txt_CODE.CssClass = "readtxtbox";
                this.slp_STORE.ReadOnly = true;
                this.slp_Up_BUSDATE.ReadOnly = true;
                this.txt_ANSWER_TIME.ReadOnly = true;
                this.slp_SAL_ID.ReadOnly = true;
                this.slp_BUSUID.ReadOnly = true;
                this.txt_ROUTD_ID.ReadOnly = true;
                this.txt_ROUTD_ID.CssClass = "readtxtbox";
                this.txt_ROUTD_STEP.ReadOnly = true;
                this.txt_ROUTD_STEP.CssClass = "readtxtbox";
                this.txt_STORE_TEL_AREA.ReadOnly = true;
                this.txt_STORE_TEL_AREA.CssClass = "readtxtbox";
                this.txt_STORE_TEL_NO.ReadOnly = true;
                this.txt_STORE_TEL_NO.CssClass = "readtxtbox";
                this.txt_STORE_FAX_AREA.ReadOnly = true;
                this.txt_STORE_FAX_AREA.CssClass = "readtxtbox";
                this.txt_STORE_FAX_NO.ReadOnly = true;
                this.txt_STORE_FAX_NO.CssClass = "readtxtbox";
                this.txt_STORE_ADDRESS.ReadOnly = true;
                this.txt_STORE_ADDRESS.CssClass = "readtxtbox";
                this.txt_DEAL_CONTENT.ReadOnly = true;
                this.txt_DEAL_CONTENT.CssClass = "readtxtbox";
                this.chkbl_Detail.Enabled = false;

                #endregion

            }

            #endregion

        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        finally
        {
            GetPageDefault();
        }
        #endregion
    }
Exemplo n.º 6
0
    private void QueryDataAndSetControls()
    {
        #region
        BCO.RecordCRMRecord bco = new BCO.RecordCRMRecord(ConntionDB);
        ArrayList ParameterList = new ArrayList();

        #region 根據回傳的 ID,將資料從 DATABASE 中取出


        DataSet ds_Return = new DataSet();

        Int32 i_ID;
        Int32.TryParse(s_ID, out i_ID);

        ParameterList.Clear();
        ParameterList.Add(i_ID);
        ParameterList.Add(Session["UID"].ToString());
        ParameterList.Add(DateTime.Now);
        ds_Return = bco.QueryCRMRecordByID(ParameterList);


        #endregion

        #region 使用XML放置到前端資料

        #region 將空白的資料做處理
        GetDataSetBeforeSaveXML(ref ds_Return);
        #endregion

        xml_OLDData.InnerHtml = ds_Return.GetXml();

        #endregion

        #region 設定各個欄位的預設值

        this.slp_Up_CHAN_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CHAN_NO"].ToString();//通路
        this.slp_Z_O.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["Z_O"].ToString();//營業所
        this.txt_CODE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CODE"].ToString();//流水編號
        this.slp_STORE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["STORE"].ToString();//門市

        this.slp_Up_BUSDATE.Text = ((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSDATE"]).ToShortDateString();//處理日期
        this.txt_ANSWER_TIME.Text = ((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ANSWER_TIME"]).ToString("HH:mm");//接聽時間 yyyy/MM/dd HH:mm:ss
        this.slp_SAL_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["SAL_ID"].ToString();//營業人員
        this.slp_BUSUID.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSUID"].ToString();//處理人員
        this.txt_ROUTD_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_ID"].ToString();//路線
        this.txt_ROUTD_STEP.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_STEP"].ToString();//路順
        this.txt_STORE_TEL_AREA.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_AREA"].ToString();//電話-區域號碼

        this.txt_STORE_TEL_NO.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_NO"].ToString();//電話號碼
        this.txt_STORE_FAX_AREA.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_AREA"].ToString();//傳真-區域號碼

        this.txt_STORE_FAX_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_NO"].ToString();//傳真號碼
        this.txt_STORE_ADDRESS.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_ADDRESS"].ToString();//地址
        this.txt_DEAL_CONTENT.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["DEAL_CONTENT"].ToString();//處理內容

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

        foreach (DataRow dRow in ds_Return.Tables["VDS_CRM_RECORD_DETL"].Rows)
        { chkbl_Detail.Items.FindByValue(dRow["ONLINE_NO"].ToString()).Selected = true; }

        #endregion

        #region 設定各欄位模式ReadOnly

        this.slp_Up_CHAN_NO.ReadOnly = true;
        this.slp_Z_O.ReadOnly = true;
        this.txt_CODE.ReadOnly = true;
        this.txt_CODE.CssClass = "readtxtbox";
        this.slp_STORE.ReadOnly = true;
        this.slp_Up_BUSDATE.ReadOnly = true;
        this.txt_ANSWER_TIME.ReadOnly = true;
        this.slp_SAL_ID.ReadOnly = true;
        this.slp_BUSUID.ReadOnly = true;
        this.txt_ROUTD_ID.ReadOnly = true;
        this.txt_ROUTD_ID.CssClass = "readtxtbox";
        this.txt_ROUTD_STEP.ReadOnly = true;
        this.txt_ROUTD_STEP.CssClass = "readtxtbox";
        this.txt_STORE_TEL_AREA.ReadOnly = true;
        this.txt_STORE_TEL_AREA.CssClass = "readtxtbox";
        this.txt_STORE_TEL_NO.ReadOnly = true;
        this.txt_STORE_TEL_NO.CssClass = "readtxtbox";
        this.txt_STORE_FAX_AREA.ReadOnly = true;
        this.txt_STORE_FAX_AREA.CssClass = "readtxtbox";
        this.txt_STORE_FAX_NO.ReadOnly = true;
        this.txt_STORE_FAX_NO.CssClass = "readtxtbox";
        this.txt_STORE_ADDRESS.ReadOnly = true;
        this.txt_STORE_ADDRESS.CssClass = "readtxtbox";
        this.txt_DEAL_CONTENT.ReadOnly = true;
        this.txt_DEAL_CONTENT.CssClass = "readtxtbox";
        #endregion


        //old:toolbar
        //CheckCurrentIndexAndSwitchNavigator(s_ID);


        #endregion
    }
Exemplo n.º 7
0
    /// <summary>
    /// BUTTON 上面的刪除鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_Up_Delete_Click(object sender, EventArgs e)
    {
        #region
        //System.Threading.Thread.Sleep(2000);
        try
        {
            if (this.hid_Page_Status.Value == "VIEW")
            {
                #region 使用XML轉回DataSet

                DataSet ds_OldData = new DataSet();
                System.IO.StringReader sr_OldData = new System.IO.StringReader(xml_OLDData.InnerHtml);
                ds_OldData.ReadXml(sr_OldData);

                #endregion

                #region 刪除資料
                ArrayList ParameterList = new ArrayList();//20091117

                ParameterList.Clear();
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ID"]);
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CODE"]);
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("NAME") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["NAME"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("BUSDATE") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSDATE"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("BUSUID") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSUID"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("CREATEDATE") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CREATEDATE"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("CREATEUID") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CREATEUID"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("UPDATEDATE") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["UPDATEDATE"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("UPDATEUID") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["UPDATEUID"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("STATUS") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["STATUS"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("ENABLE") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ENABLE"]); } else { ParameterList.Add(string.Empty); }
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CHAN_NO"]);
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["STORE"]);
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("ANSWER_TIME") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ANSWER_TIME"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("FAX_AREA") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_AREA"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("FAX_NO") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_NO"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("DEAL_CONTENT") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["DEAL_CONTENT"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("REQUEST_MAN") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["REQUEST_MAN"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("CRM_SOURCE") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CRM_SOURCE"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("STORE_GRADE") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["STORE_GRADE"]); } else { ParameterList.Add(string.Empty); }
                if (ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Columns.Contains("MAIL") == true) { ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["MAIL"]); } else { ParameterList.Add(string.Empty); }
                ParameterList.Add(Session["UID"].ToString());
                ParameterList.Add(DateTime.Now);

                BCO.RecordCRMRecord bco = new BCO.RecordCRMRecord(ConntionDB);
                bco.DeletCRMRecord(ParameterList, null, ds_OldData.Tables["VDS_CRM_RECORD_DETL"]);

                #endregion

                #region 設定各個欄位的預設值

                //Master
                this.slp_Up_CHAN_NO.Text = String.Empty;//通路
                this.slp_Z_O.Text = String.Empty;//營業所
                this.txt_CODE.Text = String.Empty;//流水編號
                this.slp_STORE.Text = String.Empty;//門市

                this.slp_Up_BUSDATE.Text = String.Empty;//處理日期
                this.txt_ANSWER_TIME.Text = String.Empty;//接聽時間
                this.slp_SAL_ID.Text = String.Empty;//營業人員
                this.slp_BUSUID.Text = String.Empty;//處理人員
                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
                foreach (ListItem li in this.chkbl_Detail.Items)
                {
                    li.Selected = false;
                }

                #endregion

                #region 設定頁面模式

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

                #endregion

                #region 設定各欄位模式ReadOnly

                this.slp_Up_CHAN_NO.ReadOnly = false;
                this.slp_Z_O.ReadOnly = false;
                this.txt_CODE.ReadOnly = false;
                this.txt_CODE.CssClass = "";
                this.slp_STORE.ReadOnly = false;
                this.slp_Up_BUSDATE.ReadOnly = false;
                this.txt_ANSWER_TIME.ReadOnly = false;
                this.slp_SAL_ID.ReadOnly = false;
                this.slp_BUSUID.ReadOnly = false;
                this.txt_ROUTD_ID.ReadOnly = false;
                this.txt_ROUTD_ID.CssClass = "";
                this.txt_ROUTD_STEP.ReadOnly = false;
                this.txt_ROUTD_STEP.CssClass = "";
                this.txt_STORE_TEL_AREA.ReadOnly = false;
                this.txt_STORE_TEL_AREA.CssClass = "";
                this.txt_STORE_TEL_NO.ReadOnly = false;
                this.txt_STORE_TEL_NO.CssClass = "";
                this.txt_STORE_FAX_AREA.ReadOnly = false;
                this.txt_STORE_FAX_AREA.CssClass = "";
                this.txt_STORE_FAX_NO.ReadOnly = false;
                this.txt_STORE_FAX_NO.CssClass = "";
                this.txt_STORE_ADDRESS.ReadOnly = false;
                this.txt_STORE_ADDRESS.CssClass = "";
                this.txt_DEAL_CONTENT.ReadOnly = false;
                this.txt_DEAL_CONTENT.CssClass = "";

                #endregion

                System.Web.UI.ScriptManager.RegisterStartupScript(this.up_Button, this.GetType(), "TO_CRM011.aspx", "alert('刪除成功')", true);
            }
        }
        catch (Exception ex)
        { this.ErrorMsgLabel.Text = ex.Message; }
        finally
        { GetPageDefault(); }
        #endregion
    }
Exemplo n.º 8
0
    /// <summary>
    /// BUTTON 上面的存檔鈕
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_Up_Save_Click(object sender, EventArgs e)
    {
        #region
        //System.Threading.Thread.Sleep(2000);

        try
        {
            #region 檢查欄位

            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            if (this.slp_Up_CHAN_NO.Text.Trim() == string.Empty) { sb.Append("\"通路\"欄位尚未設定\\r\\n"); }
            if (this.slp_Z_O.Text.Trim() == string.Empty) { sb.Append("\"營業所\"欄位尚未設定\\r\\n"); }
            if (this.slp_STORE.Text.Trim() == string.Empty) { sb.Append("\"門市\"欄位尚未設定\\r\\n"); }
            if (this.slp_Up_BUSDATE.Text.Trim() == string.Empty) { sb.Append("\"處理日期\"欄位尚未設定\\r\\n"); }
            if (this.txt_ANSWER_TIME.Text.Trim() == string.Empty) { sb.Append("\"接聽時間\"欄位尚未設定\\r\\n"); }
            if (this.slp_SAL_ID.Text.Trim() == string.Empty) { sb.Append("\"營業人員\"欄位尚未設定\\r\\n"); }
            if (this.slp_BUSUID.Text.Trim() == string.Empty) { sb.Append("\"處理人員\"欄位尚未設定\\r\\n"); }
            // 2009-12-10 cyhsu :Insert 才檢查路線路順,因為歷史資料可能會沒有路線路順
            if (this.hid_Page_Status.Value == "INSERT")
            {
                if (this.txt_ROUTD_ID.Text.Trim() == string.Empty) { sb.Append("\"路線\"欄位尚未設定\\r\\n"); }
                if (this.txt_ROUTD_STEP.Text.Trim() == string.Empty) { sb.Append("\"路順\"欄位尚未設定\\r\\n"); }
            }
            if (this.txt_DEAL_CONTENT.Text.Trim() == string.Empty) { sb.Append("\"處理內容\"欄位尚未設定\\r\\n"); }
            if (this.chkbl_Detail.SelectedIndex == -1) { sb.Append("\"服務項目\"[線上加量-D儲區]~[退返品查詢]至少必須勾選一個項目"); }
            if (GetStringLen(txt_DEAL_CONTENT.Text) > 600) { sb.Append("\"處理內容\"欄位資料長度太長\\r\\n"); }

            if (sb.ToString() != string.Empty)
            {
                ScriptManager.RegisterStartupScript(this.up_Button, this.GetType(), "TO_CRM011.aspx", "alert('" + sb.ToString() + "')", true);

                #region 設定頁面模式

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

                #endregion

                return;
            }

            #endregion

            int i_Return_Id = 0;
            BCO.RecordCRMRecord bco = new BCO.RecordCRMRecord(ConntionDB);

            ArrayList ParameterList = new ArrayList();//20091117

            if (this.hid_Page_Status.Value == "INSERT")
            {
                #region 整理明細服務項目資料

                //取得 VDS_CRM_RECORD_DETL 的 SCHEMA
                //並將使用者選取資料放入 TEMP_TABLE

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

                DataTable dt_Detail = bco.QuerySwitch(BCO.RecordCRMRecord.QueryType.CRM011_DETL_SCHEMA, ParameterList);
                DateTime d_Date_Now = DateTime.Now;

                foreach (ListItem li in this.chkbl_Detail.Items)
                {
                    if (li.Selected == true)
                    {
                        DataRow dRow = dt_Detail.NewRow();
                        dRow["CREATEDATE"] = d_Date_Now;
                        dRow["CREATEUID"] = Session["UID"].ToString();
                        dRow["UPDATEDATE"] = d_Date_Now;
                        dRow["UPDATEUID"] = Session["UID"].ToString();
                        dRow["ONLINE_NO"] = li.Value;
                        dRow["FLAG"] = 1;

                        dt_Detail.Rows.Add(dRow);
                    }
                }

                #endregion

                #region 處理新增資料

                ParameterList.Clear();
                ParameterList.Add(DateTime.ParseExact(this.slp_Up_BUSDATE.Text, "yyyy/MM/dd", null));//BUSDATE
                ParameterList.Add(this.slp_BUSUID.Text.Trim());//BUSUID
                ParameterList.Add(d_Date_Now);//CREATEDATE
                ParameterList.Add(Session["UID"].ToString());//CREATEUID
                ParameterList.Add(d_Date_Now);//UPDATEDATE
                ParameterList.Add(Session["UID"].ToString());//UPDATEUID
                ParameterList.Add(1);//STATUS
                ParameterList.Add(1);//ENABLE
                ParameterList.Add(this.slp_Up_CHAN_NO.Text.Trim());//CHAN_NO
                ParameterList.Add(this.slp_STORE.Text.Trim());//STORE
                ParameterList.Add(DateTime.ParseExact(this.txt_ANSWER_TIME.Text.Substring(0, 2) + ":" + txt_ANSWER_TIME.Text.Substring(2).Trim(), "HH:mm", null));//ANSWER_TIME ,yyyy/MM/dd HH:mm:ss
                ParameterList.Add(this.txt_STORE_FAX_AREA.Text.Trim());//FAX_AREA
                ParameterList.Add(this.txt_STORE_FAX_NO.Text.Trim());//FAX_NO
                ParameterList.Add(this.txt_DEAL_CONTENT.Text.Trim());//DEAL_CONTENT
                ParameterList.Add(Session["UID"].ToString());//V_LOG_UPDATEUID
                ParameterList.Add(DateTime.Now);//D_LOG_UPDATEDATE

                i_Return_Id = bco.CreateCRMRecord(ParameterList, null, dt_Detail);

                #endregion
            }
            else if (this.hid_Page_Status.Value == "EDIT")
            {
                #region 整理明細服務項目資料

                DataSet ds_OldData = new DataSet();
                DateTime d_Date_Now = DateTime.Now;

                #region 使用XML轉回DataSet

                System.IO.StringReader sr_OldData = new System.IO.StringReader(xml_OLDData.InnerHtml);
                ds_OldData.ReadXml(sr_OldData);

                #endregion

                #region 新增一個欄位,記錄狀態


                DataColumn dColum = new DataColumn();
                dColum.ColumnName = "STATUS";
                dColum.DataType = System.Type.GetType("System.String");
                ds_OldData.Tables["VDS_CRM_RECORD_DETL"].Columns.Add(dColum);

                #endregion

                #region 比對ds_OldData檔與CheckBox的資料,如果ds_OldData有CheckBox沒有,則註記該筆資料被使用者刪除


                foreach (DataRow dRow in ds_OldData.Tables["VDS_CRM_RECORD_DETL"].Rows)
                {
                    if (this.chkbl_Detail.Items.FindByValue(dRow["ONLINE_NO"].ToString()).Selected == false)
                    { //如果使用者沒有勾選該筆資料,則將該筆資料從ds_OldData中移除

                        dRow["STATUS"] = "DELETE";
                    }
                }

                #endregion

                #region 比對CheckBox與ds_OldData檔的資料,如果CheckBox有ds_OldData沒有,則新增該筆資料進入ds_OldData,且註記該筆資料被使用者新增


                foreach (ListItem li in this.chkbl_Detail.Items)//畫面上使用者選的通路
                {
                    if (li.Selected == true)
                    {
                        DataView dv_Detail = new DataView();
                        dv_Detail.Table = ds_OldData.Tables["VDS_CRM_RECORD_DETL"].Copy();

                        dv_Detail.RowFilter = "ONLINE_NO = '" + li.Value + "'";

                        if (dv_Detail.Count == 0)
                        {
                            DataRow dRow_New = (DataRow)ds_OldData.Tables["VDS_CRM_RECORD_DETL"].NewRow();

                            dRow_New["CREATEDATE"] = d_Date_Now;
                            dRow_New["CREATEUID"] = Session["UID"].ToString();
                            dRow_New["UPDATEDATE"] = d_Date_Now;
                            dRow_New["UPDATEUID"] = Session["UID"].ToString();
                            dRow_New["ONLINE_NO"] = li.Value;
                            dRow_New["FLAG"] = 1;
                            dRow_New["STATUS"] = "ADD";

                            ds_OldData.Tables["VDS_CRM_RECORD_DETL"].Rows.Add(dRow_New);
                        }

                        dv_Detail.Dispose();
                    }//if
                }//foreach

                #endregion

                #endregion

                #region 處理更新資料

                ParameterList.Clear();
                //新資料

                ParameterList.Add(this.txt_DEAL_CONTENT.Text.Trim());
                ParameterList.Add(Session["UID"].ToString());
                ParameterList.Add(DateTime.Now);

                //舊資料

                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ID"]);
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CHAN_NO"]);
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CODE"]);
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["STORE"]);
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSDATE"]);
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ANSWER_TIME"]);
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSUID"]);
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_AREA"]);
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_NO"]);
                ParameterList.Add(ds_OldData.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["DEAL_CONTENT"]);

                i_Return_Id = bco.UpdateCRMRecord(ParameterList, null, ds_OldData.Tables["VDS_CRM_RECORD_DETL"]);

                #endregion
            }

            #region 新增 & 更新後處理


            if (i_Return_Id > 0)//代表新增或更新成功
            {

                ParameterList.Clear();
                ParameterList.Add(Session["UID"].ToString());
                aryParamsPKey = bco.QueryIDForBROWSER(ParameterList);

                s_ID = i_Return_Id.ToString();

                QueryDataAndSetControls();


                #region 設定 PageStatus & Button 狀態


                string s_Page_Status = string.Empty;
                s_Page_Status = this.hid_Page_Status.Value;

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

                #endregion

                if (s_Page_Status == "INSERT")
                {//在新增模式下按下"存檔"鈕

                    System.Web.UI.ScriptManager.RegisterStartupScript(this.up_Button, this.GetType(), "TO_CRM011.aspx", "alert('新增成功')", true);
                }
                else if (s_Page_Status == "EDIT")
                {//在編輯模式下按下"存檔"鈕

                    System.Web.UI.ScriptManager.RegisterStartupScript(this.up_Button, this.GetType(), "TO_CRM011.aspx", "alert('更新成功')", true);
                }
            }
            else
            {
                if (this.hid_Page_Status.Value == "INSERT")
                {//在新增模式下按下"存檔"鈕

                    System.Web.UI.ScriptManager.RegisterStartupScript(this.up_Button, this.GetType(), "TO_CRM011.aspx", "alert('新增失敗')", true);
                }
                else if (this.hid_Page_Status.Value == "EDIT")
                {//在編輯模式下按下"存檔"鈕

                    System.Web.UI.ScriptManager.RegisterStartupScript(this.up_Button, this.GetType(), "TO_CRM011.aspx", "alert('更新失敗')", true);
                }
            }

            #endregion
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
        finally { GetPageDefault(); }
        #endregion
    }
Exemplo n.º 9
0
    /// <summary>
    /// BUTTON 查詢前三筆紀錄

    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void but_Down_Record_Three_Click(object sender, EventArgs e)
    {
        try
        {
            #region 檢查條件

            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            if (this.slp_Up_CHAN_NO.Text.Trim() == string.Empty)
            { sb.Append("欄位[通路]為必填欄位<br/>"); }
            if (this.slp_STORE.Text.Trim() == string.Empty)
            { sb.Append("欄位[門市]為必填欄位<br/>"); }

            if (sb.ToString() != string.Empty)
            {
                this.ErrorMsgLabel.Text = sb.ToString();
                return;
            }

            #endregion

            #region 傳入參數

            BCO.CRMCommon CRMComm = new BCO.CRMCommon();

            ArrayList ParameterList = new ArrayList();//20091117

            ParameterList.Clear();
            ParameterList.Add(CRMComm.GetValueSetParameter(this.slp_Up_CHAN_NO.Text, "string", false));
            ParameterList.Add(CRMComm.GetValueSetParameter(this.slp_STORE.Text, "string", false));
            ParameterList.Add(Session["UID"].ToString());
            ParameterList.Add(DateTime.Now);

            #endregion

            #region 連結資料庫

            BCO.RecordCRMRecord bco = new BCO.RecordCRMRecord(ConntionDB);
            DataTable dt_Return = bco.QuerySwitch(BCO.RecordCRMRecord.QueryType.QueryLastThreeCRMRecord, ParameterList);

            #endregion

            #region 繫結GridView

            this.gv_Three.DataSource = dt_Return.DefaultView;
            this.gv_Three.DataBind();

            #endregion

            #region 檢查回傳資料

            if (dt_Return.Rows.Count == 0)
            { ScriptManager.RegisterStartupScript(this.up_Three, typeof(UpdatePanel), "隨便寫", "alert('查無資料!');", true); }

            #endregion
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
        finally { GetPageDefault(); }
    }
Exemplo n.º 10
0
    /// <summary>
    /// 初始檢視&編輯模式
    /// </summary>
    private void Page_Status_VIEW_EDIT_LOAD()
    {
        if (hid_Page_Status.Value == "VIEW" || hid_Page_Status.Value == "EDIT")
        {
            #region 清空所有欄位
            RadioButtonList radio_down_GRADE = (RadioButtonList)((ASP.sys_slp_slp_enumbase_ascx)slp_down_GRADE).FindControl("R1");
            //來電紀錄TAB
            this.slp_up_CHAN_NO.Text = string.Empty;//通路
            this.slp_up_Z_O.Text = string.Empty;//營業所
            this.txt_up_CODE.Text = string.Empty;//流水編號
            this.slp_up_STORE.Text = string.Empty;//門市 
            this.slp_up_BUSDATE.Text = string.Empty;//處理日期
            this.txt_up_ANSWER_TIME.Text = string.Empty;//接聽時間
            this.slp_up_SAL_ID.Text = string.Empty;//營業人員 
            this.slp_up_BUSUID.Text = string.Empty;//處理人員
            this.txt_up_ROUTE_ID.Text = string.Empty;//路線
            this.txt_up_ROUTE_STEP.Text = string.Empty;//路順
            this.txt_up_STORE_TEL_AREA.Text = string.Empty;//電話-區域號碼
            this.txt_up_STORE_TEL_NO.Text = string.Empty;//電話號碼
            this.txt_up_FAX_AREA.Text = string.Empty;//傳真-區域號碼
            this.txt_up_FAX_NO.Text = string.Empty;//傳真號碼
            this.txt_up_STORE_ADDRESS.Text = string.Empty;//地址

            //客服單TAB
            this.txt_down_CODE.Text = string.Empty;//客服單號
            this.slp_down_PROC_UNIT.Text = string.Empty;//負責單位
            //this.slp_down_PROC_MAN.Text = string.Empty;//負責人
            //this.txt_down_REQUEST_NO.Text = string.Empty;//原因代號
            this.slp_down_REQUEST_NO.Text = string.Empty;//原因代號
            this.slp_down_GRADE.Text = //string.Empty;//等級
                //radio_down_GRADE.SelectedIndex = 0; //等級
            this.txt_down_REQUEST_STATEMENT.Text = string.Empty;//問題陳述
            this.slp_down_CLOSE_DATE.Text = string.Empty;//處理日期
            this.txt_down_CLOSE_TIME.Text = string.Empty;//處理時間
            this.slp_down_ANSWER_USER.Text = string.Empty;//處理人員
            this.slp_down_PROC_FLAG.Text = string.Empty;//處理狀態
            this.txt_down_PROC_STATEMENT.Text = string.Empty;//處理敘述
            this.chb_down_CRM_CONFIRM_DATE.Checked = false;//主管簽核日
            this.slp_down_CRM_CONFIRM_DATE.Text = string.Empty;//主管簽核日
            this.chb_down_UNIT_CONFIRM_DATE.Checked = false;//客服單位簽核日
            this.slp_down_UNIT_CONFIRM_DATE.Text = string.Empty;//客服單位簽核日


            //2010/01/07
            this.SLP_UpdateUser.Text = string.Empty;//異動人員
            this.SLP_UpdateDate.Text = string.Empty;//異動日期


            #endregion

            #region 取得檢視資料

            int i_Id = 0;
            string s_Crm_No = string.Empty;
            DataTable dt_VDS_CRM_TICKET = new DataTable();
            DataSet ds_Return = new DataSet();

            try
            {
                if (Request["ID"] == null)
                { throw new Exception("載入頁面失敗!"); }
                else
                { i_Id = int.Parse(Request["ID"].ToString()); }
            }
            catch { }

            ArrayList ParameterList = new ArrayList();//20091117

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

            BCO.RecordCRMTicket bco_TICKET = new BCO.RecordCRMTicket(ConntionDB);
            dt_VDS_CRM_TICKET = bco_TICKET.QueryCRMRecordByFind(ParameterList);

            s_Crm_No = dt_VDS_CRM_TICKET.Rows[0]["CRM_NO"].ToString();

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

            BCO.RecordCRMRecord bco_Record = new BCO.RecordCRMRecord(ConntionDB);
            ds_Return = bco_Record.QueryCRMRecordByCode(ParameterList);

            ds_Return.Tables.Add(dt_VDS_CRM_TICKET.Copy());

            dt_VDS_CRM_TICKET.Clear();
            dt_VDS_CRM_TICKET.Dispose();

            #endregion

            #region 使用XML放置到前端資料

            xml_OLDData.InnerHtml = ds_Return.GetXml();

            #endregion

            #region 將資料寫入頁面

            //來電紀錄TAB
            this.slp_up_CHAN_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CHAN_NO"].ToString();//通路
            this.slp_up_Z_O.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["Z_O"].ToString();//營業所
            this.txt_up_CODE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CODE"].ToString();//流水編號
            this.slp_up_STORE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["STORE"].ToString();//門市 
            this.slp_up_BUSDATE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSDATE"].ToString();//處理日期
            this.txt_up_ANSWER_TIME.Text = DateTime.Parse(ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ANSWER_TIME"].ToString()).ToString("HHmm");//接聽時間
            this.slp_up_SAL_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["SAL_ID"].ToString();//營業人員 
            this.slp_up_BUSUID.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSUID"].ToString();//處理人員
            this.txt_up_ROUTE_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_ID"].ToString();//路線
            this.txt_up_ROUTE_STEP.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_STEP"].ToString();//路順
            this.txt_up_STORE_TEL_AREA.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_AREA"].ToString();//電話-區域號碼
            this.txt_up_STORE_TEL_NO.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_NO"].ToString();//電話號碼
            this.txt_up_FAX_AREA.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_AREA"].ToString();//傳真-區域號碼
            this.txt_up_FAX_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_NO"].ToString();//傳真號碼
            this.txt_up_STORE_ADDRESS.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_ADDRESS"].ToString();//地址

            //客服單TAB
            this.txt_down_CODE.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["CODE"].ToString();//客服單號
            this.slp_down_PROC_UNIT.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["PROC_UNIT"].ToString();//負責單位
            //this.slp_down_PROC_MAN.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["PROC_MAN"].ToString();//負責人
            RetrievePROC_MAN(slp_down_PROC_UNIT.Text, "", "");//取得負責人資料置入DropDownList裏
            foreach (ListItem li in slp_down_PROC_MAN.Items)
            {
                li.Selected = (li.Value == ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["PROC_MAN"].ToString() ? true : false);
                if (li.Selected) break;
            }
            //this.txt_down_REQUEST_NO.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["REQUEST_NO"].ToString();//原因代號
            this.slp_down_REQUEST_NO.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["REQUEST_NO"].ToString();//原因代號
            string str1 = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["GRADE"].ToString();//等級
            this.slp_down_GRADE.Text = str1;
            this.txt_down_REQUEST_STATEMENT.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["REQUEST_STATEMENT"].ToString();//問題陳述
            this.slp_down_CLOSE_DATE.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["CLOSE_DATE"].ToString();//處理日期
            if (ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["CLOSE_TIME"].ToString() == string.Empty)
            { this.txt_down_CLOSE_TIME.Text = string.Empty; }
            else
            { this.txt_down_CLOSE_TIME.Text = DateTime.Parse(ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["CLOSE_TIME"].ToString()).ToString("HH:mm"); }//處理時間
            this.slp_down_ANSWER_USER.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["ANSWER_USER"].ToString();//處理人員
            this.slp_down_PROC_FLAG.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["PROC_FLAG"].ToString();//處理狀態
            this.txt_down_PROC_STATEMENT.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["PROC_STATEMENT"].ToString();//處理敘述


            //2010/01/07
            this.SLP_UpdateUser.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["UPDATEUID"].ToString();//異動人員
            this.SLP_UpdateDate.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["UPDATEDATE"].ToString();//異動日期


            if (ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["CRM_CONFIRM_DATE"].ToString() == string.Empty)
            { this.chb_down_CRM_CONFIRM_DATE.Checked = false; }//主管簽核日
            else
            { this.chb_down_CRM_CONFIRM_DATE.Checked = true; }
            this.slp_down_CRM_CONFIRM_DATE.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["CRM_CONFIRM_DATE"].ToString();//主管簽核日

            if (ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["UNIT_CONFIRM_DATE"].ToString() == string.Empty)
            { this.chb_down_UNIT_CONFIRM_DATE.Checked = false; }
            else
            { this.chb_down_UNIT_CONFIRM_DATE.Checked = true; }//客服單位簽核日

            this.slp_down_UNIT_CONFIRM_DATE.Text = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["UNIT_CONFIRM_DATE"].ToString();//客服單位簽核日
            ViewState["CRM_CONFIRM"] = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["CRM_CONFIRM_DATE"].ToString();
            ViewState["UNIT_CONFIRM"] = ds_Return.Tables["VDS_CRM_TICKET"].Rows[0]["UNIT_CONFIRM_DATE"].ToString();
            #endregion

            #region 設定ReadOnly

            //來電紀錄TAB
            this.slp_up_CHAN_NO.ReadOnly = true;//通路
            this.slp_up_Z_O.ReadOnly = true;//營業所
            this.txt_up_CODE.ReadOnly = true;//流水編號
            this.txt_up_CODE.CssClass = "readtxtbox";
            this.slp_up_STORE.ReadOnly = true;//門市 
            this.slp_up_BUSDATE.ReadOnly = true;//處理日期
            this.txt_up_ANSWER_TIME.ReadOnly = true;//接聽時間
            this.slp_up_SAL_ID.ReadOnly = true;//營業人員 
            this.slp_up_BUSUID.ReadOnly = true;//處理人員
            this.txt_up_ROUTE_ID.ReadOnly = true;//路線
            this.txt_up_ROUTE_ID.CssClass = "readtxtbox";
            this.txt_up_ROUTE_STEP.ReadOnly = true;//路順
            this.txt_up_ROUTE_STEP.CssClass = "readtxtbox";
            this.txt_up_STORE_TEL_AREA.ReadOnly = true;//電話-區域號碼
            this.txt_up_STORE_TEL_AREA.CssClass = "readtxtbox";
            this.txt_up_STORE_TEL_NO.ReadOnly = true;//電話號碼
            this.txt_up_STORE_TEL_NO.CssClass = "readtxtbox";
            this.txt_up_FAX_AREA.ReadOnly = true;//傳真-區域號碼
            this.txt_up_FAX_AREA.CssClass = "readtxtbox";
            this.txt_up_FAX_NO.ReadOnly = true;//傳真號碼
            this.txt_up_FAX_NO.CssClass = "readtxtbox";
            this.txt_up_STORE_ADDRESS.ReadOnly = true;//地址
            this.txt_up_STORE_ADDRESS.CssClass = "readtxtbox";

            if (this.hid_Page_Status.Value == "VIEW")
            {
                #region 檢視模式

                //客服單TAB
                this.txt_down_CODE.ReadOnly = true;//客服單號
                this.txt_down_CODE.CssClass = "readtxtbox";
                this.slp_down_PROC_UNIT.ReadOnly = true;//負責單位
                this.slp_down_PROC_MAN.Enabled = false;//負責人
                slp_down_PROC_MAN.CssClass = "readtxtbox";
                //this.txt_down_REQUEST_NO.ReadOnly = true;//原因代號
                this.slp_down_REQUEST_NO.ReadOnly = true;//原因代號
                this.slp_down_GRADE.ReadOnly = true;//等級
                this.slp_down_GRADE.IsRequired = true;
                this.txt_down_REQUEST_STATEMENT.ReadOnly = true;//問題陳述
                this.txt_down_REQUEST_STATEMENT.CssClass = "readtxtbox";
                this.slp_down_CLOSE_DATE.ReadOnly = true;//處理日期
                this.txt_down_CLOSE_TIME.ReadOnly = true;//處理時間
                this.slp_down_ANSWER_USER.ReadOnly = true;//處理人員
                this.slp_down_ANSWER_USER.CssClass = "readtxtbox";
                this.slp_down_PROC_FLAG.ReadOnly = true;//處理狀態
                this.slp_down_PROC_FLAG.IsRequired = true;
                this.txt_down_PROC_STATEMENT.ReadOnly = true;//處理敘述
                this.txt_down_PROC_STATEMENT.CssClass = "readtxtbox";
                this.chb_down_CRM_CONFIRM_DATE.Enabled = false;//主管簽核日
                //this.slp_down_CRM_CONFIRM_DATE.ReadOnly = true;//主管簽核日
                this.chb_down_UNIT_CONFIRM_DATE.Enabled = false;//客服單位簽核日
                //this.slp_down_UNIT_CONFIRM_DATE.ReadOnly = true;//客服單位簽核日

                #endregion
            }
            if (this.hid_Page_Status.Value == "EDIT")
            {
                #region 編輯模式

                RadioButtonList rad_down_PROC_FLAG = (RadioButtonList)this.slp_down_PROC_FLAG.FindControl("R1");
                //客服單TAB
                this.txt_down_CODE.ReadOnly = true;//客服單號
                this.slp_down_PROC_UNIT.ReadOnly = false;//負責單位
                this.slp_down_PROC_MAN.Enabled = true;//負責人
                slp_down_PROC_MAN.CssClass = "";
                //this.txt_down_REQUEST_NO.ReadOnly = false;//原因代號
                this.slp_down_REQUEST_NO.ReadOnly = false;//原因代號
                this.slp_down_GRADE.ReadOnly = false;//等級
                this.txt_down_REQUEST_STATEMENT.ReadOnly = false;//問題陳述
                this.slp_down_CLOSE_DATE.ReadOnly = false;//處理日期
                this.txt_down_CLOSE_TIME.ReadOnly = false;//處理時間
                this.slp_down_ANSWER_USER.ReadOnly = false;//處理人員
                this.slp_down_ANSWER_USER.CssClass = "";
                this.slp_down_PROC_FLAG.ReadOnly = false;//處理狀態
                this.txt_down_PROC_STATEMENT.ReadOnly = false;//處理敘述
                //if (rad_down_PROC_FLAG.SelectedIndex == 2)
                //    this.chb_down_CRM_CONFIRM_DATE.Enabled = true;//主管簽核日
                //else
                //    this.chb_down_CRM_CONFIRM_DATE.Enabled = false;//主管簽核日
                //this.slp_down_CRM_CONFIRM_DATE.ReadOnly = false;//主管簽核日
                //if (rad_down_PROC_FLAG.SelectedIndex == 2)
                //    this.chb_down_UNIT_CONFIRM_DATE.Enabled = true;//客服單位簽核日
                //else
                //    this.chb_down_UNIT_CONFIRM_DATE.Enabled = false;//客服單位簽核日
                //this.slp_down_UNIT_CONFIRM_DATE.ReadOnly = false;//客服單位簽核日

                if (chb_down_CRM_CONFIRM_DATE.Checked || chb_down_UNIT_CONFIRM_DATE.Checked)
                    //slp_down_PROC_FLAG.ReadOnly = true;
                    System.Web.UI.ScriptManager.RegisterStartupScript(this.but_Cancel, this.GetType(), "CRM032", "lockProcessField();", true);
                else
                    //slp_down_PROC_FLAG.ReadOnly = false;
                    System.Web.UI.ScriptManager.RegisterStartupScript(this.but_Cancel, this.GetType(), "CRM032", "unlockProcessField();", true);
                #endregion
            }

            #endregion
        }
    }
Exemplo n.º 11
0
    //由流水號帶出來電資料
    private bool Retrive_From_Code(string s_Code)
    {
        DataSet ds_Return = new DataSet();

        ArrayList ParameterList = new ArrayList();//20091117

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

        BCO.RecordCRMRecord bco = new BCO.RecordCRMRecord(ConntionDB);
        ds_Return = bco.QueryCRMRecordByCode(ParameterList);

        if (ds_Return.Tables.Count != 0)
        {
            this.slp_up_CHAN_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CHAN_NO"].ToString();//通路
            this.slp_up_Z_O.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["Z_O"].ToString();//營業所
            this.txt_up_CODE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CODE"].ToString();//流水編號
            this.slp_up_STORE.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["STORE"].ToString();//門市 
            this.slp_up_BUSDATE.Text = ((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSDATE"]).ToString("yyyy/MM/dd");//處理日期
            this.txt_up_ANSWER_TIME.Text = DateTime.Parse(ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ANSWER_TIME"].ToString()).ToString("HHmm");//接聽時間
            this.slp_up_SAL_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["SAL_ID"].ToString();//營業人員 
            this.slp_up_BUSUID.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSUID"].ToString();//處理人員
            this.txt_up_ROUTE_ID.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_ID"].ToString();//路線
            this.txt_up_ROUTE_STEP.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_STEP"].ToString();//路順
            this.txt_up_STORE_TEL_AREA.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_AREA"].ToString();//電話-區域號碼
            this.txt_up_STORE_TEL_NO.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_NO"].ToString();//電話號碼
            this.txt_up_FAX_AREA.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_AREA"].ToString();//傳真-區域號碼
            this.txt_up_FAX_NO.Text = ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_NO"].ToString();//傳真號碼
            this.txt_up_STORE_ADDRESS.Text = ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_ADDRESS"].ToString();//地址
            SetTabCrmRecordStatus(true);
            return true;
        }
        else
        {
            this.slp_up_CHAN_NO.Text = "";//通路
            this.slp_up_Z_O.Text = "";//營業所
            this.slp_up_STORE.Text = "";//門市 
            this.slp_up_BUSDATE.Text = "";//處理日期
            this.txt_up_ANSWER_TIME.Text = "";//接聽時間
            this.slp_up_SAL_ID.Text = "";//營業人員 
            this.slp_up_BUSUID.Text = "";//處理人員
            this.txt_up_ROUTE_ID.Text = "";//路線
            this.txt_up_ROUTE_STEP.Text = "";//路順
            this.txt_up_STORE_TEL_AREA.Text = "";//電話-區域號碼
            this.txt_up_STORE_TEL_NO.Text = "";//電話號碼
            this.txt_up_FAX_AREA.Text = "";//傳真-區域號碼
            this.txt_up_FAX_NO.Text = "";//傳真號碼
            this.txt_up_STORE_ADDRESS.Text = "";//地址
            return false;
        }
    }
Exemplo n.º 12
0
    /// <summary>
    /// 將變更後的內部變量this.CallBackValue返回給前台JavaScript方法ReceiveServerData(string Value)。

    /// </summary>
    /// <returns></returns>
    string ICallbackEventHandler.GetCallbackResult()
    {
        try
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            DataSet ds_Return = new DataSet();

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

            #region 離開欄位[流水編號]

            if (s_Client_String[0] == "離開欄位[流水編號]")
            {
                #region 傳入參數

                ArrayList ParameterList = new ArrayList();//20091117

                ParameterList.Clear();
                ParameterList.Add(s_Client_String[1]);
                ParameterList.Add(Session["UID"].ToString());
                ParameterList.Add(DateTime.Now);

                #endregion

                #region 取得資料

                BCO.RecordCRMRecord bco = new BCO.RecordCRMRecord(ConntionDB);
                ds_Return = bco.QueryCRMRecordByCode(ParameterList);

                #endregion

                #region 檢查回傳資料,並將值傳至Client端

                if (ds_Return.Tables.Count != 0)
                {
                    sb.Remove(0, sb.Length);
                    sb.Append("TRUE<partition>");
                    sb.Append(ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["CHAN_NO"] + "<partition>");//通路
                    sb.Append(ds_Return.Tables["VDS_STM_STORE"].Rows[0]["Z_O"] + "<partition>");//營業所
                    sb.Append(ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["STORE"] + "<partition>");//門市
                    sb.Append(((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSDATE"]).ToString("yyyy/MM/dd") + "<partition>");//處理日期
                    sb.Append(((DateTime)ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["ANSWER_TIME"]).ToString("HH:mm") + "<partition>");//接聽時間
                    sb.Append(ds_Return.Tables["VDS_STM_STORE"].Rows[0]["SAL_ID"] + "<partition>");//營業人員
                    sb.Append(ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["BUSUID"] + "<partition>");//處理人員
                    sb.Append(ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_ID"] + "<partition>");//路線
                    sb.Append(ds_Return.Tables["VDS_STM_STORE"].Rows[0]["ROUTE_STEP"] + "<partition>");//路順
                    sb.Append(ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_AREA"] + "<partition>");//電話-區域號碼
                    sb.Append(ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_TEL_NO"] + "<partition>");//電話號碼
                    sb.Append(ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_AREA"] + "<partition>");//傳真-區域號碼
                    sb.Append(ds_Return.Tables["VDS_CRM_RECORD_MAIN"].Rows[0]["FAX_NO"] + "<partition>");//傳真號碼
                    sb.Append(ds_Return.Tables["VDS_STM_STORE"].Rows[0]["STORE_ADDRESS"] + "<partition>");//地址

                    CallBackValue = sb.ToString();
                }
                else
                {
                    sb.Append("FALSE<partition>");
                    sb.Append("無此流水編號[" + CallBackValue.Trim() + "]對應之來電記錄");
                    CallBackValue = sb.ToString();
                }

                #endregion
            }

            #endregion

            #region [處理狀態]為[已處理]或[處理中]

            if (s_Client_String[0] == "[處理狀態]為[已處理]或[處理中]")
            {
                TextBox txt_down_CLOSE_DATE = (TextBox)this.slp_down_CLOSE_DATE.FindControl("TextBoxCode");//處理日期
                TextBox CLOSE_TIME = (TextBox)(((ASP.wui_slp_slp_numberupdown_ascx)txt_down_CLOSE_TIME.FindControl("SLP_NumberUpDown1")).FindControl("TextBoxCode"));//處理時間

                sb.Remove(0, sb.Length);
                sb.Append("TRUE<partition>");
                sb.Append(DateTime.Now.ToString("yyyy/MM/dd") + "<partition_Detail>" + txt_down_CLOSE_DATE.ClientID + "<partition>");
                sb.Append(DateTime.Now.ToString("HH:mm") + "<partition_Detail>" + CLOSE_TIME.ClientID);

                CallBackValue = sb.ToString();
            }

            #endregion
        }
        catch (Exception ex)
        { CallBackValue = "FALSE<partition>" + ex.ToString(); }
        finally
        { }

        return CallBackValue;
    }