示例#1
0
        protected void onCreateRule(object sender, AjaxEventArgs e)
        {
            if (ChannleID <= 0)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:ChannelID不存在!";
                return;
            }

            try
            {
                SPChannelWrapper channel = SPChannelWrapper.FindById(ChannleID);

                string rulePath = this.Server.MapPath("~/ConvertRules/" + channel.FuzzyCommand + ".txt");

                if (!File.Exists(rulePath))
                {
                    File.WriteAllText(rulePath, "");
                }

                this.btnCreateRule.Disabled = true;

                Coolite.Ext.Web.ScriptManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message + "!";
                throw;
            }
        }
示例#2
0
        protected void onUpdateCache(object sender, AjaxEventArgs e)
        {
            if (ChannleID <= 0)
            {
                return;
            }

            SPChannelWrapper channel = SPChannelWrapper.FindById(ChannleID);

            this.Cache.Remove(SPRecievedHandler.spsRules + channel.FuzzyCommand);

            string rulePath = this.Server.MapPath("~/ConvertRules/" + channel.FuzzyCommand + ".txt");

            if (!File.Exists(rulePath))
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + "文件‘" + rulePath + "’不存在!";
                return;
            }

            try
            {
                this.Cache.Insert(SPRecievedHandler.spsRules + channel.FuzzyCommand, SPRecievedHandler.GetMethodDelegateFromRecName(rulePath, this.Context), new CacheDependency(rulePath));

                Coolite.Ext.Web.ScriptManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message + "!";
                return;
            }
        }
        public void Show(int id)
        {
            try
            {
                SPChannelWrapper obj = SPChannelWrapper.FindById(id);

                if (obj != null)
                {
                    obj.UpdateChannelDetailInfo();


                    this.winSPChannelView.Title = string.Format("通道“{0}”详细信息", obj.Name);

                    this.lblName.Text = ValueConvertUtil.ConvertStringValue(obj.Name);

                    this.lblChannelDetailInfo.Text = ValueConvertUtil.ConvertStringValue(obj.ChannelDetailInfo);

                    winSPChannelView.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "ErrorMessage:Data does not exist";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "ErrorMessage:" + ex.Message;
                return;
            }
        }
        protected void btnSaveSPChannelParams_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPChannelParamsWrapper obj = new SPChannelParamsWrapper();

                obj.Name              = this.txtName.Text.Trim();
                obj.Description       = this.txtDescription.Text.Trim();
                obj.IsEnable          = this.chkIsEnable.Checked;
                obj.IsRequired        = this.chkIsRequired.Checked;
                obj.ParamsType        = this.cmbParamsType.SelectedItem.Value.Trim();
                obj.ChannelID         = SPChannelWrapper.FindById(Convert.ToInt32(this.hidChannelID.Text.Trim()));
                obj.ParamsMappingName = this.cmbParamsMappingName.SelectedItem.Text.Trim();
                obj.Title             = this.txtTitle.Text.Trim();
                obj.ShowInClientGrid  = this.chkShowInClientGrid.Checked;
                SPChannelParamsWrapper.Save(obj);

                winSPChannelParamsAdd.Hide();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
        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;
            }
        }
        public void Show(int id)
        {
            try
            {
                SPChannelWrapper obj = SPChannelWrapper.FindById(id);

                if (obj != null)
                {
                    this.txtName.Text       = obj.Name.ToString();
                    this.txtDecription.Text = obj.Description.ToString();
                    this.txtArea.Text       = obj.Area.ToString();



                    hidId.Text = id.ToString();


                    winSPChannelEdit.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "错误信息:数据不存在!";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
示例#7
0
        public SPClientChannelSettingWrapper ToWrapper()
        {
            SPClientChannelSettingWrapper wrapper = new SPClientChannelSettingWrapper();

            wrapper.Id                = this.Id;
            wrapper.Name              = this.Name;
            wrapper.Description       = this.Description;
            wrapper.ChannelID         = (this.ChannelID == null) ? null : SPChannelWrapper.FindById(this.ChannelID);
            wrapper.ClinetID          = (this.ClinetID == null) ? null : SPClientWrapper.FindById(this.ClinetID);
            wrapper.InterceptRate     = this.InterceptRate;
            wrapper.UpRate            = this.UpRate;
            wrapper.DownRate          = this.DownRate;
            wrapper.CommandType       = this.CommandType;
            wrapper.CommandCode       = this.CommandCode;
            wrapper.Disable           = this.Disable;
            wrapper.CommandColumn     = this.CommandColumn;
            wrapper.InterceptRateType = this.InterceptRateType;
            wrapper.SyncData          = this.SyncData;
            wrapper.SyncDataUrl       = this.SyncDataUrl;
            wrapper.OkMessage         = this.OkMessage;
            wrapper.FailedMessage     = this.FailedMessage;
            wrapper.SyncType          = this.SyncType;
            wrapper.OrderIndex        = this.OrderIndex;
            wrapper.ChannelCode       = this.ChannelCode;

            return(wrapper);
        }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Ext.IsAjaxRequest)
            {
                return;
            }



            if (ChannleID <= 0)
            {
                return;
            }

            SPChannelWrapper channel = SPChannelWrapper.FindById(ChannleID);

            this.lblRuleTxt.Text = channel.FuzzyCommand + ".txt";

            bool hasRule = channel.HasConvertRule.HasValue && channel.HasConvertRule.Value;

            btnCreateRule.Disabled = true;
            btnUpdate.Disabled     = true;
            btnTestRule.Disabled   = true;

            if (!hasRule)
            {
                this.lblRuleStatus.Text = "该通道不包含规则。";
            }
            else
            {
                string status = "";

                string rulePath = this.Server.MapPath("~/ConvertRules/" + channel.FuzzyCommand + ".txt");

                if (!File.Exists(rulePath))
                {
                    status = "规则文件不存在。";
                    btnCreateRule.Disabled = false;
                }
                else
                {
                    btnUpdate.Disabled = false;

                    object ruleCache = this.Cache[SPRecievedHandler.spsRules + channel.FuzzyCommand];

                    if (ruleCache == null)
                    {
                        status = "规则缓存失效。";
                    }
                    else
                    {
                        btnTestRule.Disabled = false;
                        status = "规则生效。";
                    }
                }

                this.lblRuleStatus.Text = "该通道包含规则,当前规则状态:" + status;
            }
        }
        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;
            }
        }
        public void Show(int id)
        {
            try
            {
                SPChannelWrapper obj = SPChannelWrapper.FindById(id);

                if (obj != null)
                {
                    this.txtName.Text        = ValueConvertUtil.ConvertStringValue(obj.Name);
                    this.txtDescription.Text = ValueConvertUtil.ConvertStringValue(obj.Description);
                    this.txtCode.Text        = ValueConvertUtil.ConvertStringValue(obj.Code);
                    //this.txtRecievedName.Text = ValueConvertUtil.ConvertStringValue(obj.RecievedName);
                    //this.chkIsAllowNullLinkID.Checked = ValueConvertUtil.ConvertNullableValue<bool>(obj.IsAllowNullLinkID);
                    //this.chkIsMonitorRequest.Checked = ValueConvertUtil.ConvertNullableValue<bool>(obj.IsMonitorRequest);
                    //this.chkIsDisable.Checked = ValueConvertUtil.ConvertNullableValue<bool>(obj.IsDisable);
                    //this.txtDataOkMessage.Text = ValueConvertUtil.ConvertStringValue(obj.DataOkMessage);
                    //this.txtDataFailedMessage.Text = ValueConvertUtil.ConvertStringValue(obj.DataFailedMessage);
                    //this.txtReportOkMessage.Text = ValueConvertUtil.ConvertStringValue(obj.ReportOkMessage);
                    //this.txtReportFailedMessage.Text = ValueConvertUtil.ConvertStringValue(obj.ReportFailedMessage);
                    //this.chkStatSendOnce.Checked = ValueConvertUtil.ConvertNullableValue<bool>(obj.StatSendOnce);
                    //this.chkTypeRequest.Checked = ValueConvertUtil.ConvertNullableValue<bool>(obj.TypeRequest);
                    //this.txtDataParamName.Text = ValueConvertUtil.ConvertStringValue(obj.DataParamName);
                    //this.txtDataParamValue.Text = ValueConvertUtil.ConvertStringValue(obj.DataParamValue);
                    //this.txtReportParamName.Text = ValueConvertUtil.ConvertStringValue(obj.ReportParamName);
                    //this.txtReportParamValue.Text = ValueConvertUtil.ConvertStringValue(obj.ReportParamValue);
                    //this.chkHasFilters.Checked = ValueConvertUtil.ConvertNullableValue<bool>(obj.HasFilters);
                    //this.txtStatusParamName.Text = ValueConvertUtil.ConvertStringValue(obj.StatusParamName);
                    //this.txtStatusParamValue.Text = ValueConvertUtil.ConvertStringValue(obj.StatusParamValue);
                    //this.txtPrice.Text = obj.Price.ToString();
                    //this.txtDefaultRate.Text = obj.DefaultRate.ToString();
                    //this.chkHasStatReport.Checked = ValueConvertUtil.ConvertNullableValue<bool>(obj.HasStatReport);
                    this.txtChannelDetailInfo.Text = ValueConvertUtil.ConvertStringValue(obj.ChannelDetailInfo);
                    //this.ddlUpperID.SelectedValue = obj.UpperID.ToString();

                    this.chkIsLogRequest.Checked = ValueConvertUtil.ConvertNullableValue <bool>(obj.IsLogRequest);



                    hidId.Text = id.ToString();


                    winSPChannelEdit.Show();
                }
                else
                {
                    ResourceManager.AjaxSuccess      = false;
                    ResourceManager.AjaxErrorMessage = "ErrorMessage:Data does not exist";
                    return;
                }
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "ErrorMessage:" + ex.Message;
                return;
            }
        }
        protected void storeSPChannelClientSetting_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int channelID = int.Parse(e.Parameters["ChannelID"].ToString());

            SPChannelWrapper channelWrapper = SPChannelWrapper.FindById(channelID);

            storeSPChannelClientSetting.DataSource = channelWrapper.GetAllClientChannelSetting();

            storeSPChannelClientSetting.DataBind();
        }
        private void SetTitle()
        {
            string title = "";

            if (this.ChannleID > 0)
            {
                SPChannelWrapper channelWrapper = SPChannelWrapper.FindById(this.ChannleID);

                if (channelWrapper != null)
                {
                    title += " 通道 " + channelWrapper.Name;
                }
            }
            else
            {
                title += " 全部通道 ";
            }

            if (this.QClientID > 0)
            {
                SPClientWrapper clientWrapper = SPClientWrapper.FindById(this.QClientID);

                if (clientWrapper != null)
                {
                    title += " 下家 " + clientWrapper.Name;
                }
            }
            else
            {
                title += " 全部下家 ";
            }


            if (this.StartDate != DateTime.MinValue)
            {
                title += " 从 " + this.StartDate.ToShortDateString();
            }


            if (this.EndDate != DateTime.MinValue)
            {
                title += " 至 " + this.EndDate.ToShortDateString();
            }
            else
            {
                title += " 至今 ";
            }

            this.GridPanel1.Title = title;
        }
示例#13
0
        protected void storeData_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int    recordCount   = 0;
            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;
            }

            DataTable dt = SPPaymentInfoWrapper.FindAllDataTableByOrderByAndCleintIDAndChanneLIDAndDate(ChannleID, this.SPClientID, Convert.ToDateTime(this.StartDate), Convert.ToDateTime(this.EndDate), DType, "CreateDate", true, pageIndex, limit, out recordCount);

            SPClientWrapper spClientWrapper = SPClientWrapper.FindById(this.SPClientID);

            SPClientChannelSettingWrapper clientChannelSettingWrapper = spClientWrapper.DefaultClientChannelSetting;

            bool isSycnData = (clientChannelSettingWrapper != null && clientChannelSettingWrapper.SyncData.HasValue &&
                               clientChannelSettingWrapper.SyncData.Value);

            if (storeData.Reader.Count == 0)
            {
                storeData.Reader.Add(GetJsonReaderByDataTable(SPChannelWrapper.FindById(this.ChannleID), isSycnData));
            }

            storeData.DataSource = dt;
            e.TotalCount         = recordCount;

            storeData.DataBind();
        }
        protected void storeSPCode_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            if (cmbChannel.SelectedItem != null)
            {
                this.storeSPCode.DataSource = SPCodeWrapper.GetAvaiableCodeForClient(SPChannelWrapper.FindById(Convert.ToInt32(cmbChannel.SelectedItem.Value)), SPSClientID);
            }
            else
            {
                this.storeSPCode.DataSource = new List <SPCodeWrapper>();
            }



            this.storeSPCode.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Ext.IsAjaxRequest)
            {
                return;
            }

            SetTitle();

            storeData.Reader.Add(GetJsonReaderByDataTable(SPChannelWrapper.FindById(this.ChannleID)));

            this.GridPanel1.StoreID = "storeData";

            this.PagingToolBar1.StoreID = "storeData";
        }
        public SPChannelDefaultClientSycnParamsWrapper ToWrapper()
        {
            SPChannelDefaultClientSycnParamsWrapper wrapper = new SPChannelDefaultClientSycnParamsWrapper();

            wrapper.Id            = this.Id;
            wrapper.Name          = this.Name;
            wrapper.Description   = this.Description;
            wrapper.IsEnable      = this.IsEnable;
            wrapper.IsRequired    = this.IsRequired;
            wrapper.ChannelID     = (this.ChannelID == null) ? null : SPChannelWrapper.FindById(this.ChannelID);
            wrapper.MappingParams = this.MappingParams;
            wrapper.Title         = this.Title;

            return(wrapper);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Ext.IsAjaxRequest)
            {
                return;
            }

            int channelID = Convert.ToInt32(this.Request.QueryString["ChannleID"]);

            SPChannelWrapper channelWrapper = SPChannelWrapper.FindById(channelID);

            this.hidChannelID.Text = channelWrapper.Id.ToString();

            this.txtChannelName.Text = channelWrapper.Name;

            this.txtChannelSubmitUrl.Text = channelWrapper.InterfaceUrl;

            this.lblChannelCode.Text = channelWrapper.ChannelCode;

            List <SPChannelParamsWrapper> channelParamsWrappers = channelWrapper.GetAllEnableParams();

            foreach (SPChannelParamsWrapper spChannelParamsWrapper in channelParamsWrappers)
            {
                Anchor anchor = new Anchor();
                anchor.Horizontal = "95%";
                TextField txt = new TextField();
                txt.ID         = "txt" + spChannelParamsWrapper.Name;
                txt.FieldLabel = spChannelParamsWrapper.Name;

                if (spChannelParamsWrapper.ParamsMappingName == "linkid")
                {
                    txt.Value = "test" + StringUtil.GetRandNumber(10);

                    hidLinkIDeName.Text = txt.ClientID;
                }

                if (spChannelParamsWrapper.ParamsMappingName == "mobile")
                {
                    txt.Value = "135" + StringUtil.GetRandNumber(8);

                    hidMobileName.Text = txt.ClientID;
                }

                anchor.Items.Add(txt);
                this.FormLayout1.Anchors.Add(anchor);
            }
        }
        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.txtDescription.Text.Trim();
                obj.Code        = this.txtCode.Text.Trim();

                //obj.RecievedName = this.txtRecievedName.Text.Trim();
                //obj.IsAllowNullLinkID = this.chkIsAllowNullLinkID.Checked;
                obj.IsMonitorRequest    = this.chkIsMonitorRequest.Checked;
                obj.IsDisable           = this.chkIsDisable.Checked;
                obj.DataOkMessage       = this.txtDataOkMessage.Text.Trim();
                obj.DataFailedMessage   = this.txtDataFailedMessage.Text.Trim();
                obj.ReportOkMessage     = this.txtReportOkMessage.Text.Trim();
                obj.ReportFailedMessage = this.txtReportFailedMessage.Text.Trim();
                //obj.StatSendOnce = this.chkStatSendOnce.Checked;
                //obj.TypeRequest = this.chkTypeRequest.Checked;
                //obj.DataParamName = this.txtDataParamName.Text.Trim();
                //obj.DataParamValue = this.txtDataParamValue.Text.Trim();
                //obj.ReportParamName = this.txtReportParamName.Text.Trim();
                //obj.ReportParamValue = this.txtReportParamValue.Text.Trim();
                obj.HasFilters = this.chkHasFilters.Checked;
                //obj.StatusParamName = this.txtStatusParamName.Text.Trim();
                //obj.StatusParamValue = this.txtStatusParamValue.Text.Trim();
                obj.Price       = Convert.ToDecimal(this.txtPrice.Text.Trim());
                obj.DefaultRate = Convert.ToDecimal(this.txtDefaultRate.Text.Trim());
                //obj.HasStatReport = this.chkHasStatReport.Checked;
                obj.ChannelDetailInfo = this.txtChannelDetailInfo.Text.Trim();
                //obj.UpperID = Convert.ToInt32(this.ddlUpperID.SelectedValue.Trim());
                obj.IsLogRequest = this.chkIsLogRequest.Checked;


                SPChannelWrapper.UpdateRecord(obj, this.ParentPage.CurrentLoginUser.UserID, System.DateTime.Now, "用户{0}于{1}时间编辑通道。");

                winSPChannelEdit.Hide();
                ResourceManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ResourceManager.AjaxSuccess      = false;
                ResourceManager.AjaxErrorMessage = "Error Message:" + ex.Message;
                return;
            }
        }
示例#19
0
        private void BindData()
        {
            ReportViewer1.LocalReport.EnableHyperlinks = true;

            DataTable tb = SPDayReportWrapper.GetProvinceReport(StartDate, EndDate, ReportChannleID, ReportClientChannleID);

            ReportDataSource rds = new ReportDataSource("DataSet1", tb);

            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(rds);

            string reportName = string.Format("【{0}】-【{1}】数据省份分部报表", StartDate.ToString("yyyy-MM-dd"), EndDate.ToString("yyyy-MM-dd"));

            if (ReportChannleID == 0)
            {
                reportName = "全平台" + reportName;
            }
            else
            {
                SPChannelWrapper channel = SPChannelWrapper.FindById(ReportChannleID);

                if (ReportClientChannleID == 0)
                {
                    reportName = string.Format("通道【{0}】", channel.Name) + reportName;
                }
                else
                {
                    SPClientChannelSettingWrapper clientChannelSetting = SPClientChannelSettingWrapper.FindById(ReportClientChannleID);

                    reportName = string.Format("通道【{0}】", channel.Name) + string.Format("指令【{0}】", clientChannelSetting.MoCode) + reportName;
                }
            }

            ReportParameter rpReportName = new ReportParameter();

            rpReportName.Name = "ReportName";
            rpReportName.Values.Add(reportName);


            ReportViewer1.LocalReport.SetParameters(
                new ReportParameter[] { rpReportName });


            ReportViewer1.LocalReport.Refresh();
        }
        public void Show(int channelID)
        {
            try
            {
                SPChannelWrapper spChannelWrapper = SPChannelWrapper.FindById(channelID);

                this.hidChannelID.Text = channelID.ToString();

                this.lblChannelName.Text = spChannelWrapper.Name;

                this.winSPChannelParamsAdd.Show();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
        public SPChannelParamsWrapper ToWrapper()
        {
            SPChannelParamsWrapper wrapper = new SPChannelParamsWrapper();

            wrapper.Id                = this.Id;
            wrapper.Name              = this.Name;
            wrapper.Description       = this.Description;
            wrapper.IsEnable          = this.IsEnable;
            wrapper.IsRequired        = this.IsRequired;
            wrapper.ParamsType        = this.ParamsType;
            wrapper.ChannelID         = (this.ChannelID == null) ? null : SPChannelWrapper.FindById(this.ChannelID);
            wrapper.ParamsMappingName = this.ParamsMappingName;
            wrapper.Title             = this.Title;
            wrapper.ShowInClientGrid  = this.ShowInClientGrid;
            wrapper.IsUnique          = this.IsUnique;

            return(wrapper);
        }
示例#22
0
        public void Show(int id)
        {
            try
            {
                this.hidChannelSelect.Text = id.ToString();

                SPChannelWrapper channelWrapper = SPChannelWrapper.FindById(id);

                this.winSPChannelParamsList.Title = "[" + channelWrapper.Name + "]通道参数管理";
                this.winSPChannelParamsList.Show();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
示例#23
0
        protected void storeSPChannelClientSetting_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            if (!string.IsNullOrEmpty(e.Parameters["ChannelID"]))
            {
                int channelID = int.Parse(e.Parameters["ChannelID"].ToString());

                SPChannelWrapper channelWrapper = SPChannelWrapper.FindById(channelID);

                storeSPChannelClientSetting.DataSource = SPClientChannelSettingWrapper.GetSettingByChannel(channelWrapper);

                storeSPChannelClientSetting.DataBind();
            }
            else
            {
                storeSPChannelClientSetting.DataSource = new List <SPClientChannelSettingWrapper>();

                storeSPChannelClientSetting.DataBind();
            }
        }
示例#24
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";

            List <SPClientWrapper> clients = new List <SPClientWrapper>();

            if (context.Request.QueryString["DataType"] == "GetChannelSycnClient")
            {
                int channelID = 0;

                if (context.Request.QueryString["ChannleID"] != null)
                {
                    channelID = Convert.ToInt32(context.Request.QueryString["ChannleID"]);

                    if (channelID > 0)
                    {
                        List <SPClientChannelSettingWrapper> settings = SPChannelWrapper.FindById(channelID).GetAllClientChannelSetting();

                        foreach (SPClientChannelSettingWrapper spClientChannelSettingWrapper in settings)
                        {
                            int  cid      = spClientChannelSettingWrapper.ClinetID.Id;
                            bool sycnData = spClientChannelSettingWrapper.SyncData.HasValue &&
                                            spClientChannelSettingWrapper.SyncData.Value;

                            bool hasSycnDataUrl = !string.IsNullOrEmpty(spClientChannelSettingWrapper.SyncDataUrl);

                            if (!clients.Exists(p => (p.Id == cid)) && sycnData && hasSycnDataUrl)
                            {
                                clients.Add(spClientChannelSettingWrapper.ClinetID);
                            }
                        }
                    }
                }
            }

            if (context.Request.QueryString["DataType"] == null || string.IsNullOrEmpty(context.Request.QueryString["DataType"]))
            {
                clients = SPClientWrapper.FindAll();
            }

            context.Response.Write(string.Format("{{total:{1},'clients':{0}}}", JSON.Serialize(clients), clients.Count));
        }
        protected void storeData_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int    recordCount   = 0;
            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;
            }

            DataTable dt = SPPaymentInfoWrapper.FindAllDataTableByOrderByAndCleintIDAndChanneLIDAndDateNoIntercept(ChannleID, this.SPClientID, Convert.ToDateTime(this.StartDate), Convert.ToDateTime(this.EndDate), "", false, pageIndex, limit, out recordCount);

            if (storeData.Reader.Count == 0)
            {
                storeData.Reader.Add(GetJsonReaderByDataTable(SPChannelWrapper.FindById(this.ChannleID)));
            }

            storeData.DataSource = dt;
            e.TotalCount         = recordCount;

            storeData.DataBind();
        }
        protected void storeSPCode_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            SPChannelWrapper channel = null;

            if (this.cmbChannel.SelectedItem != null)
            {
                channel = SPChannelWrapper.FindById(Convert.ToInt32(this.cmbChannel.SelectedItem.Value));
            }

            if (channel != null)
            {
                this.storeSPCode.DataSource = SPCodeWrapper.FindAllByChannelID(channel);
            }
            else
            {
                this.storeSPCode.DataSource = new List <SPCodeWrapper>();
            }

            this.storeSPCode.DataBind();
        }
示例#27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Ext.IsAjaxRequest)
            {
                return;
            }

            SPClientWrapper spClientWrapper = SPClientWrapper.FindById(this.SPClientID);

            SPClientChannelSettingWrapper clientChannelSettingWrapper = spClientWrapper.DefaultClientChannelSetting;

            bool isSycnData = (clientChannelSettingWrapper != null && clientChannelSettingWrapper.SyncData.HasValue &&
                               clientChannelSettingWrapper.SyncData.Value);

            storeData.Reader.Add(GetJsonReaderByDataTable(SPChannelWrapper.FindById(this.ChannleID), isSycnData));

            this.GridPanel1.StoreID = "storeData";

            this.PagingToolBar1.StoreID = "storeData";
        }
示例#28
0
        protected void onTestRule(object sender, AjaxEventArgs e)
        {
            if (ChannleID <= 0)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:ChannelID不存在!";
                return;
            }

            try
            {
                SPChannelWrapper channel = SPChannelWrapper.FindById(ChannleID);

                object ruleCache = this.Cache[SPRecievedHandler.spsRules + channel.FuzzyCommand];

                string urlParams = this.txtUlr.Text.Trim();

                Uri url = new Uri(channel.InterfaceUrl + urlParams);

                Hashtable hb = new Hashtable();

                NameValueCollection col = GetQueryString(url.Query);

                foreach (string key in col.AllKeys)
                {
                    hb.Add(key.ToLower(), col[key]);
                }

                MethodDelegate processMethod = ruleCache as MethodDelegate;

                processMethod(hb);

                this.txtResult.Text = JsonConvert.SerializeObject(hb);

                Coolite.Ext.Web.ScriptManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                this.txtResult.Text = "转换失败,错误信息:" + ex.Message;
            }
        }
        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;
            }
        }
示例#30
0
        public SPPaymentInfoWrapper ToWrapper()
        {
            SPPaymentInfoWrapper wrapper = new SPPaymentInfoWrapper();

            wrapper.Id              = this.Id;
            wrapper.MobileNumber    = this.MobileNumber;
            wrapper.ChannelID       = (this.ChannelID == null) ? null : SPChannelWrapper.FindById(this.ChannelID);
            wrapper.ClientID        = (this.ClientID == null) ? null : SPClientWrapper.FindById(this.ClientID);
            wrapper.Message         = this.Message;
            wrapper.IsIntercept     = this.IsIntercept;
            wrapper.CreateDate      = this.CreateDate;
            wrapper.Cpid            = this.Cpid;
            wrapper.Mid             = this.Mid;
            wrapper.Port            = this.Port;
            wrapper.Ywid            = this.Ywid;
            wrapper.Linkid          = this.Linkid;
            wrapper.Dest            = this.Dest;
            wrapper.Price           = this.Price;
            wrapper.Ip              = this.Ip;
            wrapper.SucesssToSend   = this.SucesssToSend;
            wrapper.ExtendField1    = this.ExtendField1;
            wrapper.ExtendField2    = this.ExtendField2;
            wrapper.ExtendField3    = this.ExtendField3;
            wrapper.ExtendField4    = this.ExtendField4;
            wrapper.ExtendField5    = this.ExtendField5;
            wrapper.ExtendField6    = this.ExtendField6;
            wrapper.ExtendField7    = this.ExtendField7;
            wrapper.ExtendField8    = this.ExtendField8;
            wrapper.IsReport        = this.IsReport;
            wrapper.RequestContent  = this.RequestContent;
            wrapper.City            = this.City;
            wrapper.Province        = this.Province;
            wrapper.IsTestData      = this.IsTestData;
            wrapper.ChannleClientID = this.ChannleClientID;
            wrapper.IsSycnData      = this.IsSycnData;
            wrapper.SSycnDataUrl    = this.SSycnDataUrl;
            wrapper.SycnRetryTimes  = this.SycnRetryTimes;

            return(wrapper);
        }