public void Show(int id)
        {
            try
            {
                SPClientCodeRelationWrapper obj = SPClientCodeRelationWrapper.FindById(id);

                if (obj != null)
                {
                    this.lblPrice.Text         = obj.Price.ToString();
                    this.lblInterceptRate.Text = obj.InterceptRate.ToString();

                    this.lblSycnRetryTimes.Text = ValueConvertUtil.ConvertStringValue(obj.SycnRetryTimes);

                    if (obj.SyncDataSetting != null)
                    {
                        this.lblSyncType.Text          = ValueConvertUtil.ConvertStringValue(obj.SyncDataSetting.SyncType);
                        this.lblSycnDataUrl.Text       = ValueConvertUtil.ConvertStringValue(obj.SyncDataSetting.SycnMOUrl);
                        this.lblSycnOkMessage.Text     = ValueConvertUtil.ConvertStringValue(obj.SyncDataSetting.SycnMOOkMessage);
                        this.lblSycnFailedMessage.Text = ValueConvertUtil.ConvertStringValue(obj.SyncDataSetting.SycnMOFailedMessage);
                    }
                    else
                    {
                        this.lblSyncType.Text          = "";
                        this.lblSycnDataUrl.Text       = "";
                        this.lblSycnOkMessage.Text     = "";
                        this.lblSycnFailedMessage.Text = "";
                    }


                    this.lblStartDate.Text = obj.StartDate.ToString();
                    this.lblEndDate.Text   = obj.EndDate.ToString();

                    this.lblSycnNotInterceptCount.Text = obj.SycnNotInterceptCount.ToString();
                    this.lblCreateBy.Text     = obj.CreateBy.ToString();
                    this.lblCreateAt.Text     = obj.CreateAt.ToString();
                    this.lblLastModifyBy.Text = obj.LastModifyBy.ToString();
                    this.lblLastModifyAt.Text = obj.LastModifyAt.ToString();



                    //hidLogID.Text = id.ToString();


                    winSPClientCodeRelationView.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "ErrorMessage:Data does not exist";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }
        public void Show(int id)
        {
            try
            {
                SPClientCodeRelationWrapper obj = SPClientCodeRelationWrapper.FindById(id);

                if (obj != null)
                {
                    this.txtChannelID.Text             = obj.CodeID_ChannelID.Name;
                    this.txtCodeID.Text                = obj.CodeID.MoCode;
                    this.txtPrice.Text                 = obj.Price.ToString();
                    this.txtInterceptRate.Text         = obj.InterceptRate.ToString();
                    this.txtSycnNotInterceptCount.Text = obj.SycnNotInterceptCount.ToString();

                    this.chkSyncData.Checked = ValueConvertUtil.ConvertNullableValue <bool>(obj.SyncData);

                    this.txtSycnRetryTimes.Text = ValueConvertUtil.ConvertStringValue(obj.SycnRetryTimes);

                    if (obj.SyncDataSetting != null)
                    {
                        this.txtSycnDataUrl.Text       = ValueConvertUtil.ConvertStringValue(obj.SyncDataSetting.SycnMOUrl);
                        this.txtSycnOkMessage.Text     = ValueConvertUtil.ConvertStringValue(obj.SyncDataSetting.SycnMOOkMessage);
                        this.txtSycnFailedMessage.Text = ValueConvertUtil.ConvertStringValue(obj.SyncDataSetting.SycnMOFailedMessage);
                    }
                    else
                    {
                        this.txtSycnDataUrl.Text       = "";
                        this.txtSycnOkMessage.Text     = "";
                        this.txtSycnFailedMessage.Text = "";
                    }



                    hidId.Text = id.ToString();


                    winSPClientCodeRelationEdit.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "错误信息:数据不存在!";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        protected void btnSaveSPClientCodeRelation_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPClientCodeRelationWrapper obj = SPClientCodeRelationWrapper.FindById(int.Parse(hidId.Text.Trim()));

                if (!ShowForClient)
                {
                    obj.Price                 = Convert.ToDecimal(this.txtPrice.Text.Trim());
                    obj.InterceptRate         = Convert.ToDecimal(this.txtInterceptRate.Text.Trim());
                    obj.SyncData              = this.chkSyncData.Checked;
                    obj.SycnRetryTimes        = this.txtSycnRetryTimes.Text.Trim();
                    obj.SycnNotInterceptCount = Convert.ToInt32(this.txtSycnNotInterceptCount.Text.Trim());
                }

                if (obj.SyncDataSetting == null)
                {
                    obj.SyncDataSetting = new SPSDataSycnSettingWrapper();

                    SPSDataSycnSettingWrapper.Save(obj.SyncDataSetting);
                }


                obj.SyncDataSetting.SycnMOUrl           = this.txtSycnDataUrl.Text.Trim();
                obj.SyncDataSetting.SycnMOOkMessage     = this.txtSycnOkMessage.Text.Trim();
                obj.SyncDataSetting.SycnMOFailedMessage = this.txtSycnFailedMessage.Text.Trim();



                SPClientCodeRelationWrapper.Update(obj);

                winSPClientCodeRelationEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (X.IsAjaxRequest)
            {
                return;
            }

            int clientCodeRelationID = Convert.ToInt32(this.Request.QueryString["ClientCodeRelationID"]);

            SPClientCodeRelationWrapper clientCodeRelation = SPClientCodeRelationWrapper.FindById(clientCodeRelationID);

            if (clientCodeRelation != null)
            {
                this.lblChannelName.Text = clientCodeRelation.CodeID_ChannelID.Name;



                this.lblCode.Text = clientCodeRelation.CodeID.MoCode;

                if (clientCodeRelation.SyncData && clientCodeRelation.SyncDataSetting != null)
                {
                    this.txtClientSycnUrl.Text = clientCodeRelation.SyncDataSetting.SycnMOUrl;

                    this.lblOkMessage.Text = clientCodeRelation.SyncDataSetting.SycnMOOkMessage;
                }



                this.lblClientName.Text = clientCodeRelation.ClientID_Name;

                NameValueCollection sendParams = clientCodeRelation.GetAllSycnParams();

                foreach (string sendParamKey in sendParams.AllKeys)
                {
                    TextField txt = new TextField();
                    txt.ID               = "txt" + sendParamKey;
                    txt.FieldLabel       = sendParamKey;
                    txt.AnchorHorizontal = "95%";

                    if (sendParams[sendParamKey] == DictionaryConst.Dictionary_SPField_LinkID_Key.ToLower() || sendParamKey == DictionaryConst.Dictionary_SPField_LinkID_Key.ToLower())
                    {
                        txt.Value          = "99999" + StringUtil.GetRandNumber(15);
                        txt.DataIndex      = "linkid";
                        hidLinkIDName.Text = txt.ClientID;
                    }

                    if (sendParams[sendParamKey] == DictionaryConst.Dictionary_SPField_Mobile_Key.ToLower() || sendParamKey == DictionaryConst.Dictionary_SPField_Mobile_Key.ToLower())
                    {
                        txt.Value          = "135" + StringUtil.GetRandNumber(8);
                        txt.DataIndex      = "mobile";
                        hidMobileName.Text = txt.ClientID;
                    }

                    if (sendParams[sendParamKey] == DictionaryConst.Dictionary_SPField_SpNumber_Key.ToLower() || sendParamKey == DictionaryConst.Dictionary_SPField_SpNumber_Key.ToLower())
                    {
                        if (!string.IsNullOrEmpty(clientCodeRelation.CodeID.SPCode))
                        {
                            txt.Value = clientCodeRelation.CodeID.SPCode;
                        }
                    }

                    if (sendParams[sendParamKey] == DictionaryConst.Dictionary_SPField_MO_Key.ToLower() || sendParamKey == DictionaryConst.Dictionary_SPField_MO_Key.ToLower())
                    {
                        if (!string.IsNullOrEmpty(clientCodeRelation.CodeID.Mo))
                        {
                            txt.Value = clientCodeRelation.CodeID.Mo;
                        }
                        ;
                    }

                    this.FormPanel1.Items.Add(txt);
                }
            }
        }