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;
            }
        }
Exemplo n.º 4
0
        protected void storeSPClientCodeRelation_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            string sortFieldName = "";

            if (e.Sort != null)
            {
                sortFieldName = e.Sort;
            }

            int startIndex = 0;

            if (e.Start > -1)
            {
                startIndex = e.Start;
            }

            int limit = this.PagingToolBar1.PageSize;

            int pageIndex = 1;

            if ((startIndex % limit) == 0)
            {
                pageIndex = startIndex / limit + 1;
            }
            else
            {
                pageIndex = startIndex / limit;
            }


            PageQueryParams pageQueryParams = new PageQueryParams();

            pageQueryParams.PageSize  = limit;
            pageQueryParams.PageIndex = pageIndex;

            storeSPClientCodeRelation.DataSource = SPClientCodeRelationWrapper.FindAllByOrderByAndFilterAndClientID(sortFieldName, (e.Dir == Ext.Net.SortDirection.DESC), Client, pageQueryParams);
            e.Total = pageQueryParams.RecordCount;

            storeSPClientCodeRelation.DataBind();
        }
        public void SaveClientCodeRelation()
        {
            SPCodeWrapper codeWrapper = SPCodeWrapper.FindById(Convert.ToInt32(cmbCode.SelectedItem.Value));

            if (codeWrapper.ClientCodeRelation != null)
            {
                if (codeWrapper.ClientCodeRelation.ClientID.Id == SPSClientID.Id)
                {
                    return;
                }

                codeWrapper.ClientCodeRelation.IsEnable = false;
                codeWrapper.ClientCodeRelation.EndDate  = System.DateTime.Now;

                SPClientCodeRelationWrapper.Update(codeWrapper.ClientCodeRelation);
            }

            try
            {
                SPClientCodeRelationWrapper obj = new SPClientCodeRelationWrapper();

                obj.Price         = Convert.ToDecimal(this.txtPrice.Text.Trim());
                obj.InterceptRate = Convert.ToDecimal(this.txtInterceptRate.Text.Trim());
                obj.UseClientDefaultSycnSetting = false;
                obj.SyncData       = this.chkSyncData.Checked;
                obj.ClientID       = SPSClientID;
                obj.CodeID         = codeWrapper;
                obj.SycnRetryTimes = this.txtSycnRetryTimes.Text.Trim();

                if (obj.SyncData)
                {
                    SPSDataSycnSettingWrapper spsDataSycnSetting = new SPSDataSycnSettingWrapper();

                    spsDataSycnSetting.SycnMO              = true;
                    spsDataSycnSetting.SyncType            = "1";
                    spsDataSycnSetting.SycnMOUrl           = this.txtSycnDataUrl.Text.Trim();
                    spsDataSycnSetting.SycnMOOkMessage     = this.txtSycnOkMessage.Text.Trim();
                    spsDataSycnSetting.SycnMOFailedMessage = this.txtSycnFailedMessage.Text.Trim();

                    SPSDataSycnSettingWrapper.Save(spsDataSycnSetting);

                    obj.SyncDataSetting = spsDataSycnSetting;
                }

                obj.StartDate             = System.DateTime.Now;
                obj.EndDate               = null;
                obj.IsEnable              = true;
                obj.SycnNotInterceptCount = Convert.ToInt32(this.txtSycnNotInterceptCount.Text.Trim());
                obj.CreateBy              = this.ParentPage.CurrentLoginUser.UserID;
                obj.CreateAt              = System.DateTime.Now;
                obj.LastModifyBy          = this.ParentPage.CurrentLoginUser.UserID;
                obj.LastModifyAt          = System.DateTime.Now;


                SPClientCodeRelationWrapper.Save(obj);

                winSPClientCodeRelationAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Exemplo n.º 6
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);
                }
            }
        }
 protected void storeSPCode_Refresh(object sender, StoreRefreshDataEventArgs e)
 {
     this.storeSPCode.DataSource = SPClientCodeRelationWrapper.GetAllCodeByClient(this.Client);
     this.storeSPCode.DataBind();
 }