コード例 #1
0
ファイル: ALO042.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    private void CheckByChanAndStore()
    {
        #region
        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");
            RadioButton rBtn_Active = (RadioButton)FormView1.FindControl("rBtn_Active");
            RadioButton rBtn_Inactive = (RadioButton)FormView1.FindControl("rBtn_Inactive");
            Label lbl_StoreStatus = (Label)FormView1.FindControl("lbl_StoreStatus");
            Button btn_Check = (Button)FormView1.FindControl("btn_Check");
            TextBox txt_Comment = (TextBox)FormView1.FindControl("txt_Comment");

            ArrayList ParameterList = new ArrayList();//20091112

            if (SLP_StoreChain1.Text.Trim() != "" && SLP_Store1.Text.Trim() != "")
            {
                ALOModel.MaintainStoreAssignItem BCO = new ALOModel.MaintainStoreAssignItem(ConnectionDB);

                ParameterList.Clear();
                ParameterList.Add(SLP_StoreChain1.Text.Trim());
                ParameterList.Add(SLP_Store1.Text.Trim());

                string strResult = BCO.CheckByChanAndStore(ParameterList);

                vStoreStateDesc = strResult;

                if (vStoreStateDesc != "")
                {
                    rBtn_Active.Checked = false;
                    rBtn_Inactive.Checked = true;
                    boolStoreStateActive = false;
                    lbl_StoreStatus.ForeColor = System.Drawing.Color.Red;
                    btn_Check.Enabled = true;
                }
                else
                {
                    rBtn_Active.Checked = true;
                    rBtn_Inactive.Checked = false;
                    boolStoreStateActive = true;
                    lbl_StoreStatus.ForeColor = System.Drawing.Color.Empty;
                    btn_Check.Enabled = false;
                }


                //////////////////////////////////
                txt_Comment.Text = GetMemoByChanAndStore();
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        #endregion
    }
コード例 #2
0
ファイル: ALO042.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    /// <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
    }
コード例 #3
0
ファイル: ALO061.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    private void CheckByChanAndStore()
    {
        #region
        try
        {
            if (SLP_StoreChain1.Text.Trim() != "" && SLP_Store1.Text.Trim() != "")
            {
                ALOModel.MaintainStoreAssignItem BCO = new ALOModel.MaintainStoreAssignItem(ConnectionDB);

                ArrayList ParameterList = new ArrayList();//20091112
                ParameterList.Clear();
                ParameterList.Add(SLP_StoreChain1.Text.Trim());
                ParameterList.Add(SLP_Store1.Text.Trim());

                string strResult = BCO.CheckByChanAndStore(ParameterList);

                vStoreStateDesc = strResult;
                if (vStoreStateDesc != "")
                {
                    rBtn_Active.Checked = false;
                    rBtn_Inactive.Checked = true;
                    boolStoreStateActive = false;
                    lbl_StoreStatus.ForeColor = System.Drawing.Color.Red;
                    btn_Check.Enabled = true;
                }
                else
                {
                    rBtn_Active.Checked = true;
                    rBtn_Inactive.Checked = false;
                    boolStoreStateActive = true;
                    lbl_StoreStatus.ForeColor = System.Drawing.Color.Empty;
                    btn_Check.Enabled = false;
                }



                //////////////////////////////////
                txt_Comment.Text = GetMemoByChanAndStore();
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        #endregion
    }
コード例 #4
0
ファイル: ALO061.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    /// <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
    }
コード例 #5
0
ファイル: ALO051.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    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
    }
コード例 #6
0
ファイル: TRN161.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    private bool CheckByChanAndStore(string strChanNo, string strStore)
    {
        #region

        bool bResult = false;
        try
        {
            ALOModel.MaintainStoreAssignItem BCO = new ALOModel.MaintainStoreAssignItem(ConnectionDB);
            ArrayList ParameterList = new ArrayList();
            ParameterList.Clear();
            ParameterList.Add(strChanNo);
            ParameterList.Add(strStore);
            string strResult = BCO.CheckByChanAndStore(ParameterList);

            if (strResult.Trim() == "")
            {
                bResult = true;
            }
            else
            {
                bResult = false;
            }

            return bResult;

        }
        catch (Exception ex)
        {
            throw ex;
        }

        #endregion
    }