Exemple #1
0
        private void BindData()
        {
            ReportViewer1.LocalReport.EnableHyperlinks = true;

            DataTable tb = SPDayReportWrapper.GetProvinceReportForClientGroup(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
            {
                SPClientGroupWrapper channel = SPClientGroupWrapper.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();
        }
        protected void btnSPClientChannelQuery_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPClientChannelSettingWrapper obj = SPClientChannelSettingWrapper.FindById(int.Parse(hidId.Text.Trim()));

                int dataCount  = obj.QueryDataCount(dfStart.SelectedDate, dfEnd.SelectedDate, chkIncludeSubCode.Checked, chkAfterIntercept.Checked);
                int phoneCount = obj.QueryPhoneCount(dfStart.SelectedDate, dfEnd.SelectedDate, chkIncludeSubCode.Checked, chkAfterIntercept.Checked);

                this.lblResult.Text = string.Format("总数:{0},用户数{1}", dataCount, phoneCount);
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        public void Show()
        {
            try
            {
                SPClientChannelSettingWrapper spClientChannelSettingWrapper = SPClientChannelSettingWrapper.FindById(ChannleClientID);

                this.hidClientID.Text = spClientChannelSettingWrapper.Id.ToString();

                this.lblClientName.Text = spClientChannelSettingWrapper.Name;

                this.winSPSendClientParamsAdd.Show();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Exemple #4
0
        public string GetAllClientChannelSendWebDomain(int clientChannleID)
        {
            SPClientChannelSettingWrapper channelSettingWrapper = SPClientChannelSettingWrapper.FindById(clientChannleID);

            if (channelSettingWrapper == null)
            {
                return("");
            }

            if (string.IsNullOrEmpty(channelSettingWrapper.SyncDataUrl))
            {
                return("");
            }

            Uri uri = new Uri(channelSettingWrapper.SyncDataUrl);

            return(uri.Host);
        }
Exemple #5
0
        public void Show(int id)
        {
            try
            {
                SPClientChannelSettingWrapper obj = SPClientChannelSettingWrapper.FindById(id);

                if (obj != null)
                {
                    this.lblChannelName.Text = obj.ChannelName;

                    this.lblClientName.Text = obj.ClientName;

                    this.lblClientName.Text = obj.ClientGroupName;

                    this.lblName.Text = obj.Name;

                    this.lblChannelClientCode.Text = obj.ChannelClientCode;

                    this.txtAllowAndDisableArea.Text = obj.AllowAndDisableArea;
                    this.txtGetway.Text     = obj.Getway;
                    this.txtDayLimit.Text   = obj.DayLimit;
                    this.txtMonthLimit.Text = obj.MonthLimit;
                    this.txtSendText.Text   = obj.SendText;



                    hidId.Text = id.ToString();

                    winSPClientChannelSettingInfoEdit.Show();
                }
                else
                {
                    ScriptManager.AjaxSuccess      = false;
                    ScriptManager.AjaxErrorMessage = "错误信息:数据不存在";
                    return;
                }
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        public void RefreshPage()
        {
            int clientChannleID = Convert.ToInt32(this.Request.QueryString["ClientChannelID"]);

            SPClientChannelSettingWrapper obj = SPClientChannelSettingWrapper.FindById(clientChannleID);


            this.lblChannleName.Text = obj.ChannelName;
            this.lblClientName.Text  = obj.ClientName;


            int downCount = SPPaymentInfoWrapper.FindAllPaymentCountByDateAndType(System.DateTime.Now.Date,
                                                                                  System.DateTime.Now.Date,
                                                                                  clientChannleID,
                                                                                  DataType.Down.ToString());

            int downSycnCount = SPPaymentInfoWrapper.FindAllPaymentCountByDateAndType(System.DateTime.Now.Date,
                                                                                      System.DateTime.Now.Date,
                                                                                      clientChannleID,
                                                                                      DataType.DownSycn.ToString());


            int downNotSycn = SPPaymentInfoWrapper.FindAllPaymentCountByDateAndType(System.DateTime.Now.Date,
                                                                                    System.DateTime.Now.Date,
                                                                                    clientChannleID,
                                                                                    DataType.DownNotSycn.ToString());

            int sycnFailed = SPPaymentInfoWrapper.FindAllPaymentCountByDateAndType(System.DateTime.Now.Date,
                                                                                   System.DateTime.Now.Date,
                                                                                   clientChannleID,
                                                                                   DataType.SycnFailed.ToString());



            this.lblDownCount.Text        = downCount.ToString();
            this.lblSycnCount.Text        = downSycnCount.ToString();
            this.lblDownNotSycnCount.Text = downNotSycn.ToString();
            this.lblSycnFailedCount.Text  = sycnFailed.ToString();

            this.btnReSendDown.Disabled        = (downCount <= 0);
            this.btnReSendSycn.Disabled        = (downSycnCount <= 0);
            this.btnReSendDownNotSycn.Disabled = (downNotSycn <= 0);
            this.btnReSendSycnFailed.Disabled  = (sycnFailed <= 0);
        }
        protected void btnSaveSPClient_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPClientChannelSettingWrapper obj = SPClientChannelSettingWrapper.FindById(int.Parse(hidId.Text.Trim()));

                string clientName   = this.txtClientName.Text.Trim();
                string clientAlias  = this.txtClientAlias.Text.Trim();
                string userID       = this.txtLoginUserID.Text.Trim();
                string userPassword = this.txtLoginPassword.Text.Trim();

                //if (SPClientWrapper.FindByName(clientName) != null)
                //{
                //    Coolite.Ext.Web.ScriptManager.AjaxSuccess = false;
                //    Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:存在同名的下家";
                //}

                if (SystemUserWrapper.GetUserByLoginID(userID) != null)
                {
                    Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                    Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:存在同名的登陆用户";

                    return;
                }

                int loginUserID = AddClientUser(userID, userPassword);

                int newclientID = obj.ChangeClientUser(clientName, clientAlias, userID, loginUserID);

                SPClientWrapper clientWrapper = SPClientWrapper.FindById(newclientID);

                if (obj.DefaultClientPrice.HasValue)
                {
                    clientWrapper.SetClientPrice(obj.DefaultClientPrice.Value);
                }

                winSPClientChannelSettingChangeClientAndUser.Hide();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Exemple #8
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();
            }
        }
Exemple #9
0
        public List <SPSSendUrlEntity> GetAllClientChannelNeedSendData(int maxDataCount, int maxAllDataCount)
        {
            this.Server.ScriptTimeout = 360;

            List <SPSSendUrlEntity> sendUrlEntities = new List <SPSSendUrlEntity>();

            List <SPClientChannelSettingWrapper> allNeedResendChannleClientSetting = SPClientChannelSettingWrapper.GetAllNeedRendSetting();

            int dataCount = 0;

            foreach (SPClientChannelSettingWrapper channelSetting in allNeedResendChannleClientSetting)
            {
                List <SPPaymentInfoWrapper> spReSendPaymentInfos = SPPaymentInfoWrapper.FindAllNotSendData(channelSetting.ChannelID.Id,
                                                                                                           channelSetting.ClinetID.Id, System.DateTime.Now.Date,
                                                                                                           System.DateTime.Now.Date, maxDataCount);

                foreach (SPPaymentInfoWrapper reSendPaymentInfo in spReSendPaymentInfos)
                {
                    if (!reSendPaymentInfo.IsIntercept.HasValue)
                    {
                        continue;
                    }

                    if (reSendPaymentInfo.IsIntercept.Value)
                    {
                        continue;
                    }

                    SPSSendUrlEntity sendUrlEntity = PaymentToSendUrlEntity(reSendPaymentInfo);

                    sendUrlEntities.Add(sendUrlEntity);

                    dataCount++;

                    if (dataCount >= maxAllDataCount)
                    {
                        return(sendUrlEntities);
                    }
                }
            }

            return(sendUrlEntities);
        }
Exemple #10
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";
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";

            List <SystemUserWrapper> users = SPClientChannelSettingWrapper.GetAvailableUser();

            //string clientID = context.Request.QueryString["ClinetID"];

            //if (string.IsNullOrEmpty(clientID))
            //{
            //    users = new List<SystemUserWrapper>();
            //}
            //else
            //{
            //    int cid = int.Parse(clientID);

            //    users = SPClientChannelSettingWrapper.GetAvailableUser(0,cid);

            //}

            context.Response.Write(string.Format("{{total:{1},'users':{0}}}", JSON.Serialize(users), users.Count));
        }
        protected void btnSaveSPSendClientParams_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPClientChannelSycnParamsWrapper obj = new SPClientChannelSycnParamsWrapper();
                obj.Name                   = this.txtName.Text.Trim();
                obj.Description            = this.txtDescription.Text.Trim();
                obj.IsEnable               = this.chkIsEnable.Checked;
                obj.IsRequired             = this.chkIsRequired.Checked;
                obj.ClientChannelSettingID = SPClientChannelSettingWrapper.FindById(Convert.ToInt32(this.hidClientID.Text.Trim()));
                obj.MappingParams          = this.cmbMappingParams.SelectedItem.Value.Trim();
                obj.Title                  = this.txtTitle.Text.Trim();
                SPClientChannelSycnParamsWrapper.Save(obj);

                winSPSendClientParamsAdd.Hide();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Exemple #13
0
        public void ShowAddSub(int id, string subCode)
        {
            try
            {
                SPClientChannelSettingWrapper channelSettingWrapper = SPClientChannelSettingWrapper.FindById(id);

                if (channelSettingWrapper.CommandType != "3")
                {
                    Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                    Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:只有模糊指令才可以加子代码";
                    return;
                }

                this.winSPChannelClientSetingQuickAdd.Title = "为指令“{0}”快速添加子指令";

                this.txtLoginID.Text = channelSettingWrapper.ClinetID.UserLoginID + subCode;

                this.cmbCodeType.Disabled      = true;
                this.cmbCodeType.SelectedIndex = 1;

                this.txtCode.Text = channelSettingWrapper.CommandCode + subCode;

                this.numOrderIndex.Text = (channelSettingWrapper.OrderIndex + 1).ToString();

                this.txtChannelCode.Text = channelSettingWrapper.ChannelCode;

                this.chkHasSubCode.Checked = false;

                this.txtSubCode.Text = "";

                this.winSPChannelClientSetingQuickAdd.Show();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Exemple #14
0
        protected void btnSaveSPClientChannelSettingFilters_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPClientChannelSettingFiltersWrapper obj = new SPClientChannelSettingFiltersWrapper();
                obj.ParamsName             = "province";
                obj.FilterType             = "eq";
                obj.FilterValue            = this.cmbFilterProvince.SelectedItem.Text.Trim();
                obj.IsEnable               = true;
                obj.ClientChannelSettingID = SPClientChannelSettingWrapper.FindById(ChannleClientID);



                SPClientChannelSettingFiltersWrapper.Save(obj);

                winSPClientChannelSettingFiltersAdd.Hide();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Exemple #15
0
 public void FromWrapper(SPClientChannelSettingWrapper wrapper)
 {
     this.Id                = wrapper.Id;
     this.Name              = wrapper.Name;
     this.Description       = wrapper.Description;
     this.ChannelID         = (wrapper.ChannelID != null) ? wrapper.ChannelID.Id : 0;
     this.ClinetID          = (wrapper.ClinetID != null) ? wrapper.ClinetID.Id : 0;
     this.InterceptRate     = wrapper.InterceptRate;
     this.UpRate            = wrapper.UpRate;
     this.DownRate          = wrapper.DownRate;
     this.CommandType       = wrapper.CommandType;
     this.CommandCode       = wrapper.CommandCode;
     this.Disable           = wrapper.Disable;
     this.CommandColumn     = wrapper.CommandColumn;
     this.InterceptRateType = wrapper.InterceptRateType;
     this.SyncData          = wrapper.SyncData;
     this.SyncDataUrl       = wrapper.SyncDataUrl;
     this.OkMessage         = wrapper.OkMessage;
     this.FailedMessage     = wrapper.FailedMessage;
     this.SyncType          = wrapper.SyncType;
     this.OrderIndex        = wrapper.OrderIndex;
     this.ChannelCode       = wrapper.ChannelCode;
 }
        public void Show(int id)
        {
            try
            {
                SPClientChannelSettingWrapper obj = SPClientChannelSettingWrapper.FindById(id);

                if (obj != null)
                {
                    this.lblChannelClientCode.Text = obj.ChannelClientCode;

                    this.lblChannelName.Text = obj.ChannelName;

                    this.lblClientGroupName.Text = obj.ClientGroupName;

                    this.lblName.Text = obj.Name;

                    this.lblResult.Text = "";

                    hidId.Text = id.ToString();

                    winSPClientChannelQuery.Show();
                }
                else
                {
                    ScriptManager.AjaxSuccess      = false;
                    ScriptManager.AjaxErrorMessage = "错误信息:数据不存在";
                    return;
                }
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Ext.IsAjaxRequest)
            {
                return;
            }

            int spClientChannelID = Convert.ToInt32(this.Request.QueryString["ChannleClientID"]);

            SPClientChannelSettingWrapper settingWrapper = SPClientChannelSettingWrapper.FindById(spClientChannelID);

            this.hidChannelClientID.Text = settingWrapper.Id.ToString();

            this.lblChannelName.Text = settingWrapper.ChannelName;

            this.txtClientSycnUrl.Text = settingWrapper.SyncDataUrl;

            this.lblCode.Text = settingWrapper.ChannelClientCode;

            this.lblOkMessage.Text = settingWrapper.OkMessage;

            this.lblClientName.Text = settingWrapper.ClientName;

            this.lblClientGroupName.Text = settingWrapper.ClientGroupName;

            NameValueCollection sendParams = settingWrapper.GetAllSendParams();

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

                if (sendParams[sendParamKey] == "linkid" || sendParamKey == "linkid")
                {
                    txt.Value = "99999" + StringUtil.GetRandNumber(15);

                    hidLinkIDeName.Text = txt.ClientID;
                }

                if (sendParams[sendParamKey] == "mobile" || sendParamKey == "mobile")
                {
                    txt.Value = "135" + StringUtil.GetRandNumber(8);

                    hidMobileName.Text = txt.ClientID;
                }

                if (sendParams[sendParamKey] == "cpid" || sendParamKey == "spCode")
                {
                    if (!string.IsNullOrEmpty(settingWrapper.ChannelCode))
                    {
                        txt.Value = settingWrapper.ChannelCode;
                    }
                }

                if (sendParams[sendParamKey] == "ywid" || sendParamKey == "mo")
                {
                    if (!string.IsNullOrEmpty(settingWrapper.CommandCode))
                    {
                        txt.Value = settingWrapper.CommandCode;
                    }
                }

                anchor.Items.Add(txt);
                this.FormLayout1.Anchors.Add(anchor);
            }
        }
        public SPClientChannelSycnParamsWrapper ToWrapper()
        {
            SPClientChannelSycnParamsWrapper wrapper = new SPClientChannelSycnParamsWrapper();

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

            return(wrapper);
        }
Exemple #19
0
        private void BindData()
        {
            DataTable tb = SPDayReportWrapper.GetClientGroupDayReport(StartDate.Date, EndDate.Date, ClientGroupID);

            DataTable rtp = tb.Clone();

            foreach (DataRow row in tb.Rows)
            {
                if (row["ClientGroupID"] != System.DBNull.Value)
                {
                    int clientGroupID = (int)row["ClientGroupID"];

                    if (clientGroupID == ClientGroupID)
                    {
                        rtp.ImportRow(row);
                    }
                }
            }
            rtp.AcceptChanges();

            rtp.Columns.Add("CodeName");
            rtp.Columns.Add("Price", typeof(decimal));
            rtp.Columns.Add("Amount", typeof(decimal));

            rtp.AcceptChanges();

            foreach (DataRow row in rtp.Rows)
            {
                int channleClientID = (int)row["ChannleClientID"];
                int recordCount     = (int)row["RecordCount"];

                SPClientChannelSettingWrapper clientChannelSetting =
                    SPClientChannelSettingWrapper.FindById(channleClientID);

                row.BeginEdit();
                row["CodeName"] = clientChannelSetting.ClinetID.Alias;
                row["Price"]    = clientChannelSetting.ClinetID.Price;
                row["Amount"]   = clientChannelSetting.ClinetID.Price * recordCount;
                row.EndEdit();
            }

            rtp.AcceptChanges();

            SPClientGroupWrapper clientGroup = SPClientGroupWrapper.FindById(ClientGroupID);

            string reportName = string.Format("下家组【{2}】 【{0}】-【{1}】结算报表", StartDate.ToString("yyyy-MM-dd"), EndDate.ToString("yyyy-MM-dd"), clientGroup.Name);


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

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

            SPClientGroupWrapper clientGroupWrapper = SPClientGroupWrapper.FindById(ClientGroupID);


            ReportParameter rpName = new ReportParameter();

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



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



            ReportViewer1.LocalReport.Refresh();
        }
        protected void storeSPSendClientParams_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;
            }

            storeSPSendClientParams.DataSource = SPClientChannelSycnParamsWrapper.FindAllByOrderByAndFilterAndClientChannelSettingID(sortFieldName, (e.Dir == SortDirection.DESC), pageIndex, limit, SPClientChannelSettingWrapper.FindById(ChannleClientID), out recordCount);
            e.TotalCount = recordCount;

            storeSPSendClientParams.DataBind();
        }
        protected void btnResetIntercept_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                CurrentStep      = 0;
                CurrentStepCount = 0;
                prgProcess.Text  = "";

                int clientChannleID = Convert.ToInt32(this.hidClientChannelID.Text);


                SPClientChannelSettingWrapper clientChannelSetting =
                    SPClientChannelSettingWrapper.FindById(clientChannleID);


                if (!(clientChannelSetting.SyncData.HasValue && clientChannelSetting.SyncData.Value))
                {
                    Ext.Msg.Alert("错误", "该通道无法同步数据");
                    winProgress.Hide();
                    return;
                }



                int maxChangeCount = Convert.ToInt32(hidMaxChangeCount.Text);

                int recordCount = 0;

                DataSet ds = SPPaymentInfoWrapper.FindAllPaymentIDByDateAndType(System.DateTime.Now.Date,
                                                                                System.DateTime.Now.Date,
                                                                                clientChannleID,
                                                                                DataType.Intercept.ToString(),
                                                                                maxChangeCount);

                List <UrlSendTask> tasks = new List <UrlSendTask>();

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    SPPaymentInfoWrapper payment =
                        SPPaymentInfoWrapper.FindById(dr[SPPaymentInfoWrapper.PROPERTY_NAME_ID]);

                    if (payment != null && payment.IsIntercept.HasValue && payment.IsIntercept.Value)
                    {
                        payment.IsIntercept    = false;
                        payment.IsSycnData     = true;
                        payment.SycnRetryTimes = 0;
                        payment.SucesssToSend  = false;


                        SPPaymentInfoWrapper.Update(payment);

                        tasks.Add(payment.BulidSendTask());
                    }
                }

                ThreadPool.QueueUserWorkItem(LongAction, tasks);
                ScriptManager1.AddScript("{0}.startTask('longactionprogress');", TaskManager1.ClientID);
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
        public void Show(int id)
        {
            try
            {
                SPClientChannelSettingWrapper obj = SPClientChannelSettingWrapper.FindById(id);

                if (obj != null)
                {
                    this.lblChannelName.Text = obj.ChannelName;

                    this.lblClientName.Text = obj.ClientName;

                    this.lblClientName.Text = obj.ClientGroupName;

                    this.lblName.Text = obj.Name;

                    this.lblChannelClientCode.Text = obj.ChannelClientCode;

                    chkHasDayMonthLimit.Checked = obj.HasDayMonthLimit.HasValue && obj.HasDayMonthLimit.Value;
                    chkHasDayTotalLimit.Checked = obj.HasDayTotalLimit.HasValue && obj.HasDayTotalLimit.Value;

                    if (chkHasDayMonthLimit.Checked)
                    {
                        if (obj.DayLimitCount.HasValue)
                        {
                            this.txtDayLimit.Text = obj.DayLimitCount.Value.ToString();
                        }
                        else
                        {
                            this.txtDayLimit.Text = "0";
                        }
                        if (obj.MonthLimitCount.HasValue)
                        {
                            this.txtMonthLimit.Text = obj.MonthLimitCount.Value.ToString();
                        }
                        else
                        {
                            this.txtMonthLimit.Text = "0";
                        }
                    }
                    else
                    {
                        this.txtDayLimit.Text   = "0";
                        this.txtMonthLimit.Text = "0";
                    }

                    this.txtDayLimit.Hidden   = !chkHasDayMonthLimit.Checked;
                    this.txtMonthLimit.Hidden = !chkHasDayMonthLimit.Checked;
                    this.chkDayTotalLimitInProvince.Hidden = !chkHasDayTotalLimit.Checked;

                    if (this.chkHasDayTotalLimit.Checked)
                    {
                        if (obj.DayTotalLimit.HasValue)
                        {
                            this.txtDayTotalLimit.Text = obj.DayTotalLimit.Value.ToString();
                        }
                        else
                        {
                            this.txtDayTotalLimit.Text = "0";
                        }


                        if (obj.DayTotalLimitInProvince.HasValue && obj.DayTotalLimitInProvince.Value)
                        {
                            this.chkDayTotalLimitInProvince.Checked = true;
                        }
                        else
                        {
                            this.chkDayTotalLimitInProvince.Checked = false;
                        }
                    }
                    else
                    {
                        this.txtDayTotalLimit.Text = "0";
                    }


                    this.txtDayTotalLimit.Hidden = !chkHasDayTotalLimit.Checked;



                    hidId.Text = id.ToString();

                    this.storeAreaCountList.DataSource = obj.LimitAreaAssigneds;
                    this.storeAreaCountList.DataBind();

                    this.grdAreaCountList.Hidden = !this.chkDayTotalLimitInProvince.Checked;

                    winSPClientChannelSettingInfoEdit.Show();
                }
                else
                {
                    ScriptManager.AjaxSuccess      = false;
                    ScriptManager.AjaxErrorMessage = "错误信息:数据不存在";
                    return;
                }
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        protected void storeSPClientChannelSetting_Refresh(object sender, StoreRefreshDataEventArgs e)
        {
            int    recordCount   = 0;
            string sortFieldName = "";

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

            if (sortFieldName == "ChannelClientCode")
            {
                sortFieldName = "CommandCode";
            }
            else if (sortFieldName == "DefaultClientPrice")
            {
                sortFieldName = "DefaultPrice";
            }
            else if (sortFieldName == "DayTotalLimitInfo")
            {
                sortFieldName = "HasDayTotalLimit";
            }
            else if (sortFieldName == "DayTimeLimitInfo")
            {
                sortFieldName = "HasDayTimeLimit";
            }



            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;
            }



            string province = this.txtMO.Text.Trim();

            string port = this.txtPort.Text.Trim();


            List <SPClientChannelSettingWrapper> spClientChannelSettingWrappers = SPClientChannelSettingWrapper.FindAllByOrderByAndFilterAndChannelIDAndCodeAndPort(sortFieldName, (e.Dir == SortDirection.DESC), ChannleID, province, port, pageIndex,
                                                                                                                                                                    limit, out recordCount);


            storeSPClientChannelSetting.DataSource = spClientChannelSettingWrappers;
            e.TotalCount = recordCount;

            storeSPClientChannelSetting.DataBind();
        }
Exemple #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Ext.IsAjaxRequest)
            {
                return;
            }

            int spClientChannelID = Convert.ToInt32(this.Request.QueryString["ChannleClientID"]);

            SPClientChannelSettingWrapper settingWrapper = SPClientChannelSettingWrapper.FindById(spClientChannelID);

            this.hidChannelClientID.Text = settingWrapper.Id.ToString();

            this.txtChannelName.Text = settingWrapper.Name;

            this.txtChannelSubmitUrl.Text = settingWrapper.ChannelID.InterfaceUrl;

            this.lblChannelCode.Text = settingWrapper.ChannelCode;

            List <SPChannelParamsWrapper> channelParamsWrappers = settingWrapper.ChannelID.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 = "99999" + StringUtil.GetRandNumber(15);

                    hidLinkIDeName.Text = txt.ClientID;
                }

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

                    hidMobileName.Text = txt.ClientID;
                }

                if (spChannelParamsWrapper.ParamsMappingName == "cpid")
                {
                    if (!string.IsNullOrEmpty(settingWrapper.ChannelCode))
                    {
                        txt.Value = settingWrapper.ChannelCode;
                    }
                }

                if (spChannelParamsWrapper.ParamsMappingName == "ywid")
                {
                    if (!string.IsNullOrEmpty(settingWrapper.CommandCode))
                    {
                        txt.Value = settingWrapper.CommandCode;
                    }
                }

                anchor.Items.Add(txt);
                this.FormLayout1.Anchors.Add(anchor);
            }
        }
Exemple #25
0
        public void Show(int id)
        {
            try
            {
                SPClientChannelSettingWrapper obj = SPClientChannelSettingWrapper.FindById(id);

                if (obj != null)
                {
                    this.txtShowCode.Text = obj.ChannelClientCode;


                    if (obj.Name != null)
                    {
                        this.txtName.Text = obj.ClinetID.DisplayName;
                    }
                    else
                    {
                        this.txtName.Text = "";
                    }


                    if (obj.Description != null)
                    {
                        this.txtDescription.Text = obj.Description.ToString();
                    }
                    else
                    {
                        this.txtDescription.Text = "";
                    }

                    this.lblChanneCode.Text = obj.ChannelCode;

                    if (obj.ChannelCode != null)
                    {
                        this.lblChanneCode.Text = obj.ChannelCode.ToString();
                    }
                    else
                    {
                        this.lblChanneCode.Text = "";
                    }



                    this.fsAllowSycnData.CheckboxToggle = obj.SyncData.HasValue && obj.SyncData.Value;

                    this.fsAllowSycnData.Collapsed = !this.fsAllowSycnData.CheckboxToggle;
                    if (!string.IsNullOrEmpty(obj.ClinetID.SPClientGroupID.DefaultSycnMoUrl))
                    {
                        this.fsAllowSycnData.Disabled = false;
                    }
                    else
                    {
                        this.fsAllowSycnData.Disabled = true;
                    }

                    if (obj.SyncData.HasValue && obj.SyncData.Value)
                    {
                        if (obj.SyncDataUrl != null)
                        {
                            this.txtSyncDataUrl.Text = obj.SyncDataUrl;
                        }
                        else
                        {
                            this.txtSyncDataUrl.Text = "";
                        }
                    }
                    else
                    {
                        this.txtSyncDataUrl.Text = "";
                    }



                    hidId.Text = id.ToString();

                    winSPClientChannelSettingEdit.Show();
                }
                else
                {
                    ScriptManager.AjaxSuccess      = false;
                    ScriptManager.AjaxErrorMessage = "错误信息:数据不存在";
                    return;
                }
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        private void ReSendPayment(string dataType)
        {
            CurrentStep      = 0;
            CurrentStepCount = 0;
            prgProcess.Text  = "";

            int clientChannleID = Convert.ToInt32(this.hidClientChannelID.Text);


            SPClientChannelSettingWrapper clientChannelSetting =
                SPClientChannelSettingWrapper.FindById(clientChannleID);


            if (!(clientChannelSetting.SyncData.HasValue && clientChannelSetting.SyncData.Value))
            {
                Ext.Msg.Alert("错误", "该通道无法同步数据");
                prgProcess.Hide();
                return;
            }


            int maxChangeCount = Convert.ToInt32(hidMaxChangeCount.Text);

            int recordCount = 0;

            DataSet ds = SPPaymentInfoWrapper.FindAllPaymentIDByDateAndType(System.DateTime.Now.Date,
                                                                            System.DateTime.Now.Date,
                                                                            clientChannleID,
                                                                            dataType,
                                                                            maxChangeCount);

            List <UrlSendTask> tasks = new List <UrlSendTask>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                SPPaymentInfoWrapper payment =
                    SPPaymentInfoWrapper.FindById(dr[SPPaymentInfoWrapper.PROPERTY_NAME_ID]);



                if (payment != null && CheckPaymentIsDataType(payment, dataType))
                {
                    payment.IsIntercept    = false;
                    payment.IsSycnData     = true;
                    payment.SycnRetryTimes = 0;
                    payment.SucesssToSend  = false;


                    SPPaymentInfoWrapper.Update(payment);

                    tasks.Add(payment.BulidSendTask());
                }
            }

            if (tasks.Count <= 0)
            {
                Ext.Msg.Alert("错误", "没有需要重发的数据");
                prgProcess.Hide();
                return;
            }

            ThreadPool.QueueUserWorkItem(LongAction, tasks);
            ScriptManager1.AddScript("{0}.startTask('longactionprogress');", TaskManager2.ClientID);
        }
        private void BindData()
        {
            DataTable tb = null;

            if (ReportType == "1")
            {
                tb = SPDayReportWrapper.GetProvinceCityReport(StartDate, EndDate, ReportID, ReportClientChannleID, Province);
            }
            else if (ReportType == "2")
            {
                tb = SPDayReportWrapper.GetProvinceCityReportForClientGroup(StartDate, EndDate, ReportID, ReportClientChannleID, Province);
            }



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

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


            string reporttypeName = "";

            if (ReportType == "1")
            {
                reporttypeName = "通道";
            }
            else if (ReportType == "2")
            {
                reporttypeName = "下家组";
            }

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

            if (ReportID == 0)
            {
                reportName = "全平台" + reportName;
            }
            else
            {
                string name = "";
                if (ReportType == "1")
                {
                    name = SPChannelWrapper.FindById(ReportID).Name;
                }
                else if (ReportType == "2")
                {
                    name = SPClientGroupWrapper.FindById(ReportID).Name;
                }


                if (ReportClientChannleID == 0)
                {
                    reportName = string.Format(reporttypeName + "【{0}】", name) + reportName;
                }
                else
                {
                    SPClientChannelSettingWrapper clientChannelSetting = SPClientChannelSettingWrapper.FindById(ReportClientChannleID);

                    reportName = string.Format(reporttypeName + "【{0}】", 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();
        }
Exemple #28
0
        protected void btnSaveSPClientChannelSetting_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPClientChannelSettingWrapper obj = SPClientChannelSettingWrapper.FindById(int.Parse(hidId.Text.Trim()));

                obj.InterceptRate = Convert.ToInt32(this.txtInterceptRate.Text.Trim());
                obj.UpRate        = 0;
                obj.DownRate      = 0;
                obj.AllowFilter   = this.chkAllowFilter.Checked;
                obj.Disable       = this.chkDisable.Checked;
                obj.ChannelCode   = this.txtChannleCode.Text.Trim();


                if (!this.fsAllowSycnData.Collapsed)
                {
                    if (!this.txtSyncDataUrl.Text.Trim().ToLower().StartsWith("http://"))
                    {
                        Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                        Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:提交地址一定要以http://开头";
                        return;
                    }

                    if (chkAllowSpaceInCode.Checked)
                    {
                        obj.CommandCode = this.txtCommandCode.Text;
                    }

                    obj.SyncData    = true;
                    obj.SyncDataUrl = this.txtSyncDataUrl.Text.Trim();
                    if (this.cmbSycnType.SelectedItem != null)
                    {
                        obj.SyncType = this.cmbSycnType.SelectedItem.Value;
                    }
                    else
                    {
                        obj.SyncType = "1";
                    }
                    obj.OkMessage     = this.txtOkMessage.Text.Trim();
                    obj.FailedMessage = this.txtFailedMessage.Text.Trim();
                }
                else
                {
                    obj.SyncData      = false;
                    obj.SyncDataUrl   = "";
                    obj.SyncType      = "";
                    obj.OkMessage     = "";
                    obj.FailedMessage = "";
                    obj.SyncType      = "1";
                }


                SPClientChannelSettingWrapper.Update(obj);

                obj.ChannelID.RefreshChannelInfo();

                winSPClientChannelSettingEdit.Hide();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        protected void btnSaveSPClientChannelSetting_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPClientChannelSettingWrapper obj = new SPClientChannelSettingWrapper();

                obj.Name          = this.txtName.Text.Trim();
                obj.Description   = this.txtDescription.Text.Trim();
                obj.ChannelID     = SPChannelWrapper.FindById(Convert.ToInt32(this.cmbChannelID.SelectedItem.Value.ToString()));
                obj.ClinetID      = SPClientWrapper.FindById(Convert.ToInt32(this.cmbClinetID.SelectedItem.Value.ToString()));
                obj.InterceptRate = Convert.ToInt32(this.txtInterceptRate.Text.Trim());
                obj.OrderIndex    = Convert.ToInt32(this.numOrderIndex.Text.Trim());
                obj.UpRate        = 0;
                obj.DownRate      = 0;
                obj.Disable       = this.chkDisable.Checked;

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


                if (this.cmbChannelCodeParamsName.SelectedItem != null)
                {
                    obj.CommandColumn = this.cmbChannelCodeParamsName.SelectedItem.Value;
                }
                else
                {
                    obj.CommandColumn = "";
                }
                obj.CommandType = this.cmbCommandType.SelectedItem.Value.ToString();
                obj.CommandCode = this.txtCommandCode.Text.Trim();

                if (!this.fsAllowSycnData.Collapsed)
                {
                    if (!this.txtSyncDataUrl.Text.Trim().ToLower().StartsWith("http://"))
                    {
                        Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                        Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:提交地址一定要以http://开头";
                        return;
                    }


                    obj.SyncData    = true;
                    obj.SyncDataUrl = this.txtSyncDataUrl.Text.Trim();
                    if (this.cmbSycnType.SelectedItem != null)
                    {
                        obj.SyncType = this.cmbSycnType.SelectedItem.Value;
                    }
                    else
                    {
                        obj.SyncType = "1";
                    }
                    obj.OkMessage     = this.txtOkMessage.Text.Trim();
                    obj.FailedMessage = this.txtFailedMessage.Text.Trim();
                }
                else
                {
                    obj.SyncData = false;
                    obj.SyncType = "1";
                }

                SPClientChannelSettingWrapper.Save(obj);

                obj.ChannelID.RefreshChannelInfo();

                winSPClientChannelSettingAdd.Hide();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Exemple #30
0
        public void Show(int id)
        {
            try
            {
                SPClientChannelSettingWrapper obj = SPClientChannelSettingWrapper.FindById(id);

                if (obj != null)
                {
                    if (obj.ChannelID != null)
                    {
                        this.lblChannelName.Text = obj.ChannelID.Name;
                    }
                    else
                    {
                        this.lblChannelName.Text = "";
                    }
                    if (obj.ClinetID != null)
                    {
                        this.lblClientName.Text = obj.ClinetID.Name;
                    }
                    else
                    {
                        this.lblClientName.Text = "";
                    }

                    this.txtShowCode.Text = obj.ChannelClientCode;

                    chkAllowSpaceInCode.Checked = false;


                    if (obj.Name != null)
                    {
                        this.txtName.Text = obj.Name.ToString();
                    }
                    else
                    {
                        this.txtName.Text = "";
                    }


                    if (obj.Description != null)
                    {
                        this.txtDescription.Text = obj.Description.ToString();
                    }
                    else
                    {
                        this.txtDescription.Text = "";
                    }

                    this.lblChanneCode.Text = obj.ChannelCode;

                    if (obj.ChannelCode != null)
                    {
                        this.txtChannleCode.Text = obj.ChannelCode.ToString();
                    }
                    else
                    {
                        this.txtChannleCode.Text = "";
                    }



                    this.txtInterceptRate.Text = obj.InterceptRate.ToString();



                    this.fsAllowSycnData.CheckboxToggle = obj.SyncData.HasValue && obj.SyncData.Value;

                    this.fsAllowSycnData.Collapsed = !this.fsAllowSycnData.CheckboxToggle;

                    this.chkDisable.Checked = obj.Disable.HasValue && obj.Disable.Value;

                    this.chkAllowFilter.Checked = obj.AllowFilter.HasValue && obj.AllowFilter.Value;

                    if (obj.SyncData.HasValue && obj.SyncData.Value)
                    {
                        if (obj.SyncDataUrl != null)
                        {
                            this.txtSyncDataUrl.Text = obj.SyncDataUrl;
                        }
                        else
                        {
                            this.txtSyncDataUrl.Text = "";
                        }



                        if (!string.IsNullOrEmpty(obj.SyncType))
                        {
                            this.cmbSycnType.SetInitValue(obj.SyncType);
                        }
                        else
                        {
                            this.cmbSycnType.SelectedIndex = 0;
                        }

                        if (obj.OkMessage != null)
                        {
                            this.txtOkMessage.Text = obj.OkMessage;
                        }
                        else
                        {
                            this.txtOkMessage.Text = "";
                        }



                        if (obj.FailedMessage != null)
                        {
                            this.txtFailedMessage.Text = obj.FailedMessage;
                        }
                        else
                        {
                            this.txtFailedMessage.Text = "";
                        }
                    }
                    else
                    {
                        this.txtSyncDataUrl.Text = "";
                        this.cmbSycnType.SetValue("");
                        this.txtOkMessage.Text     = "";
                        this.txtFailedMessage.Text = "";
                    }



                    hidId.Text = id.ToString();

                    winSPClientChannelSettingEdit.Show();
                }
                else
                {
                    ScriptManager.AjaxSuccess      = false;
                    ScriptManager.AjaxErrorMessage = "错误信息:数据不存在";
                    return;
                }
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }