Exemple #1
0
        protected void btnSaveSPCode_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPCodeWrapper codeWrapper = CodeID;

                SPSClientWrapper client =
                    SPSClientWrapper.FindById(Convert.ToInt32(cmbAssignedClient.SelectedItem.Value));


                DateTime changeDate = System.DateTime.Now;

                int changeUserID = this.CurrentLoginUser.UserID;

                decimal price = Convert.ToDecimal(this.txtPrice.Text.Trim());

                decimal interceptRate = Convert.ToDecimal(this.txtInterceptRate.Text.Trim());

                bool syncData = this.chkSyncData.Checked;

                int sycnNotInterceptCount = Convert.ToInt32(this.txtSycnNotInterceptCount.Text.Trim());

                string sycnRetryTimes = this.txtSycnRetryTimes.Text.Trim();

                SPSDataSycnSettingWrapper dataSycnSetting = null;

                if (syncData)
                {
                    dataSycnSetting = new SPSDataSycnSettingWrapper();

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


                try
                {
                    codeWrapper.ChangeClient(client,
                                             changeDate, changeUserID, price, interceptRate, syncData, sycnNotInterceptCount, sycnRetryTimes, dataSycnSetting
                                             );
                }
                catch (Exception ex)
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                }

                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
        public void SaveClientCodeRelation()
        {
            SPCodeWrapper codeWrapper = SPCodeWrapper.FindById(Convert.ToInt32(cmbCode.SelectedItem.Value));

            DateTime changeDate = System.DateTime.Now;

            int changeUserID = this.ParentPage.CurrentLoginUser.UserID;

            decimal price = Convert.ToDecimal(this.txtPrice.Text.Trim());

            decimal interceptRate = Convert.ToDecimal(this.txtInterceptRate.Text.Trim());

            bool syncData = this.chkSyncData.Checked;

            int sycnNotInterceptCount = Convert.ToInt32(this.txtSycnNotInterceptCount.Text.Trim());

            string sycnRetryTimes = this.txtSycnRetryTimes.Text.Trim();

            SPSDataSycnSettingWrapper dataSycnSetting = null;

            if (syncData)
            {
                dataSycnSetting = new SPSDataSycnSettingWrapper();

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


            try
            {
                codeWrapper.ChangeClient(SPSClientID,
                                         changeDate, changeUserID, price, interceptRate, syncData, sycnNotInterceptCount, sycnRetryTimes, dataSycnSetting
                                         );

                winSPClientCodeRelationAdd.Hide();
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }