Beispiel #1
0
    /// <summary>
    /// 把值傳到Client端
    /// </summary>
    /// <returns></returns>
    public string GetCallbackResult()
    {
        //判斷值是否有重覆
        string rtn = "", strResult = "";
        ALOModel.MaintainDisStoreMemo BCO2 = new ALOModel.MaintainDisStoreMemo(ConnectionDB);

        DataTable dt = null;

        if (ObjectFrom.IndexOf("STORE") != -1)
        {
            ArrayList ParameterList = new ArrayList();//20091112
            ParameterList.Clear();
            ParameterList.Add(CallServerValue);
            dt = BCO2.QueryChanNoByStore(ParameterList);

            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                    rtn = string.Format("{0},{1}", dt.Rows[0][0].ToString(), dt.Rows[0][1].ToString());
            }
        }


        //附加相關控制項
        if (ObjectFrom.IndexOf("STORE") != -1)
        {
            if (ObjectFrom.IndexOf("1") != -1)
            {
                strResult = string.Format("{0},{1};{2}", SLP_StoreChain1.TextBox_Code.UniqueID, SLP_StoreChain1.TextBox_Name.UniqueID, rtn);
            }
            else if (ObjectFrom.IndexOf("2") != -1)
            {
                strResult = string.Format("{0},{1};{2}", SLP_StoreChain2.TextBox_Code.UniqueID, SLP_StoreChain2.TextBox_Name.UniqueID, rtn);
            }
        }

        return strResult;
    }
Beispiel #2
0
    public static string GetChanByStoreAtServer(string str_Store)
    {
        #region
        string strResult = "";
        try
        {
            string strChan_No = "", strChan_Name = "", strStore_Name = "";
            DataTable dt = null;
            ALOModel.MaintainDisStoreMemo BCO = new ALOModel.MaintainDisStoreMemo(ConnectionDB);
            ArrayList ParameterList = new ArrayList();
            ParameterList.Clear();
            ParameterList.Add(str_Store);
            dt = BCO.QueryChanNoByStore(ParameterList);

            if (dt != null && dt.Rows.Count > 0)
            {
                strChan_No = dt.Rows[0][0].ToString().Trim();
                strChan_Name = dt.Rows[0][1].ToString().Trim();
                strStore_Name = dt.Rows[0][3].ToString().Trim();
            }
            else
            {
                strStore_Name = "查無資料";
            }

            strResult = string.Format("{0}||{1}||{2}", strChan_No, strChan_Name, strStore_Name);
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return strResult;
        #endregion
    }
Beispiel #3
0
    private string GetMemoByChanAndStore()
    {
        #region

        string strResult = "";
        try
        {
            STM_SLP_StoreChain SLP_StoreChain1 = ((STM_SLP_StoreChain)FormView1.FindControl("SLP_StoreChain1"));
            PIC.VDS2G.WebUI.SLP.SLP_Store SLP_Store1 = (PIC.VDS2G.WebUI.SLP.SLP_Store)FormView1.FindControl("SLP_Store1");

            ALOModel.MaintainDisStoreMemo BCO2 = new ALOModel.MaintainDisStoreMemo(ConnectionDB);
            ArrayList ParameterList = new ArrayList();//20091112
            ParameterList.Clear();
            ParameterList.Add(SLP_StoreChain1.Text.Trim());
            ParameterList.Add(SLP_Store1.Text.Trim());
            DataTable dt2 = BCO2.QueryMemoByChanAndStore(ParameterList);
            if (dt2 != null && dt2.Rows.Count > 0)
            {
                strResult = dt2.Rows[0][0].ToString().Trim();

                if (strResult == "")
                    strResult = "無設定備註";

            }
            else
            {
                strResult = "無設定備註";
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }

        return strResult;
        #endregion
    }
Beispiel #4
0
    /// <summary>
    /// 把值傳到Client端
    /// </summary>
    /// <returns></returns>
    public string GetCallbackResult()
    {
        #region
        ALOModel.MaintainDisStoreMemo BCO2 = new ALOModel.MaintainDisStoreMemo(ConnectionDB);

        DataTable dt = null;
        string rtn = "", strResult = "";
        string strChan_No = "", strChan_Name = "", strStore_Name = "";
        string[] strAryArg;

        ArrayList ParameterList = new ArrayList();//20091113

        if (ObjectFrom.IndexOf("STORE") != -1)
        {
            #region
            strAryArg = CallServerValue.Split("_".ToCharArray());

            ParameterList.Clear();
            ParameterList.Add(strAryArg[0]);//Store

            dt = BCO2.QueryChanNoByStore(ParameterList);

            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                    rtn = string.Format("{0}", dt.Rows[0][0].ToString());
            }

            if (dt != null && dt.Rows.Count > 0)
            {
                strChan_No = dt.Rows[0][0].ToString().Trim();
                strChan_Name = dt.Rows[0][1].ToString().Trim();
                strStore_Name = dt.Rows[0][3].ToString().Trim();

                if (strChan_No != strAryArg[1] && strAryArg[1] != "")
                    strStore_Name = "查無資料";
            }
            else
            {
                strStore_Name = "查無資料";
            }

            bool bCheck = CheckCanAddMain(strChan_No);

            rtn = string.Format("{0}-{1}-{2}-{3}-{4}", strChan_No, strChan_Name, strStore_Name, bCheck.ToString(), CurrentPageMode.ToString());


            #endregion
        }
        else if (ObjectFrom.IndexOf("PERIOD") != -1)
        {
            #region
            strAryArg = CallServerValue.Split(";".ToCharArray());

            if (GetTaxType(strAryArg[0], strAryArg[1]))
            {
                rtn = "X";
            }
            else
            {
                rtn = "無此期別 [" + strAryArg[1].ToString() + "] 設定,請輸入其他期別";
            }
            #endregion
        }



        //附加相關控制項
        if (ObjectFrom.IndexOf("STORE") != -1)
        {
            TextBox txtStoreChain1 = (TextBox)SLP_StoreChain1.FindControl("TextBoxCode");
            strResult = string.Format("{0};{1}",
                txtStoreChain1.ClientID,
                rtn);

        }
        else if (ObjectFrom.IndexOf("PERIOD") != -1)
        {
            #region
            strAryArg = CallServerValue.Split(";".ToCharArray());
            strResult = string.Format("{0}-{1};{2}", strAryArg[2], SLP_ItemPeriod1.TextBox_Code.ClientID, rtn);
            #endregion
        }


        return strResult;
        #endregion
    }
Beispiel #5
0
    protected void btn_SaveComment_Click(object sender, EventArgs e)
    {
        #region


        Button btnSave = sender as Button;
        Button btnEdit = (Button)FormView1.FindControl("btn_EditComment");
        TextBox txt_Comment = (TextBox)FormView1.FindControl("txt_Comment");

        STM_SLP_StoreChain SLP_StoreChain1 = (STM_SLP_StoreChain)FormView1.FindControl("SLP_StoreChain1");
        PIC.VDS2G.WebUI.SLP.SLP_Store SLP_Store1 = (PIC.VDS2G.WebUI.SLP.SLP_Store)FormView1.FindControl("SLP_Store1");

        string strMemo = hiddenMemo.Value.Trim();

        if (SLP_StoreChain1.Text.Trim() != "" && SLP_Store1.Text.Trim() != "")
        {
            if (GetStringLen(strMemo) > 400)
            {
                ResultMsgLabel.Text = "備註限制200中文字";
                //ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "ClientScript", "alert('備註限制200中文字');", true);
            }
            else
            {
                #region
                bool bResult = false;

                try
                {

                    #region Data
                    ArrayList ParameterList = new ArrayList();//20091112
                    ParameterList.Clear();
                    ParameterList.Add(Session["UID"].ToString());
                    ParameterList.Add(SLP_StoreChain1.Text.Trim());
                    ParameterList.Add(SLP_Store1.Text.Trim());
                    ParameterList.Add(strMemo == "無設定備註" ? "" : strMemo);

                    #endregion

                    ALOModel.MaintainDisStoreMemo BCO = new ALOModel.MaintainDisStoreMemo(ConnectionDB);

                    bResult = BCO.CreateStoreMemo(ParameterList, null);

                    if (!bResult)
                    {
                        throw new Exception("更新0筆資料!");
                    }
                    else
                    {
                        ResultMsgLabel.Text = "更改完成";
                        //ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "ClientScript", "alert('更改完成');", true);
                    }


                    txt_Comment.Text = GetMemoByChanAndStore();

                }
                catch (Exception ex)
                {
                    ErrorMsgLabel.Text = ex.Message;
                }
                finally
                {
                    btnEdit.Enabled = true;
                    btnSave.Enabled = false;
                    txt_Comment.ReadOnly = true;
                }
                #endregion
            }
        }
        else
        {
            if (SLP_StoreChain1.Text.Trim() == "")
            {
                ResultMsgLabel.Text = "通路不可空白";
                //ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "ClientScript", "alert('通路不可空白');", true);
            }
            else if (SLP_Store1.Text.Trim() == "")
            {
                ResultMsgLabel.Text = "門市不可空白";
                //ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "ClientScript", "alert('門市不可空白');", true);
            }
        }





        #endregion
    }
Beispiel #6
0
    /// <summary>
    /// 把值傳到Client端
    /// </summary>
    /// <returns></returns>
    public string GetCallbackResult()
    {
        #region

        string rtn = "", strResult = "";

        try
        {
            ALOModel.MaintinDisPattern BCO = new ALOModel.MaintinDisPattern(ConnectionDB);
            ALOModel.MaintainDisStoreMemo BCO2 = new ALOModel.MaintainDisStoreMemo(ConnectionDB);
            ALOModel.MaintainStoreOrderItem BCO3 = new ALOModel.MaintainStoreOrderItem(ConnectionDB);
            ALOModel.MaintainStoreAssignItem BCO4 = new ALOModel.MaintainStoreAssignItem(ConnectionDB);

            DataTable dt = null;
            DataTable dt2 = null;
            DataTable dt3 = null;

            string strChan_No = "", strChan_Name = "", strStore = "", strStore_Name = "", strCommemt = "", strConfirm = "", strStoreStateDesc = "";

            Int32 iResult = 0;


            if (ObjectFrom == "PMA")//改由PageMethod執行
            {
                dt = BCO.QueryRootByPMA(CallServerValue);
            }
            else if (ObjectFrom == "PATTERN")//改由PageMethod執行
            {
                dt = BCO.QueryPMAByPattern(CallServerValue);
            }
            else if (ObjectFrom == "ITEM")//改由PageMethod執行
            {
                dt = BCO.QueryPMA_PatternByItem(CallServerValue);
            }
            else if (ObjectFrom == "STORE")
            {
                #region

                string[] strAry = CallServerValue.Split("_".ToCharArray());

                ArrayList ParameterList = new ArrayList();//20091112
                ParameterList.Clear();
                ParameterList.Add(strAry[0]);//Store

                dt = BCO2.QueryChanNoByStore(ParameterList);
                dt3 = BCO3.CheckSettingStateByStore(ParameterList);

                if (dt != null && dt.Rows.Count > 0)
                {
                    strChan_No = dt.Rows[0][0].ToString().Trim();
                    strChan_Name = dt.Rows[0][1].ToString().Trim();
                    strStore_Name = dt.Rows[0][3].ToString().Trim();

                    #region
                    ParameterList.Clear();
                    ParameterList.Add(strAry[1] != "" ? strAry[1] : strChan_No);//Chan_No
                    ParameterList.Add(strAry[0]);//Store
                    dt2 = BCO2.QueryMemoByChanAndStore(ParameterList);//get memo
                    #endregion

                    if (strChan_No != strAry[1] && strAry[1] != "")
                        strStore_Name = "查無資料";

                    ParameterList.Clear();
                    ParameterList.Add(dt.Rows[0][0].ToString());
                    ParameterList.Add(strAry[0]);
                    strStoreStateDesc = BCO4.CheckByChanAndStore(ParameterList);

                    if (strChan_No != strAry[1] && strAry[1] != "")
                        strStoreStateDesc = "輸入門市不屬於輸入通路";

                }
                else
                {
                    strStore_Name = "查無資料";
                    strStoreStateDesc = "輸入門市不屬於輸入通路";

                    if (strAry[0] == "" || strAry[1] == "")
                        strStoreStateDesc = "通路、門市必填";

                }

                if (dt2 != null && dt2.Rows.Count > 0)
                {
                    strCommemt = dt2.Rows[0][0].ToString().Trim();

                    if (strChan_No != strAry[1] && strAry[1] != "")
                        strCommemt = "";

                    if (strCommemt == "")
                        strCommemt = "無設定備註";
                }
                else
                {
                    strCommemt = "無設定備註";
                }


                if (dt3 != null && dt3.Rows.Count > 0)
                {
                    Int32.TryParse(dt3.Rows[0][0].ToString().Trim(), out iResult);
                    strConfirm = iResult.ToString();

                    if (strChan_No != strAry[1])
                        strConfirm = "0";

                }
                else
                {
                    strConfirm = "0";
                }


                rtn = string.Format("{0}||{1}||{2}||{3}||{4}||{5}", strChan_No, strChan_Name, strStore_Name, strCommemt, strConfirm, strStoreStateDesc);
                #endregion
            }


            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    if (ObjectFrom == "PMA")
                    {
                        //ROOT
                        rtn = string.Format("{0}", dt.Rows[0][0].ToString());
                    }
                    else if (ObjectFrom == "PATTERN")
                    {
                        //ROOT-PMA
                        rtn = string.Format("{0}-{1}", dt.Rows[0][1].ToString(), dt.Rows[0][0].ToString());
                    }
                    else if (ObjectFrom == "ITEM")
                    {
                        //ROOT-PMA-PATTERN
                        rtn = string.Format("{0}-{1}-{2}", dt.Rows[0][2].ToString(), dt.Rows[0][0].ToString(), dt.Rows[0][1].ToString());
                    }
                }
            }

            //附加相關控制項
            if (ObjectFrom == "PMA")
            {
                strResult = string.Format("{0},{1}", SLP_ROOT.TextBox_Code.ClientID, rtn);
            }
            else if (ObjectFrom == "PATTERN")
            {
                strResult = string.Format("{0}-{1},{2}", SLP_ROOT.TextBox_Code.ClientID, SLP_PMA.TextBox_Code.ClientID, rtn);
            }
            else if (ObjectFrom == "ITEM")
            {
                strResult = string.Format("{0}-{1}-{2},{3}", SLP_ROOT.TextBox_Code.ClientID, SLP_PMA.TextBox_Code.ClientID, SLP_Pattern.TextBox_Code.ClientID, rtn);
            }
            else if (ObjectFrom == "STORE")
            {
                strResult = string.Format("{0}||{1}||{2}||{3}||{4};{5}",
                          ((TextBox)((STM_SLP_StoreChain)FormView1.FindControl("SLP_StoreChain1")).FindControl("TextBoxCode")).ClientID,
                          ((TextBox)FormView1.FindControl("txt_Comment")).ClientID,
                          hiddenCounts.ClientID,
                          hiddenStoreStateDesc.ClientID,
                          ((Button)FormView1.FindControl("btn_EditComment")).ClientID,
                          rtn);
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }

        return strResult;
        #endregion
    }
Beispiel #7
0
    protected void btn_SaveComment_Click(object sender, EventArgs e)
    {
        #region

        if (SLP_StoreChain1.Text.Trim() != "" && SLP_Store1.Text.Trim() != "")
        {
            if (GetStringLen(txt_Comment.Text.Trim()) > 400)
            {
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "ClientScript", "alert('備註限制200中文字');", true);
            }
            else
            {
                #region
                bool bResult = false;

                try
                {

                    #region Data
                    ArrayList ParameterList = new ArrayList();//20091112
                    ParameterList.Clear();
                    ParameterList.Add(Session["UID"].ToString());
                    ParameterList.Add(SLP_StoreChain1.Text.Trim());
                    ParameterList.Add(SLP_Store1.Text.Trim());
                    ParameterList.Add(strRemark.Trim() == "無設定備註" ? "" : strRemark.Trim());

                    #endregion

                    ALOModel.MaintainDisStoreMemo BCO = new ALOModel.MaintainDisStoreMemo(ConnectionDB);

                    bResult = BCO.CreateStoreMemo(ParameterList, null);

                    if (!bResult)
                    {
                        throw new Exception("更新0筆資料!");
                    }
                    else
                    {

                        CheckByChanAndStore();
                        //ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "ClientScript", "alert('更改完成');", true);
                        ResultMsgLabel.Text = "更改完成";
                    }

                }
                catch (Exception ex)
                {
                    ErrorMsgLabel.Text = ex.Message;
                }
                finally
                {
                    btn_EditComment.Enabled = true;
                    btn_SaveComment.Enabled = false;
                    txt_Comment.ReadOnly = true;
                }
                #endregion
            }
        }
        else
        {
            if (SLP_StoreChain1.Text.Trim() == "")
            {
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "ClientScript", "alert('通路不可空白');", true);
            }
            else if (SLP_Store1.Text.Trim() == "")
            {
                ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "ClientScript", "alert('門市不可空白');", true);
            }
        }


        //20090716 added
        if (CurrentPageMode == PageCurrentMode.Query || CurrentPageMode == PageCurrentMode.Readonly)
        {
            ScriptManager.RegisterStartupScript(this, this.GetType(), "", string.Format("SwitchControlDisplay('{0}','',0);", PanelMasterAndDetail.ClientID), true);
        }


        #endregion
    }
Beispiel #8
0
    /// <summary>
    /// 把值傳到Client端
    /// </summary>
    /// <returns></returns>
    public string GetCallbackResult()
    {
        #region
        string rtn = "", strResult = "";
        ALOModel.MaintinDisPattern BCO = new ALOModel.MaintinDisPattern(ConnectionDB);
        ALOModel.MaintainDisStoreMemo BCO2 = new ALOModel.MaintainDisStoreMemo(ConnectionDB);
        ALOModel.MaintainStoreOrderItem BCO3 = new ALOModel.MaintainStoreOrderItem(ConnectionDB);
        ALOModel.MaintainStoreAssignItem BCO4 = new ALOModel.MaintainStoreAssignItem(ConnectionDB);

        DataTable dt = null;
        DataTable dt2 = null;
        DataTable dt3 = null;

        string strChan_No = "", strChan_Name = "", strStore_Name = "", strCommemt = "", strConfirm = "", strStoreStateDesc = "";
        Int32 iResult = 0;

        if (ObjectFrom.IndexOf("STORE") != -1)
        {
            #region

            string[] strAry = CallServerValue.Split("_".ToCharArray());

            ArrayList ParameterList = new ArrayList();//20091112
            ParameterList.Clear();
            ParameterList.Add(strAry[0]);//Store

            dt = BCO2.QueryChanNoByStore(ParameterList);
            dt3 = BCO3.CheckSettingStateByStore(ParameterList);

            if (dt != null && dt.Rows.Count > 0)
            {
                strChan_No = dt.Rows[0][0].ToString().Trim();
                strChan_Name = dt.Rows[0][1].ToString().Trim();
                strStore_Name = dt.Rows[0][3].ToString().Trim();

                #region
                ParameterList.Clear();
                ParameterList.Add(strAry[1] != "" ? strAry[1] : strChan_No);//Chan_No
                ParameterList.Add(strAry[0]);//Store
                dt2 = BCO2.QueryMemoByChanAndStore(ParameterList);//get memo
                #endregion


                if (strChan_No != strAry[1] && strAry[1] != "")
                    strStore_Name = "查無資料";

                ParameterList.Clear();
                ParameterList.Add(dt.Rows[0][0].ToString());
                ParameterList.Add(strAry[0]);
                strStoreStateDesc = BCO4.CheckByChanAndStore(ParameterList);

                if (strChan_No != strAry[1] && strAry[1] != "")
                    strStoreStateDesc = "輸入門市不屬於輸入通路";

            }
            else 
            {
                strStore_Name = "查無資料";
                strStoreStateDesc = "輸入門市不屬於輸入通路";

                if(strAry[0]=="" || strAry[1] =="")
                    strStoreStateDesc = "通路、門市必填";
            }

            if (dt2 != null && dt2.Rows.Count > 0)
            {
                strCommemt = dt2.Rows[0][0].ToString().Trim();

                if (strChan_No != strAry[1] && strAry[1] != "")
                    strCommemt = "";

                if (strCommemt == "")
                    strCommemt = "無設定備註";
            }
            else
            {
                strCommemt = "無設定備註";
            }


            if (dt3 != null && dt3.Rows.Count > 0)
            {
                Int32.TryParse(dt3.Rows[0][0].ToString().Trim(), out iResult);
                strConfirm = iResult.ToString();
            }
            else
            {
                strConfirm = "0";
            }


            rtn = string.Format("{0}||{1}||{2}||{3}||{4}||{5}", strChan_No, strChan_Name, strStore_Name, strCommemt, strConfirm, strStoreStateDesc);
            #endregion
        }


        //附加相關控制項
        if (ObjectFrom.IndexOf("STORE") != -1)
        {
            TextBox txtStoreChain1 = (TextBox)SLP_StoreChain1.FindControl("TextBoxCode");
            TextBox txtStoreChain2 = (TextBox)SLP_StoreChain2.FindControl("TextBoxCode");

            if (ObjectFrom.IndexOf("1") != -1)
            {
                strResult = string.Format("{0}||{1}||{2}||{3}||{4};{5}",
                          txtStoreChain1.UniqueID,
                          txt_Comment.UniqueID,
                          hiddenCounts.UniqueID,
                          hiddenStoreStateDesc.UniqueID,
                          btn_EditComment.ClientID,
                          rtn);

            }
            else if (ObjectFrom.IndexOf("2") != -1)
            {
                strResult = string.Format("{0}||{1}||{2}||{3}||{4};{5}",
                          txtStoreChain2.UniqueID,
                          txt_Comment.UniqueID,
                          hiddenCounts.UniqueID,
                          hiddenStoreStateDesc.UniqueID,
                          btn_EditComment.ClientID,
                          rtn);

            }

        }

        return strResult;
        #endregion
    }
Beispiel #9
0
    private string GetMemoByChanAndStore()
    {
        #region

        string strResult = "";
        try
        {
            ALOModel.MaintainDisStoreMemo BCO2 = new ALOModel.MaintainDisStoreMemo(ConnectionDB);
            ArrayList ParameterList = new ArrayList();
            ParameterList.Clear();
            ParameterList.Add(SLP_StoreChain1.Text.Trim());
            ParameterList.Add(SLP_Store1.Text.Trim());
            DataTable dt2 = BCO2.QueryMemoByChanAndStore(ParameterList);
            if (dt2 != null && dt2.Rows.Count > 0)
            {
                strResult = dt2.Rows[0][0].ToString().Trim();

                if (strResult == "")
                    strResult = "無設定備註";

            }
            else
            {
                strResult = "無設定備註";
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }

        return strResult;
        #endregion
    }
Beispiel #10
0
    private string GetStoreValueByPageMethod(string CallServerValue)
    {
        #region


        ALOModel.MaintainDisStoreMemo BCO2 = new ALOModel.MaintainDisStoreMemo(ConnectionDB);
        ALOModel.MaintainStoreOrderItem BCO3 = new ALOModel.MaintainStoreOrderItem(ConnectionDB);
        ALOModel.MaintainStoreAssignItem BCO4 = new ALOModel.MaintainStoreAssignItem(ConnectionDB);
        string rtn = "";
        string strChan_No = "", strChan_Name = "", strStore_Name = "", strCommemt = "", strConfirm = "", strStoreStateDesc = "";
        Int32 iResult = 0;
        string[] strAry = CallServerValue.Split("_".ToCharArray());

        try
        {
            DataTable dt = null;
            DataTable dt2 = null;
            DataTable dt3 = null;

            ArrayList ParameterList = new ArrayList();
            ParameterList.Clear();
            ParameterList.Add(strAry[0]);//Store

            dt = BCO2.QueryChanNoByStore(ParameterList);
            dt3 = BCO3.CheckSettingStateByStore(ParameterList);

            if (dt != null && dt.Rows.Count > 0)
            {
                strChan_No = dt.Rows[0][0].ToString().Trim();
                strChan_Name = dt.Rows[0][1].ToString().Trim();
                strStore_Name = dt.Rows[0][3].ToString().Trim();

                #region
                ParameterList.Clear();
                ParameterList.Add(strAry[1] != "" ? strAry[1] : strChan_No);//Chan_No
                ParameterList.Add(strAry[0]);//Store
                dt2 = BCO2.QueryMemoByChanAndStore(ParameterList);//get memo
                #endregion

                if (strChan_No != strAry[1] && strAry[1] != "")
                    strStore_Name = "查無資料";

                ParameterList.Clear();
                ParameterList.Add(dt.Rows[0][0].ToString());
                ParameterList.Add(strAry[0]);
                strStoreStateDesc = BCO4.CheckByChanAndStore(ParameterList);

                if (strChan_No != strAry[1] && strAry[1] != "")
                    strStoreStateDesc = "輸入門市不屬於輸入通路";

            }
            else
            {
                strStore_Name = "查無資料";
                strStoreStateDesc = "輸入門市不屬於輸入通路";

                if (strAry[0] == "" || strAry[1] == "")
                    strStoreStateDesc = "通路、門市必填";

            }

            if (dt2 != null && dt2.Rows.Count > 0)
            {
                strCommemt = dt2.Rows[0][0].ToString().Trim();

                if (strChan_No != strAry[1] && strAry[1] != "")
                    strCommemt = "";

                if (strCommemt == "")
                    strCommemt = "無設定備註";
            }
            else
            {
                strCommemt = "無設定備註";
            }


            if (dt3 != null && dt3.Rows.Count > 0)
            {
                Int32.TryParse(dt3.Rows[0][0].ToString().Trim(), out iResult);
                strConfirm = iResult.ToString();
            }
            else
            {
                strConfirm = "0";
            }


            rtn = string.Format("{0}||{1}||{2}||{3}||{4}||{5}", strChan_No, strChan_Name, strStore_Name, strCommemt, strConfirm, strStoreStateDesc);

        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            BCO2.CloseConnection();
            BCO3.CloseConnection();
            BCO4.CloseConnection();
        }

        return rtn;

        #endregion
    }
Beispiel #11
0
    /// <summary>
    /// 把值傳到Client端
    /// </summary>
    /// <returns></returns>
    public string GetCallbackResult()
    {
        string rtn = "", strResult = "";
        ALOModel.QueryALOCommon BCO = new ALOModel.QueryALOCommon(ConnectionDB);
        ALOModel.MaintainDisStoreMemo BCO2 = new ALOModel.MaintainDisStoreMemo(ConnectionDB);

        DataTable dt = null;

        string strChan_No = "", strChan_Name = "", strStore_Name = "", strItemStateDesc = "";
        Int32 iResult = 0;
        ArrayList ParameterList = new ArrayList();//20091113

        if (ObjectFrom.IndexOf("ITEM") != -1)
        {
            #region
            if (CallServerValue != "")
            {
                ParameterList.Clear();
                ParameterList.Add(CallServerValue);
                strItemStateDesc = BCO.CheckCurrentItemState(ParameterList);
            }
            else
            {
                strItemStateDesc = "品號必填";
            }

            rtn = string.Format("{0}", strItemStateDesc);

            #endregion
        }
        else if (ObjectFrom.IndexOf("STORE") != -1)
        {
            #region

            string[] strAry = CallServerValue.Split("_".ToCharArray());

            ParameterList.Clear();
            ParameterList.Add(strAry[0]);//Store

            dt = BCO2.QueryChanNoByStore(ParameterList);

            if (dt != null && dt.Rows.Count > 0)
            {
                strChan_No = dt.Rows[0][0].ToString().Trim();
                strChan_Name = dt.Rows[0][1].ToString().Trim();
                strStore_Name = dt.Rows[0][3].ToString().Trim();

                if (strChan_No != strAry[1] && strAry[1] != "")
                    strStore_Name = "查無資料";
            }
            else
            {
                strStore_Name = "查無資料";
            }

            rtn = string.Format("{0}-{1}-{2}", strChan_No, strChan_Name, strStore_Name);


            #endregion
        }


        //附加相關控制項
        if (ObjectFrom.IndexOf("ITEM") != -1)
        {
            strResult = string.Format("{0};{1}",
                    hiddenItemStateDesc.ClientID,
                    rtn);
        }
        else if (ObjectFrom.IndexOf("STORE") != -1)
        {
            TextBox txtStoreChain2 = (TextBox)SLP_StoreChain2.FindControl("TextBoxCode");
            strResult = string.Format("{0};{1}",
                   txtStoreChain2.ClientID,
                   rtn);

        }

        return strResult;
    }
Beispiel #12
0
    /// <summary>
    /// 把值傳到Client端
    /// </summary>
    /// <returns></returns>
    public string GetCallbackResult()
    {
        #region
        string rtn = "", strResult = "";
        ALOModel.MaintinDisPattern BCO = new ALOModel.MaintinDisPattern(ConnectionDB);
        ALOModel.MaintainDisStoreMemo BCO2 = new ALOModel.MaintainDisStoreMemo(ConnectionDB);
        ALOModel.MaintainStoreOrderItem BCO3 = new ALOModel.MaintainStoreOrderItem(ConnectionDB);
        ALOModel.MaintainStoreAssignItem BCO4 = new ALOModel.MaintainStoreAssignItem(ConnectionDB);

        DataTable dt = null;
        DataTable dt2 = null;
        DataTable dt3 = null;

        string strChan_No = "", strChan_Name = "", strStore_Name = "", strCommemt = "", strConfirm = "", strStoreStateDesc = "";
        Int32 iResult = 0;

        if (ObjectFrom.IndexOf("STORE") != -1)
        {
            #region

            string[] strAry = CallServerValue.Split("_".ToCharArray());

            ArrayList ParameterList = new ArrayList();//20091112
            ParameterList.Clear();
            ParameterList.Add(strAry[0]);//Store

            dt = BCO2.QueryChanNoByStore(ParameterList);
            dt3 = BCO3.CheckSettingStateByStore(ParameterList);

            ParameterList.Clear();
            ParameterList.Add(strAry[1]);//Chan_No
            ParameterList.Add(strAry[0]);//Store

            dt2 = BCO2.QueryMemoByChanAndStore(ParameterList);


            if (dt != null && dt.Rows.Count > 0)
            {
                strChan_No = dt.Rows[0][0].ToString().Trim();
                strChan_Name = dt.Rows[0][1].ToString().Trim();
                strStore_Name = dt.Rows[0][3].ToString().Trim();


                if (strChan_No != strAry[1] && strAry[1] != "")
                    strStore_Name = "查無資料";
            }
            else
            {
                strStore_Name = "查無資料";
            }

            rtn = string.Format("{0}-{1}-{2}", strChan_No, strChan_Name, strStore_Name);
            #endregion
        }


        //附加相關控制項
        if (ObjectFrom.IndexOf("STORE") != -1)
        {
            strResult = string.Format("{0};{1}",
                      SLP_StoreChain3.TextBox_Code.ClientID,
                        rtn);
        }

        return strResult;
        #endregion
    }
Beispiel #13
0
    /// <summary>
    /// 把值傳到Client端
    /// </summary>
    /// <returns></returns>
    public string GetCallbackResult()
    {
        #region
        string rtn = "", strResult = "";
        ALOModel.MaintinDisPattern BCO = new ALOModel.MaintinDisPattern(ConnectionDB);
        ALOModel.MaintainDisStoreMemo BCO2 = new ALOModel.MaintainDisStoreMemo(ConnectionDB);
        ALOModel.MaintainStoreOrderItem BCO3 = new ALOModel.MaintainStoreOrderItem(ConnectionDB);
        ALOModel.MaintainStoreAssignItem BCO4 = new ALOModel.MaintainStoreAssignItem(ConnectionDB);
        ALOModel.MaintinDisPattern BCO5 = new ALOModel.MaintinDisPattern(ConnectionDB);


        DataTable dt = null;
        DataTable dt2 = null;
        DataTable dt3 = null;

        ArrayList ParameterList = new ArrayList();//20091113

        if (ObjectFrom.IndexOf("STORE") != -1)
        {
            #region
            ParameterList.Clear();
            ParameterList.Add(CallServerValue);
            dt = BCO2.QueryChanNoByStore(ParameterList);

            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                    rtn = string.Format("{0}", dt.Rows[0][0].ToString());
            }
            #endregion
        }
        else if (ObjectFrom.IndexOf("PMA") != -1)//改由PageMethod執行
        {
            dt = BCO5.QueryRootByPMA(CallServerValue);
            //ROOT
            if (dt != null && dt.Rows.Count > 0)
                rtn = string.Format("{0}", dt.Rows[0][0].ToString());

        }
        else if (ObjectFrom.IndexOf("PATTERN") != -1)//改由PageMethod執行
        {
            dt = BCO5.QueryPMAByPattern(CallServerValue);
            //ROOT-PMA
            if (dt != null && dt.Rows.Count > 0)
                rtn = string.Format("{0}-{1}", dt.Rows[0][1].ToString(), dt.Rows[0][0].ToString());
        }


        TextBox txtStoreChain1 = (TextBox)SLP_StoreChain1.FindControl("TextBoxCode");
        TextBox txtStoreChain2 = (TextBox)SLP_StoreChain2.FindControl("TextBoxCode");


        TextBox txtRootNo1 = (TextBox)SLP_RootNo1.FindControl("TextBoxCode");
        TextBox txtPMA1 = (TextBox)SLP_PMA1.FindControl("TextBoxCode");

        TextBox txtRootNo2 = (TextBox)SLP_RootNo2.FindControl("TextBoxCode");
        TextBox txtPMA3 = (TextBox)SLP_PMA2.FindControl("TextBoxCode");


        //附加相關控制項
        if (ObjectFrom.IndexOf("STORE") != -1)
        {
            if (ObjectFrom.IndexOf("2") != -1)
            {
                strResult = string.Format("{0},{1}",
                    txtStoreChain2.ClientID,
                    rtn);
            }

        }
        else if (ObjectFrom.IndexOf("PMA") != -1)
        {
            if (ObjectFrom.IndexOf("1") != -1)
            {
                strResult = string.Format("{0},{1}", txtRootNo1.ClientID, rtn);
            }
            else if (ObjectFrom.IndexOf("2") != -1)
            {
                strResult = string.Format("{0},{1}", txtRootNo2.ClientID, rtn);
            }
        }
        else if (ObjectFrom.IndexOf("PATTERN") != -1)
        {
            if (ObjectFrom.IndexOf("1") != -1)
            {
                strResult = string.Format("{0}-{1},{2}", txtRootNo1.ClientID, txtPMA1.ClientID, rtn);
            }
            else if (ObjectFrom.IndexOf("2") != -1)
            {
                strResult = string.Format("{0}-{1},{2}", txtRootNo2.ClientID, txtPMA3.ClientID, rtn);
            }
        }



        return strResult;
        #endregion
    }