コード例 #1
0
ファイル: ALO012.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        #region
        try
        {
            #region 取得畫面元件的值

            string v_DIS_USER = SLP_User1.Text.Trim();
            string v_ROOT_no = SLP_ROOT1.Text.Trim();
            string v_PMA = SLP_PMA1.Text.Trim();
            string v_Pattern = SLP_Pattern1.Text.Trim() == "" ? null : SLP_Pattern1.Text.Trim();
            string v_Item = SLP_SKU1.Text.Trim() == "" ? null : SLP_SKU1.Text.Trim();

            #endregion

            ArrayList ParameterList = new ArrayList();//20091111

            #region 存檔前檢查分類正確性
            ParameterList.Clear();
            ParameterList.Add(v_ROOT_no);
            ParameterList.Add(v_PMA);
            ParameterList.Add(null); //category
            ParameterList.Add(null); //sort_out
            ParameterList.Add(v_Pattern);
            ParameterList.Add(v_Item);
            string vLevel = "1";
            if (v_Pattern != null)
            {
                vLevel = "P";
            }
            if (v_Item != null)
            {
                vLevel = "I";
            }
            ParameterList.Add(vLevel);

            ALOModel.QueryALOCommon alo_comm = new ALOModel.QueryALOCommon(ConnectionDB);
            bool bCheck = alo_comm.CheckItemClassValid(ParameterList);
            if (!bCheck)
            {
                throw new Exception("所輸入的品號/Pattern/大分類/群分類有誤,請確認後重新輸入");
            }
            #endregion
            #region 加入輸入條件

            #region Master
            ParameterList.Clear();
            ParameterList.Add(v_DIS_USER);
            ParameterList.Add(v_ROOT_no);
            ParameterList.Add(v_PMA);
            ParameterList.Add(v_Pattern);
            ParameterList.Add(v_Item);
            #endregion

            #endregion

            ALOModel.MaintinDisPattern BCO = new ALOModel.MaintinDisPattern(ConnectionDB);
            bool bResult = false;
            bResult = BCO.CreateDisPattern(ParameterList, null);

            if (!bResult)
            {
                throw new Exception("新增0筆資料!");
            }
            else
            {
                ResultMsgLabel.Text = "新增完成";
                ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "ClientScript", string.Format("location.replace('ALO011.aspx?dis_user={0}&Code=ALO01');", Session["UID"].ToString().Trim()), true);//alert('新增完成');
            }
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        #endregion
    }
コード例 #2
0
ファイル: ALO013.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        #region
        try
        {

            if (dtMultiSaveClassAndItem.Rows.Count > 0)
            {
                ALOModel.MaintinDisPattern BCO = new ALOModel.MaintinDisPattern(ConnectionDB);
                bool bResult = false;
                bResult = BCO.CreateMultiDissPatterns(dtMultiSaveClassAndItem, null);

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

                    ResultMsgLabel.Text = "新增完成";
                    dtClassAndItemSelected = null;
                    dtClassAndItemSelected_old = null;

                    ScriptManager.RegisterStartupScript(UpdatePanel2, this.GetType(), "ClientScript", string.Format("location.replace('ALO011.aspx?Code={1}&dis_user={0}');", Session["UID"].ToString().Trim(), Request["Code"].ToString()), true);//alert('新增完成');
                }
            }
            else
            {
                ResultMsgLabel.Text = "請先加入Pattern或商品";
                //ScriptManager.RegisterStartupScript(UpdatePanel2, this.GetType(), "ClientScript", "alert('請先加入Pattern或商品');", true);
            }

        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        #endregion
    }
コード例 #3
0
ファイル: ALO013.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    protected void btn_PatternSelect_Click(object sender, EventArgs e)
    {
        #region
        try
        {


            dtMultiSaveClassAndItem = dtClassAndItemSelected;// (DataTable)Session["dtClassAndItemSelected"];
            // 2009-05-10 cyhsu add (加入之前尚未存檔的選擇項目)
            if (dtClassAndItemSelected_old != null && dtClassAndItemSelected == null)
            { dtMultiSaveClassAndItem = dtClassAndItemSelected_old; }

            if (dtMultiSaveClassAndItem.Rows.Count > 0)
            {

                string strWhere = string.Format(" and m.dis_user='******'", SLP_User1.Text.Trim());

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

                ArrayList ParameterList = new ArrayList();//20091111
                ParameterList.Clear();
                ParameterList.Add(strWhere);

                DataTable Dt = BCO.QuerySwitch(ALOModel.MaintinDisPattern.QueryType.Custom, ParameterList);

                if (Dt.Rows.Count > 0)
                {
                    for (Int32 i = dtMultiSaveClassAndItem.Rows.Count - 1; i >= 0; i--)
                    {
                        for (Int32 k = 0; k <= Dt.Rows.Count - 1; k++)
                        {
                            if (dtMultiSaveClassAndItem.Rows[i]["code"].ToString().Trim() == Dt.Rows[k]["code"].ToString().Trim())
                            {
                                dtMultiSaveClassAndItem.Rows.RemoveAt(i);
                                break;
                            }
                        }
                    }
                }
            }

            //2009-05-10 cyhsu add將舊資料存到old
            dtClassAndItemSelected_old = dtMultiSaveClassAndItem;
            //Binding 到GridView
            GridView1.DataSource = dtMultiSaveClassAndItem;
            GridView1.DataBind();
        }
        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
ファイル: 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
    }
コード例 #6
0
ファイル: ALO011.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    protected void btn_Delete_Click(object sender, EventArgs e)
    {
        #region
        try
        {
            Button btn_Delete = sender as Button;

            #region 取得畫面元件的值

            DateTime processtime = DateTime.Now;

            #endregion

            #region 取得刪除前舊值

            DataTable dt = dtQueryViewState;

            if (dt.Rows.Count == 0)
            {
                throw new Exception("抓取不到舊值,更新失敗!");
            }

            #endregion

            #region 加入更新條件

            //master
            ParameterList.Clear();
            //舊值

            for (Int32 i = 0; i <= dt.Rows.Count - 1; i++)
            {
                if (dt.Rows[i]["ID"].ToString() == btn_Delete.CommandArgument)
                {
                    ParameterList.Add(dt.Rows[i]["ID"]);
                    ParameterList.Add(dt.Rows[i]["CODE"]);
                    ParameterList.Add(dt.Rows[i]["NAME"] == null ? null : dt.Rows[i]["NAME"]);
                    ParameterList.Add(dt.Rows[i]["ENABLE"]);
                    ParameterList.Add(dt.Rows[i]["CREATEDATE"]);
                    ParameterList.Add(dt.Rows[i]["CREATEUID"]);
                    ParameterList.Add(dt.Rows[i]["UPDATEDATE"]);
                    ParameterList.Add(dt.Rows[i]["UPDATEUID"]);
                    ParameterList.Add(dt.Rows[i]["DIS_USER"]);
                    ParameterList.Add(dt.Rows[i]["PMA"]);
                    ParameterList.Add(dt.Rows[i]["PATTERN"] == null ? null : dt.Rows[i]["PATTERN"]);
                    ParameterList.Add(dt.Rows[i]["ITEM"] == null ? null : dt.Rows[i]["ITEM"]);
                    ParameterList.Add(dt.Rows[i]["ROOT_NO"]);
                    break;
                }
            }
            //需要更新值
            ParameterList.Add(processtime);
            ParameterList.Add(Session["UID"].ToString());
            #endregion

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

            if (BCO.DeleteMaster(ParameterList, null))
            {
                ResultMsgLabel.Text = "刪除完成";
                //ScriptManager.RegisterStartupScript(UpdatePanel1, this.GetType(), "ClientScript", "alert('刪除完成');", true);
            }

            QueryData();
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        #endregion
    }
コード例 #7
0
ファイル: ALO011.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    /// <summary>
    /// 繫結資料到控制項
    /// </summary>
    private void QueryData()
    {
        #region
        try
        {
            string SessionIDName = string.Format("{0}_{1}", PAGE_DT_01, PageTimeStamp.Value);
            ALOModel.MaintinDisPattern BCO = new ALOModel.MaintinDisPattern(ConnectionDB);

            string strWhere = "";
            strWhere = GetQuerySQLStatement();

            ParameterList.Clear();
            ParameterList.Add(strWhere);

            DataTable dt = BCO.QuerySwitch(ALOModel.MaintinDisPattern.QueryType.Custom, ParameterList);

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

            MasterOLDData.InnerHtml = dt.DataSet.GetXml();
            #endregion

            dtQueryViewState = dt;
            Session[SessionIDName] = dt;

            Int32 iRowCount = 0;

            GridView1.DataSource = dt;
            GridView1.PageSize = (TextBoxPagesize.Text == "") ? 10 : (int.Parse(TextBoxPagesize.Text) <= 0) ? 10 : int.Parse(TextBoxPagesize.Text);
            GridView1.PageIndex = 0;
            GridView1.DataBind();

            if (dt != null && dt.Rows.Count > 0)
            {
                iRowCount = dt.Rows.Count;
            }
            else
            {
                ResultMsgLabel.Text = "查無資料";
            }

            LabelQueryRecordCount.Text = string.Format(" {0} Rows ", iRowCount);
        }
        catch (Exception ex)
        {
            ErrorMsgLabel.Text = ex.Message;
        }
        #endregion
    }
コード例 #8
0
ファイル: ALO031.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);

            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
    }
コード例 #9
0
ファイル: ALO093.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    /// <summary>
    /// 把值傳到Client端
    /// </summary>
    /// <returns></returns>
    public string GetCallbackResult()
    {

        string rtn = "", strResult = "";
        ALOModel.MaintinDisPattern BCO5 = new ALOModel.MaintinDisPattern(ConnectionDB);

        DataTable dt = null;

        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 txtRootNo1 = (TextBox)SLP_RootNo1.FindControl("TextBoxCode");
        TextBox txtPMA1 = (TextBox)SLP_PMA1.FindControl("TextBoxCode");

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


        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, txtPMA2.ClientID, rtn);
            }
        }


        return strResult;
    }
コード例 #10
0
ファイル: ALO091.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);
        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
    }