Exemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";


            List <SPChannelWrapper> channels = null;

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

            if (string.IsNullOrEmpty(clientID))
            {
                channels = new List <SPChannelWrapper>();
            }
            else
            {
                int cid = int.Parse(clientID);



                channels = SPClientChannelSettingWrapper.GetChannelByClient(SPClientWrapper.FindById(cid));
            }

            //List<SPChannelWrapper> channels = SPChannelWrapper.GetChannelByClientID();

            context.Response.Write(string.Format("{{total:{1},'channels':{0}}}", JSON.Serialize(channels), channels.Count));
        }
Exemplo n.º 2
0
        protected void storeSPClient_OnRefresh(object sender, StoreRefreshDataEventArgs e)
        {
            SPClientGroupWrapper clientGroup = SPClientGroupWrapper.FindById(this.ClientGroupID);

            storeSPClient.DataSource = SPClientWrapper.FindAllBySPClientGroupID(clientGroup);
            storeSPClient.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Ext.IsAjaxRequest)
            {
                return;
            }

            this.dfReportStartDate.DateField.Value = System.DateTime.Now.AddDays(-7).Date;

            this.dfReportStartDate.DateField.MinDate = GetDT();

            this.dfReportStartDate.DateField.MaxDate = System.DateTime.Now.Date.AddDays(-1).Date;

            this.dfReportStartDate.DateField.MaxDate = System.DateTime.Now.Date.AddDays(-1).Date;

            this.dfReportEndDate.DateField.Value = System.DateTime.Now.Date.AddDays(-1).Date;

            this.dfReportEndDate.DateField.MaxDate = System.DateTime.Now.Date.AddDays(-1).Date;

            this.hidId.Text = this.SPClientID.ToString();

            this.hidChannelID.Text =
                SPClientWrapper.FindById(this.SPClientID).DefaultClientChannelSetting.ChannelID.Id.ToString();

            this.gridPanelSPClientChannelSetting.Reload();
        }
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/json";

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

            if (context.Request.QueryString["DataType"] == "GetAllClient")
            {
                clientGroups = SPClientWrapper.FindAll();
            }
            if (context.Request.QueryString["DataType"] == "GetAllDefaultClient")
            {
                clientGroups = SPClientWrapper.GetAllDefaultClient();
            }
            if (context.Request.QueryString["DataType"] == "GetAllClientByClientGroup")
            {
                int clientGroupID = Convert.ToInt32(context.Request.QueryString["ClientGroupID"]);

                SPClientGroupWrapper clientGroup = SPClientGroupWrapper.FindById(clientGroupID);

                clientGroups = SPClientWrapper.FindAllBySPClientGroupID(clientGroup);
            }

            context.Response.Write(string.Format("{{total:{1},'datas':{0}}}", JSON.Serialize(clientGroups), clientGroups.Count));
        }
Exemplo n.º 5
0
        protected void btnSave_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                if (this.cmbClientID.SelectedItem != null)
                {
                    int spClientID = int.Parse(this.cmbClientID.SelectedItem.Value.ToString());


                    SPClientWrapper spClientWrapper = SPClientWrapper.FindById(spClientID);



                    spClientWrapper.SPClientGroupID = SPClientGroupWrapper.FindById(ClientGroupID);


                    SPClientWrapper.Update(spClientWrapper);


                    spClientWrapper.UpdateSyncDataSetting(spClientWrapper.SPClientGroupID.DefaultInterceptRate);
                }
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
        private void BindData()
        {
            DataTable dt = SPDayReportWrapper.GetDayCountReportForMaster((DateTime)dfReportStartDate.DateField.Value, (DateTime)dfReportEndDate.DateField.Value);

            if (dt.Columns["SPClientGroupName"] == null)
            {
                dt.Columns.Add("SPClientGroupName");
            }

            foreach (DataRow dataRow in dt.Rows)
            {
                if (dataRow["ClientID"] == System.DBNull.Value || dataRow["ClientID"].Equals(0))
                {
                    dataRow["SPClientGroupName"] = "";
                }
                else
                {
                    SPClientWrapper clientWrapper = SPClientWrapper.FindById((int)dataRow["ClientID"]);

                    if (clientWrapper != null)
                    {
                        dataRow["SPClientGroupName"] = clientWrapper.ClientGroupName;
                    }
                    else
                    {
                        dataRow["SPClientGroupName"] = "";
                    }
                }
            }


            this.Store1.DataSource = dt;
            this.Store1.DataBind();
        }
        protected void storeSPClient_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;
            }

            List <QueryFilter> queryFilters = new List <QueryFilter>();

            string clientName = "";

            if (!string.IsNullOrEmpty(this.txtSreachName.Text.Trim()))
            {
                clientName = this.txtSreachName.Text.Trim();

                queryFilters.Add(new QueryFilter(SPClientWrapper.PROPERTY_NAME_NAME, clientName, FilterFunction.Contains));
            }



            if (ClientGroupID > 0)
            {
                storeSPClient.DataSource = SPClientWrapper.FindAllByOrderByAndFilterAndSPClientGroupID(sortFieldName, (e.Dir == SortDirection.DESC), pageIndex, limit, SPClientGroupWrapper.FindById(this.ClientGroupID), out recordCount);
            }
            else
            {
                storeSPClient.DataSource = SPClientWrapper.FindAllByOrderByAndFilter(queryFilters, sortFieldName, (e.Dir == SortDirection.DESC), pageIndex, limit, out recordCount);
            }


            e.TotalCount = recordCount;

            storeSPClient.DataBind();
        }
        protected void btnSaveSPClient_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPClientWrapper obj = SPClientWrapper.FindById(int.Parse(hidId.Text.Trim()));

                int oldClientGroupID = 0;

                if (obj.SPClientGroupID != null)
                {
                    oldClientGroupID = obj.SPClientGroupID.Id;
                }

                obj.Name        = this.txtName.Text.Trim();
                obj.Alias       = this.txtAlias.Text.Trim();
                obj.Description = this.txtDescription.Text.Trim();
                if (ClientGroupID <= 0)
                {
                    if (this.cmbClientGroupID.SelectedItem != null)
                    {
                        obj.SPClientGroupID =
                            SPClientGroupWrapper.FindById(Convert.ToInt32(this.cmbClientGroupID.SelectedItem.Value));
                    }
                }
                else
                {
                    obj.SPClientGroupID = SPClientGroupWrapper.FindById(ClientGroupID);
                }

                SPClientWrapper.Update(obj);

                int newClientGroupID = 0;

                if (obj.SPClientGroupID != null)
                {
                    newClientGroupID = obj.SPClientGroupID.Id;
                }

                if (newClientGroupID != 0 && oldClientGroupID != newClientGroupID)
                {
                    obj.UpdateSyncDataSetting();
                }

                obj.SetClientPrice(Convert.ToDecimal(numPrice.Value));

                winSPClientEdit.Hide();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
Exemplo n.º 10
0
        private void BindData()
        {
            DataTable tb = SPDayReportWrapper.GetALlClientGroupPriceReport(StartDate.Date, EndDate.Date);

            foreach (DataRow row in tb.Rows)
            {
                string moCode = "";

                if (row["ClientID"] != null && row["ClientID"] != System.DBNull.Value && !string.IsNullOrEmpty(row["ClientID"].ToString()))
                {
                    SPClientWrapper client = SPClientWrapper.FindById((int)row["ClientID"]);

                    if (client != null)
                    {
                        SPClientChannelSettingWrapper channelSetting = client.DefaultClientChannelSetting;

                        if (channelSetting != null)
                        {
                            moCode = channelSetting.MoCode;
                        }
                    }
                }


                row["ClientAliasName"] = row["ClientAliasName"] + " " + row["ClientID"].ToString() + " " + moCode;
            }



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

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


            ReportParameter rpStartDate = new ReportParameter();

            rpStartDate.Name = "StartDate";
            rpStartDate.Values.Add(StartDate.ToShortDateString());

            ReportParameter rpEndDate = new ReportParameter();

            rpEndDate.Name = "EndDate";
            rpEndDate.Values.Add(EndDate.ToShortDateString());


            ReportViewer1.LocalReport.SetParameters(
                new ReportParameter[] { rpStartDate, rpEndDate });



            ReportViewer1.LocalReport.Refresh();
        }
Exemplo n.º 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Ext.IsAjaxRequest)
            {
                this.hidId.Text = this.SPClientID.ToString();

                int channelID = 0;

                SPClientChannelSettingWrapper channelSettingWrapper = SPClientWrapper.FindById(this.SPClientID).DefaultClientChannelSetting;

                DataTable dt = this.GetDataTable(this.SPClientID, channelID, "");



                winRrovinceReport.AutoLoad.Params.Clear();

                winRrovinceReport.AutoLoad.Params.Add(new Parameter("ChannleID", channelSettingWrapper.ChannelID.Id.ToString(), ParameterMode.Value));
                winRrovinceReport.AutoLoad.Params.Add(new Parameter("ClientID", channelSettingWrapper.ClinetID.Id.ToString(), ParameterMode.Value));
                winRrovinceReport.AutoLoad.Params.Add(new Parameter("StartDate", System.DateTime.Now.ToShortDateString(), ParameterMode.Value));
                winRrovinceReport.AutoLoad.Params.Add(new Parameter("EndDate", System.DateTime.Now.ToShortDateString(), ParameterMode.Value));
                winRrovinceReport.AutoLoad.Params.Add(new Parameter("DataType", "downcountdetail", ParameterMode.Value));
                winRrovinceReport.AutoLoad.Params.Add(new Parameter("IsClientShow", "1", ParameterMode.Value));



                //                <ext:Parameter Name="ChannleID" Mode="Raw" Value="0">
                //</ext:Parameter>
                //<ext:Parameter Name="ClientID" Mode="Raw" Value="0">
                //</ext:Parameter>
                //<ext:Parameter Name="StartDate" Mode="Raw" Value="2009-1-1">
                //</ext:Parameter>
                //<ext:Parameter Name="EndDate" Mode="Raw" Value="2009-1-1">
                //</ext:Parameter>
                //<ext:Parameter Name="DataType" Mode="Raw" Value="0">
                //</ext:Parameter>

                //winRrovinceReport.AutoLoad.Params["ChannleID"] = channelSettingWrapper.ChannelID.Id.ToString();
                //winRrovinceReport.AutoLoad.Params["ClientID"] = channelSettingWrapper.ClinetID.Id.ToString();
                //winRrovinceReport.AutoLoad.Params["StartDate"] = System.DateTime.Now.ToShortDateString();
                //winRrovinceReport.AutoLoad.Params["EndDate"] = System.DateTime.Now.ToShortDateString();
                //winRrovinceReport.AutoLoad.Params["DataType"] = "downcountdetail";



                this.txtTotalCount.Text = "共计:" + dt.Compute(" Sum(Count) ", " 1=1 ").ToString();

                this.Store1.DataSource = dt;
                this.Store1.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;
        }
Exemplo n.º 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();
        }
 public void FromWrapper(SPClientWrapper wrapper)
 {
     this.Id              = wrapper.Id;
     this.Name            = wrapper.Name;
     this.Description     = wrapper.Description;
     this.RecieveDataUrl  = wrapper.RecieveDataUrl;
     this.UserID          = wrapper.UserID;
     this.SyncData        = wrapper.SyncData;
     this.OkMessage       = wrapper.OkMessage;
     this.FailedMessage   = wrapper.FailedMessage;
     this.SyncType        = wrapper.SyncType;
     this.SPClientGroupID = (wrapper.SPClientGroupID != null) ? wrapper.SPClientGroupID.Id : 0;
     this.IsDefaultClient = wrapper.IsDefaultClient;
     this.Alias           = wrapper.Alias;
 }
        public SPSendClientParamsWrapper ToWrapper()
        {
            SPSendClientParamsWrapper wrapper = new SPSendClientParamsWrapper();

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

            return(wrapper);
        }
Exemplo n.º 16
0
        protected void bindData()
        {
            DataTable dt = SPDayReportWrapper.GetAllTodayReport(this.chkFilterNoCount.Checked);

            dt.Columns.Add(new DataColumn("ClientGroupName"));
            dt.Columns.Add(new DataColumn("SetInterceptRate"));
            dt.Columns.Add(new DataColumn("ChannelClientCode"));
            dt.Columns.Add(new DataColumn("IsSycnData", typeof(bool)));



            dt.AcceptChanges();

            foreach (DataRow item in dt.Rows)
            {
                SPClientWrapper client = SPClientWrapper.FindById((int)item["ClientID"]);

                if (client == null)
                {
                    item["ChannelClientID"]   = 0;
                    item["ClientGroupName"]   = "";
                    item["SetInterceptRate"]  = "";
                    item["ChannelClientCode"] = "";
                    item["IsSycnData"]        = false;
                }
                else
                {
                    item["ChannelClientID"]   = client.DefaultClientChannelSetting.Id;
                    item["ClientGroupName"]   = client.ClientGroupName;
                    item["SetInterceptRate"]  = client.DefaultClientChannelSetting.InterceptRate;
                    item["ChannelClientCode"] = client.DefaultClientChannelSetting.ChannelClientCode;
                    item["IsSycnData"]        = client.DefaultClientChannelSetting.SyncData.HasValue && client.DefaultClientChannelSetting.SyncData.Value;
                }
            }



            Store1.DataSource = dt;
            Store1.DataBind();

            this.txtTotalCount.Text     = string.Format("总点播数(条):{0}", GetSumField(dt, "TotalCount"));
            this.txtInterceptCount.Text = string.Format("总扣量数(条):{0}", GetSumField(dt, "InterceptCount"));
            this.txtDownCount.Text      = string.Format("总转发下家数(条):{0}", GetSumField(dt, "DownCount"));
            this.txtDownSycnCount.Text  = string.Format("总同步下家数(条):{0}", GetSumField(dt, "DownSycnCount"));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Ext.IsAjaxRequest)
                return;

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

            if (IsClientShow)
            {
                this.lblTitle.Text = string.Format(" 通道 【{0}】 ", spClientWrapper.DisplayName);

                this.lblTitle.Text += string.Format(" 日期 【{0}】 到 【{1}】 ", StartDate.ToShortDateString(),EndDate.ToShortDateString());

                this.lblTitle.Text += " 数据省份分布 ";
            }

            this.grdReport.Reload();
        }
        public void Show(int clientID)
        {
            try
            {
                SPClientWrapper spClientWrapper = SPClientWrapper.FindById(clientID);

                this.hidClientID.Text = clientID.ToString();

                winSPSendClientParamsClone.Title = string.Format("下家[{0}]复制通道参数", spClientWrapper.Name);

                this.winSPSendClientParamsClone.Show();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
        public void Show(int clientID)
        {
            try
            {
                SPClientWrapper spClientWrapper = SPClientWrapper.FindById(clientID);

                this.hidClientID.Text = clientID.ToString();

                this.lblClientName.Text = spClientWrapper.Name;

                this.winSPSendClientParamsAdd.Show();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
        private void BindData()
        {
            //DataTable dt = SPDayReportWrapper.GetDayliyReport(Convert.ToDateTime(dfReportDate.DateField.Value));

            DataTable dt = SPDayReportWrapper.GetDayCountReportForMaster((DateTime)dfReportDate.DateField.Value, (DateTime)dfReportDate.DateField.Value);

            if (dt.Columns["SPClientGroupName"] == null)
            {
                dt.Columns.Add("SPClientGroupName");
            }

            foreach (DataRow dataRow in dt.Rows)
            {
                if (dataRow["ClientID"] == System.DBNull.Value || dataRow["ClientID"].Equals(0))
                {
                    dataRow["SPClientGroupName"] = "";
                }
                else
                {
                    SPClientWrapper clientWrapper = SPClientWrapper.FindById((int)dataRow["ClientID"]);

                    if (clientWrapper != null)
                    {
                        dataRow["SPClientGroupName"] = clientWrapper.ClientGroupName;
                    }
                    else
                    {
                        dataRow["SPClientGroupName"] = "";
                    }
                }
            }


            this.Store1.DataSource = dt;
            this.Store1.DataBind();


            this.Store1.DataSource = dt;
            this.Store1.DataBind();
            this.txtTotalCount.Text     = string.Format("总点播数(条):{0}", GetSumField(dt, "TotalCount"));
            this.txtInterceptCount.Text = string.Format("总扣量数(条):{0}", GetSumField(dt, "InterceptCount"));
            this.txtDownCount.Text      = string.Format("总转发下家数(条):{0}", GetSumField(dt, "DownCount"));
            this.txtDownSycnCount.Text  = string.Format("总同步下家数(条):{0}", GetSumField(dt, "DownSycnCount"));
        }
        public void ChangeInterceptCount(string dateTime, int clientID, string newIntercept)
        {
            try
            {
                SPClientWrapper clientWrapper = SPClientWrapper.FindById(clientID);

                int newInterceptCount = Convert.ToInt32(newIntercept);

                DateTime date = Convert.ToDateTime(dateTime);

                DayliyReport dayReport = clientWrapper.GetDayReport(date);

                if (newInterceptCount < 0)
                {
                    ScriptManager.AjaxSuccess      = false;
                    ScriptManager.AjaxErrorMessage = "扣量不得小于0";
                    return;
                }

                if (newInterceptCount > dayReport.TotalCount)
                {
                    ScriptManager.AjaxSuccess      = false;
                    ScriptManager.AjaxErrorMessage = "扣量不得大于当日总量:" + dayReport.TotalCount.ToString();
                    return;
                }


                //ScriptManager.AjaxSuccess = false;
                //ScriptManager.AjaxErrorMessage = string.Format("日期{0} 总量:{1} 点播 {2} 扣量 {3} 同步 {4}", dateTime, dayReport.TotalCount, dayReport.DownCount, dayReport.InterceptCount, dayReport.SycnCount);
                //return;



                SPPaymentInfoWrapper.UpdateRecordAndReport(dayReport, clientWrapper, newInterceptCount);

                ScriptManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ScriptManager.AjaxSuccess      = false;
                ScriptManager.AjaxErrorMessage = string.Format(ex.Message);
                return;
            }
        }
        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;
            }
        }
        public SPClientWrapper ToWrapper()
        {
            SPClientWrapper wrapper = new SPClientWrapper();

            wrapper.Id              = this.Id;
            wrapper.Name            = this.Name;
            wrapper.Description     = this.Description;
            wrapper.RecieveDataUrl  = this.RecieveDataUrl;
            wrapper.UserID          = this.UserID;
            wrapper.SyncData        = this.SyncData;
            wrapper.OkMessage       = this.OkMessage;
            wrapper.FailedMessage   = this.FailedMessage;
            wrapper.SyncType        = this.SyncType;
            wrapper.SPClientGroupID = (this.SPClientGroupID == null) ? null : SPClientGroupWrapper.FindById(this.SPClientGroupID);
            wrapper.IsDefaultClient = this.IsDefaultClient;
            wrapper.Alias           = this.Alias;

            return(wrapper);
        }
Exemplo n.º 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));
        }
Exemplo n.º 25
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";
        }
Exemplo n.º 26
0
        public void Show(int id)
        {
            try
            {
                this.hidClientSelect.Text = id.ToString();

                SPClientWrapper clientWrapper = SPClientWrapper.FindById(id);

                this.winSPChannelParamsList.Title = "[" + clientWrapper.Name + "]下家参数管理";


                this.winSPChannelParamsList.Show();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
                return;
            }
        }
        public void RemoveFromGroup(int id)
        {
            try
            {
                SPClientWrapper clientWrapper = SPClientWrapper.FindById(id);

                clientWrapper.SPClientGroupID = null;

                SPClientWrapper.Update(clientWrapper);

                clientWrapper.UpdateSyncDataSetting(15);

                ScriptManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ScriptManager.AjaxSuccess      = false;
                ScriptManager.AjaxErrorMessage = string.Format(ex.Message);
                return;
            }
        }
Exemplo n.º 28
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);
        }
        protected void btnSaveSPSendClientParams_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                SPSendClientParamsWrapper obj = new SPSendClientParamsWrapper();
                obj.Name          = this.txtName.Text.Trim();
                obj.Description   = this.txtDescription.Text.Trim();
                obj.IsEnable      = this.chkIsEnable.Checked;
                obj.IsRequired    = this.chkIsRequired.Checked;
                obj.ClientID      = SPClientWrapper.FindById(Convert.ToInt32(this.hidClientID.Text.Trim()));
                obj.MappingParams = this.cmbMappingParams.SelectedItem.Value.Trim();
                obj.Title         = this.txtTitle.Text.Trim();
                SPSendClientParamsWrapper.Save(obj);

                winSPSendClientParamsAdd.Hide();
            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess      = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
        public void DeleteRecord(int id)
        {
            try
            {
                SPClientWrapper clientWrapper = SPClientWrapper.FindById(id);

                if (clientWrapper.UserID > 0)
                {
                    SystemUserWrapper.DeleteByID(clientWrapper.UserID);
                }

                SPClientWrapper.DeleteByID(id);

                ScriptManager.AjaxSuccess = true;
            }
            catch (Exception ex)
            {
                ScriptManager.AjaxSuccess      = false;
                ScriptManager.AjaxErrorMessage = string.Format(ex.Message);
                return;
            }
        }
Exemplo n.º 31
0
        protected void btnSaveSPClient_Click(object sender, AjaxEventArgs e)
        {
            try
            {
                //string loginID = this.txtRelateUserLoginID.Text.Trim();

                //if (SystemUserWrapper.GetUserByLoginID(loginID) != null)
                //{
                //    Coolite.Ext.Web.ScriptManager.AjaxSuccess = false;
                //    Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:用户登录ID已存在!";
                //    return;
                //}

                SPClientWrapper obj = new SPClientWrapper();
                obj.Name = this.txtName.Text.Trim();
                obj.Alias = this.txtAlias.Text.Trim();
                obj.IsDefaultClient = false;

                obj.Description = this.txtDescription.Text.Trim();

                if (ClientGroupID<=0)
                {
                    obj.SPClientGroupID =
                        SPClientGroupWrapper.FindById(Convert.ToInt32(this.cmbClientGroupID.SelectedItem.Value));
                }
                else
                {
                    obj.SPClientGroupID = SPClientGroupWrapper.FindById(ClientGroupID);
                }

                //obj.RecieveDataUrl = this.txtRecieveDataUrl.Text.Trim();
                //obj.SyncData = this.chkSyncDate.Checked;
                //obj.OkMessage = this.txtOkMessage.Text.Trim();
                //obj.FailedMessage = this.txtFailedMessage.Text.Trim();
                //obj.SyncType = this.cmbSycnType.SelectedItem.Value;

                //Membership.CreateUser(loginID, this.txtRelateUserPassword.Text.Trim(), this.txtRelateUserLoginID.Text.Trim()+"@163.com");

                //SystemUserWrapper clientUser = SystemUserWrapper.GetUserByLoginID(loginID);

                //clientUser.UserName = loginID;

                //SystemUserWrapper.Update(clientUser);

                //SystemRoleWrapper clientRole = SystemRoleWrapper.GetRoleByName("SPDownUser");

                //SystemUserWrapper.PatchAssignUserRoles(clientUser, new List<string> { clientRole.RoleID.ToString() });

                //obj.UserID = clientUser.UserID;

                SPClientWrapper.Save(obj);

                winSPClientAdd.Hide();

            }
            catch (Exception ex)
            {
                Coolite.Ext.Web.ScriptManager.AjaxSuccess = false;
                Coolite.Ext.Web.ScriptManager.AjaxErrorMessage = "错误信息:" + ex.Message;
            }
        }
Exemplo n.º 32
0
 public static List<SPChannelWrapper> GetChannelByClient(SPClientWrapper spClientWrapper)
 {
     return SPChannelWrapper.ConvertToWrapperList(businessProxy.GetChannelByClient(spClientWrapper.entity));
 }
Exemplo n.º 33
0
 public static List<SPClientChannelSettingWrapper> GetSettingByClient(SPClientWrapper spClientWrapper)
 {
     return ConvertToWrapperList(businessProxy.GetSettingByClient(spClientWrapper.entity));
 }
Exemplo n.º 34
0
 public static List<SPPaymentInfoWrapper> FindAllByOrderByAndFilterAndClientID(string orderByColumnName, bool isDesc,int pageIndex, int pageSize,    SPClientWrapper clientID,  out int recordCount)
 {
     return ConvertToWrapperList(businessProxy.FindAllByOrderByAndFilterAndClientID(orderByColumnName, isDesc,pageIndex, pageSize,   clientID.entity,out recordCount));
 }
Exemplo n.º 35
0
 public static List<SPPaymentInfoWrapper> FindAllByClientID(SPClientWrapper clientID)
 {
     return ConvertToWrapperList(businessProxy.FindAllByClientID(clientID.entity));
 }