protected void btnSaveSPChannel_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPChannelWrapper obj = SPChannelWrapper.FindById(int.Parse(hidId.Text.Trim()));

                if (this.cmbUpperID.SelectedItem != null && this.cmbUpperID.SelectedItem.Value != null && !string.IsNullOrEmpty(this.cmbUpperID.SelectedItem.Value.ToString()))
                {
                    obj.UperID =
                        SPUperWrapper.FindById(Convert.ToInt32(this.cmbUpperID.SelectedItem.Value.ToString()));
                }
                else
                {
                    obj.UperID = null;
                }

                obj.Rate = Convert.ToInt32(numRate.Value);

                obj.Price = Convert.ToDecimal(txtPrice.Value);

                obj.Status = Convert.ToInt32(cmbStatus.SelectedItem.Value);

                SPChannelWrapper.Update(obj);

                winSPChannelEditInfo.Hide();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        protected void btnSaveSPChannel_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPChannelWrapper obj = SPChannelWrapper.FindById(int.Parse(hidId.Text.Trim()));
                obj.Name        = this.txtName.Text.Trim();
                obj.Description = this.txtDescription.Text.Trim();
                obj.Area        = this.txtArea.Text.Trim();

                obj.ChannelCode = this.txtChannelCode.Text.Trim();

                if (this.cmbChannelCodeParamsName.SelectedItem != null)
                {
                    obj.ChannelCodeParamsName = this.cmbChannelCodeParamsName.SelectedItem.Value;
                }
                else
                {
                    obj.ChannelCodeParamsName = "";
                }

                obj.IsAllowNullLinkID = chkIsAllowNullLinkID.Checked;

                obj.FuzzyCommand     = this.txtFuzzyCommand.Text.Trim();
                obj.Port             = this.txtPort.Value.ToString();
                obj.ChannelType      = this.txtChannelType.Text.Trim();
                obj.Price            = Convert.ToDecimal(this.txtPrice.Value);
                obj.Rate             = Convert.ToInt32(this.txtRate.Value);
                obj.Status           = 0;
                obj.OkMessage        = txtOkMessage.Text.Trim();
                obj.FailedMessage    = txtFailedMessage.Text.Trim();
                obj.RecStatReport    = chkRecStatReport.Checked;
                obj.StatParamsName   = txtStatParamName.Text.Trim();
                obj.StatParamsValues = txtStatValues.Text.Trim();

                obj.HasConvertRule = chkHasConvertRule.Checked;

                obj.HasRequestTypeParams = chkHasRequestTypeParams.Checked;
                obj.RequestTypeParamName = txtRequestTypeParamName.Text.Trim();
                obj.RequestTypeValues    = txtRequestTypeValues.Text.Trim();


                obj.HasFilters          = chkHasFilters.Checked;
                obj.StatSendOnce        = chkStatSendOnce.Checked;
                obj.IsMonitoringRequest = chkIsMonitoringRequest.Checked;

                SPChannelWrapper.Update(obj);

                obj.RefreshChannelInfo();

                winSPChannelEdit.Hide();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        protected void btnSaveSPChannel_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPChannelWrapper obj = SPChannelWrapper.FindById(int.Parse(hidId.Text.Trim()));
                obj.Name        = this.txtName.Text.Trim();
                obj.Description = this.txtDecription.Text.Trim();
                obj.Area        = this.txtArea.Text.Trim();

                SPChannelWrapper.Update(obj);

                winSPChannelEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        protected void btnEdit_Click(object sender, DirectEventArgs e)
        {
            try
            {
                SPChannelWrapper channelWrapper = ChannelID;

                channelWrapper.Name              = this.txtName.Text.Trim();
                channelWrapper.Code              = this.txtCode.Text.Trim();
                channelWrapper.Description       = this.txtDescription.Text.Trim();
                channelWrapper.DataOkMessage     = this.txtDataOkMessage.Text.Trim();
                channelWrapper.DataFailedMessage = this.txtDataFailedMessage.Text.Trim();


                if (channelWrapper.ChannelType == DictionaryConst.Dictionary_ChannelType_IVRChannel_Key)
                {
                    channelWrapper.IVRFeeTimeType = cmbIVRType.SelectedItem.Value;
                    channelWrapper.IVRTimeFormat  = this.txtIVRTimeFormat.Text.Trim();
                }

                channelWrapper.IsStateReport = !fsIsStateReport.Collapsed;

                if (channelWrapper.IsStateReport)
                {
                    channelWrapper.StateReportType = ((CheckboxBase)(rdgStateReportType.CheckedItems[0])).InputValue;

                    channelWrapper.StateReportParamName  = this.txtStateReportParamName.Text.Trim();
                    channelWrapper.StateReportParamValue = this.txtStateReportParamValue.Text.Trim();

                    channelWrapper.ReportOkMessage     = this.txtReportOkMessage.Text.Trim();
                    channelWrapper.ReportFailedMessage = this.txtReportFailedMessage.Text.Trim();

                    if (channelWrapper.StateReportType == DictionaryConst.Dictionary_ChannelStateReportType_SendTwiceTypeRequest_Key)
                    {
                        channelWrapper.RequestTypeParamName             = this.txtRequestTypeParamName.Text.Trim();
                        channelWrapper.RequestTypeParamDataReportValue  = this.txtRequestTypeParamDataReportValue.Text.Trim();
                        channelWrapper.RequestTypeParamStateReportValue = this.txtRequestTypeParamStateReportValue.Text.Trim();
                    }
                }

                channelWrapper.IsAutoLinkID = this.chkIsAutoLinkID.Checked;

                if (channelWrapper.IsAutoLinkID)
                {
                    channelWrapper.AutoLinkIDFields = this.txtAutoLinkIDFields.Text.Trim();
                }

                channelWrapper.IsDisable        = false;
                channelWrapper.IsLogRequest     = this.chkIsLogRequest.Checked;
                channelWrapper.IsMonitorRequest = this.chkIsMonitorRequest.Checked;
                channelWrapper.IsParamsConvert  = this.chkIsParamsConvert.Checked;
                channelWrapper.HasFilters       = this.chkHasFilters.Checked;

                SPChannelWrapper.Update(channelWrapper);
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }