コード例 #1
0
ファイル: ALO051.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    /// <summary>
    /// 把值傳到Client端
    /// </summary>
    /// <returns></returns>
    public string GetCallbackResult()
    {
        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.QueryALOCommon BCOCommon = new ALOModel.QueryALOCommon(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();
            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
        }
        else if (ObjectFrom.IndexOf("ITEM") != -1)
        {
            #region
            ArrayList ParameterList2 = new ArrayList();
            ParameterList2.Clear();
            ParameterList2.Add((CallServerValue.Split(";".ToCharArray()))[0]);
            ParameterList2.Add((CallServerValue.Split(";".ToCharArray()))[1]);
            ParameterList2.Add("");

            rtn = BCOCommon.GetMaxUnIssuancePeriod(ParameterList2);



            #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);

            }
        }
        else if (ObjectFrom.IndexOf("ITEM") != -1)
        {

            TextBox txtPeriodSt = (TextBox)SLP_ItemPeriod5.FindControl("TextBoxCode");

            strResult = string.Format("{0},{1}",
                        txtPeriodSt.UniqueID,
                        rtn);

        }

        return strResult;
    }
コード例 #2
0
ファイル: ALO051.aspx.cs プロジェクト: ChiangHanLung/PIC_VDS
    private string GetItemValueByPageMethod(string CallServerValue)
    {
        #region 
        ALOModel.QueryALOCommon BCOCommon = new ALOModel.QueryALOCommon(ConnectionDB);
        string rtn = "";
        try
        {
            ArrayList ParameterList = new ArrayList();
            ParameterList.Clear();
            ParameterList.Add((CallServerValue.Split(";".ToCharArray()))[0]);
            ParameterList.Add((CallServerValue.Split(";".ToCharArray()))[1]);
            ParameterList.Add("");
            rtn = BCOCommon.GetMaxUnIssuancePeriod(ParameterList);
        }
        catch (Exception ex)
        {
            throw ex;
        }
        finally
        {
            BCOCommon.CloseConnection();
        }

        return rtn;

        #endregion
    }