public List<SPClientChannelSycnParamsEntity> GetAllEnableParams(SPClientChannelSettingEntity entity)
        {
            NHibernateDynamicQueryGenerator<SPClientChannelSycnParamsEntity> queryGenerator = this.GetNewQueryBuilder();

            queryGenerator.AddWhereClause(PROPERTY_CLIENTCHANNELSETTINGID.Eq(entity));

            return this.FindListByQueryBuilder(queryGenerator);
        }
        public List <SPClientChannelSycnParamsEntity> GetAllEnableParams(SPClientChannelSettingEntity entity)
        {
            NHibernateDynamicQueryGenerator <SPClientChannelSycnParamsEntity> queryGenerator = this.GetNewQueryBuilder();

            queryGenerator.AddWhereClause(PROPERTY_CLIENTCHANNELSETTINGID.Eq(entity));

            return(this.FindListByQueryBuilder(queryGenerator));
        }
Exemplo n.º 3
0
		/// <summary>
		/// 全构造函数
		/// </summary>
		public SPClientChannelSycnParamsEntity( int id, string name, string description, bool? isEnable, bool? isRequired, SPClientChannelSettingEntity clientChannelSettingID, string mappingParams, string title)
		{
			_id = id;
			_name = name;
			_description = description;
			_isEnable = isEnable;
			_isRequired = isRequired;
			_clientChannelSettingID = clientChannelSettingID;
			_mappingParams = mappingParams;
			_title = title;
		}
Exemplo n.º 4
0
		/// <summary>
		/// 默认构造函数
		/// </summary>
		public SPClientChannelSycnParamsEntity()
		{
			_id = 0;
			_name = null;
			_description = null;
			_isEnable = null;
			_isRequired = null;
			_clientChannelSettingID = null;
			_mappingParams = null;
			_title = null;
		}
        internal static SPClientChannelSettingWrapper ConvertEntityToWrapper(SPClientChannelSettingEntity entity)
        {
            if (entity == null)
            {
                return(null);
            }

            if (entity.Id == 0)
            {
                return(null);
            }

            return(new SPClientChannelSettingWrapper(entity));
        }
Exemplo n.º 6
0
        public void UpdateRecordAndReport(DayliyReport dayReport, SPClientChannelSettingEntity spClientChannelSettingEntity, int newIntercept)
        {
            if (newIntercept < 0)
            {
                return;
            }
            if (newIntercept > dayReport.TotalCount)
            {
                return;
            }

            int newCount = dayReport.InterceptCount - newIntercept;

            if (newCount == 0)
            {
                return;
            }

            string sql = "";

            if (newCount < 0)
            {
                sql = string.Format("Update SPPaymentInfo set IsIntercept = 1 where ID In (select Top {0} id from dbo.SPPaymentInfo where ChannleClientID = {1} and CreateDate > '{2}' and CreateDate < '{3}' and IsIntercept = 0)", newCount * -1, spClientChannelSettingEntity.Id, dayReport.ReportDate.Date, dayReport.ReportDate.Date.AddDays(1));
            }
            else
            {
                sql = string.Format("Update SPPaymentInfo set IsIntercept = 0 where ID In (select Top {0} id from dbo.SPPaymentInfo where ChannleClientID = {1} and CreateDate > '{2}' and CreateDate < '{3}' and IsIntercept = 1)", newCount, spClientChannelSettingEntity.Id, dayReport.ReportDate.Date, dayReport.ReportDate.Date.AddDays(1));
            }

            this.AdoNetDb.ExecuteNoQuery(sql, CommandType.Text);

            if (dayReport.ReportDate.Date < System.DateTime.Now.Date)
            {
                SPDayReportEntity spDayReportEntity =
                    this.DataObjectsContainerIocID.SPDayReportDataObjectInstance.FindReportByChannelIDChannelIDAndDate(spClientChannelSettingEntity.ChannelID.Id, spClientChannelSettingEntity.ClinetID.Id, dayReport.ReportDate.Date);

                if (spDayReportEntity == null)
                {
                    return;
                }

                spDayReportEntity.InterceptTotalCount = newIntercept;
                spDayReportEntity.DownTotalCount      = dayReport.TotalCount - newIntercept;
                this.DataObjectsContainerIocID.SPDayReportDataObjectInstance.Update(spDayReportEntity);
            }
        }
        public int ChangeClientUser(SPClientChannelSettingEntity oldClientEntity, string clientName, string clientAlias, string userLoginId, int userId, decimal?defaultClientPrice)
        {
            SPClientEntity mainclientEntity = new SPClientEntity();

            mainclientEntity.Name            = oldClientEntity.ChannelID.Name + userLoginId;
            mainclientEntity.Description     = oldClientEntity.ChannelID.Name + userLoginId;
            mainclientEntity.UserID          = userId;
            mainclientEntity.IsDefaultClient = false;
            mainclientEntity.Alias           = "";

            this.DataObjectsContainerIocID.SPClientDataObjectInstance.Save(mainclientEntity);

            SPClientChannelSettingEntity mainChannelClient = new SPClientChannelSettingEntity();

            mainChannelClient.Name              = oldClientEntity.ChannelID.Name + userLoginId;
            mainChannelClient.Description       = oldClientEntity.ChannelID.Name + userLoginId;
            mainChannelClient.ChannelID         = oldClientEntity.ChannelID;
            mainChannelClient.ClinetID          = mainclientEntity;
            mainChannelClient.InterceptRate     = oldClientEntity.InterceptRate;
            mainChannelClient.InterceptRateType = oldClientEntity.InterceptRateType;
            mainChannelClient.OrderIndex        = oldClientEntity.OrderIndex;
            mainChannelClient.UpRate            = oldClientEntity.UpRate;
            mainChannelClient.DownRate          = oldClientEntity.DownRate;
            mainChannelClient.CommandColumn     = oldClientEntity.CommandColumn;
            mainChannelClient.CommandType       = oldClientEntity.CommandType;
            mainChannelClient.CommandCode       = oldClientEntity.CommandCode;
            mainChannelClient.SyncData          = false;
            mainChannelClient.ChannelCode       = oldClientEntity.ChannelCode;
            mainChannelClient.Disable           = false;
            mainChannelClient.FailedMessage     = "failed";
            mainChannelClient.OkMessage         = "ok";
            mainChannelClient.SyncDataUrl       = "";
            mainChannelClient.SyncType          = "2";
            mainChannelClient.DefaultPrice      = defaultClientPrice;

            this.DataObjectsContainerIocID.SPClientChannelSettingDataObjectInstance.Save(mainChannelClient);

            oldClientEntity.Disable = true;

            this.DataObjectsContainerIocID.SPClientChannelSettingDataObjectInstance.Save(oldClientEntity);

            return(mainclientEntity.Id);
        }
        public void QuickAdd(string loginId, string code, SPChannelEntity channelEntity, int mainloginuserId, List <CodeUserID> codeUserIds, string channelCode, int orderIndex, bool hasSubCode, string codeType, string allowAndDisableArea, string getway, string dayLimit, string monthLimit, string sendText)
        {
            SPClientEntity mainclientEntity = new SPClientEntity();

            mainclientEntity.Name            = channelEntity.Name + loginId;
            mainclientEntity.Description     = channelEntity.Name + loginId;
            mainclientEntity.UserID          = mainloginuserId;
            mainclientEntity.IsDefaultClient = false;
            mainclientEntity.Alias           = "";

            this.DataObjectsContainerIocID.SPClientDataObjectInstance.Save(mainclientEntity);

            SPClientChannelSettingEntity mainChannelClient = new SPClientChannelSettingEntity();

            mainChannelClient.Name          = channelEntity.Name + loginId;
            mainChannelClient.Description   = channelEntity.Name + loginId;
            mainChannelClient.ChannelID     = channelEntity;
            mainChannelClient.ClinetID      = mainclientEntity;
            mainChannelClient.InterceptRate = 0;
            mainChannelClient.OrderIndex    = orderIndex;
            mainChannelClient.UpRate        = 0;
            mainChannelClient.DownRate      = 0;
            mainChannelClient.CommandColumn = "ywid";
            if (codeType == "1")
            {
                mainChannelClient.CommandType = "1";
            }
            else if (codeType == "2")
            {
                mainChannelClient.CommandType = "3";
            }
            else
            {
                mainChannelClient.CommandType = "3";
            }
            mainChannelClient.CommandCode         = code;
            mainChannelClient.SyncData            = false;
            mainChannelClient.ChannelCode         = channelCode;
            mainChannelClient.Disable             = false;
            mainChannelClient.AllowAndDisableArea = allowAndDisableArea;
            mainChannelClient.Getway     = getway;
            mainChannelClient.DayLimit   = dayLimit;
            mainChannelClient.MonthLimit = monthLimit;
            mainChannelClient.SendText   = sendText;



            this.DataObjectsContainerIocID.SPClientChannelSettingDataObjectInstance.Save(mainChannelClient);

            foreach (CodeUserID codeUserId in codeUserIds)
            {
                SPClientEntity subClientEntity = new SPClientEntity();
                subClientEntity.Name            = channelEntity.Name + loginId + codeUserId.Code;
                subClientEntity.Description     = channelEntity.Name + loginId + codeUserId.Code;
                subClientEntity.UserID          = codeUserId.UserID;
                subClientEntity.IsDefaultClient = false;
                subClientEntity.Alias           = "";



                this.DataObjectsContainerIocID.SPClientDataObjectInstance.Save(subClientEntity);


                SPClientChannelSettingEntity subChannelClient = new SPClientChannelSettingEntity();

                subChannelClient.Name                = channelEntity.Name + loginId + codeUserId.Code;
                subChannelClient.Description         = channelEntity.Name + loginId + codeUserId.Code;
                subChannelClient.ChannelID           = channelEntity;
                subChannelClient.ClinetID            = subClientEntity;
                subChannelClient.InterceptRate       = 0;
                subChannelClient.OrderIndex          = orderIndex + 1;
                subChannelClient.UpRate              = 0;
                subChannelClient.DownRate            = 0;
                subChannelClient.CommandColumn       = "ywid";
                subChannelClient.CommandType         = "3";
                subChannelClient.CommandCode         = code + codeUserId.Code;
                subChannelClient.SyncData            = false;
                subChannelClient.ChannelCode         = channelCode;
                subChannelClient.Disable             = false;
                subChannelClient.AllowAndDisableArea = allowAndDisableArea;
                subChannelClient.Getway              = getway;
                subChannelClient.DayLimit            = dayLimit;
                subChannelClient.MonthLimit          = monthLimit;
                subChannelClient.SendText            = sendText;

                this.DataObjectsContainerIocID.SPClientChannelSettingDataObjectInstance.Save(subChannelClient);
            }
        }
 internal SPClientChannelSettingWrapper(SPClientChannelSettingEntity entityObj)
 {
     entity = entityObj;
 }
        public void QuickAddIVR(SPChannelEntity spChannelWrapper, string linkPName, string mobilePName, string spCodePName, string startTimePName,
                                string endTimePName, string feetimePName, int userID)
        {
            spChannelWrapper.Rate  = 11;
            spChannelWrapper.Price = Convert.ToDecimal("1.00");
            this.SelfDataObj.Save(spChannelWrapper);

            SPClientEntity spClientEntity = new SPClientEntity();

            spClientEntity.Name            = spChannelWrapper.Name + "默认下家";
            spClientEntity.Description     = spChannelWrapper.Name + "默认下家";
            spClientEntity.UserID          = userID;
            spClientEntity.IsDefaultClient = true;
            spClientEntity.Alias           = "";


            this.DataObjectsContainerIocID.SPClientDataObjectInstance.Save(spClientEntity);


            SPClientChannelSettingEntity obj = new SPClientChannelSettingEntity();

            obj.Name          = spChannelWrapper.Name + "默认下家";
            obj.Description   = spChannelWrapper.Name + "默认下家";
            obj.ChannelID     = spChannelWrapper;
            obj.ClinetID      = spClientEntity;
            obj.InterceptRate = 0;
            obj.OrderIndex    = 0;
            obj.UpRate        = 0;
            obj.DownRate      = 0;
            obj.CommandColumn = "ywid";
            obj.CommandType   = "7";
            obj.CommandCode   = "";
            obj.SyncData      = false;

            this.DataObjectsContainerIocID.SPClientChannelSettingDataObjectInstance.Save(obj);

            SPChannelParamsEntity linkidParamsEntity = CreateNewChannelParams(spChannelWrapper, linkPName, "唯一标识", "linkid");

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(linkidParamsEntity);

            SPChannelParamsEntity mobileParamsEntity = CreateNewChannelParams(spChannelWrapper, mobilePName, "手机号码", "mobile");

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(mobileParamsEntity);

            SPChannelParamsEntity spCodeParamsEntity = CreateNewChannelParams(spChannelWrapper, spCodePName, "通道号码", "cpid");

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(spCodeParamsEntity);

            SPChannelParamsEntity moCodeParamsEntity = CreateNewChannelParams(spChannelWrapper, spCodePName, "上行内容", "ywid");

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(moCodeParamsEntity);

            SPChannelParamsEntity fcountCodeParamsEntity = CreateNewChannelParams(spChannelWrapper, "fcount", "fcount", "extendfield3");

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(fcountCodeParamsEntity);

            if (!string.IsNullOrEmpty(startTimePName))
            {
                SPChannelParamsEntity startTimeParamsEntity = CreateNewChannelParams(spChannelWrapper, startTimePName, "计费开始时间", "extendfield1");

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(startTimeParamsEntity);
            }

            if (!string.IsNullOrEmpty(endTimePName))
            {
                SPChannelParamsEntity endTimeParamsEntity = CreateNewChannelParams(spChannelWrapper, endTimePName, "计费结束时间", "extendfield2");

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(endTimeParamsEntity);
            }

            if (!string.IsNullOrEmpty(feetimePName))
            {
                SPChannelParamsEntity feetimeParamsEntity = CreateNewChannelParams(spChannelWrapper, feetimePName, "计费时长", "extendfield5");

                this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(feetimeParamsEntity);
            }


            string sycnParamNameFeetime = "feetime";

            SPChannelDefaultClientSycnParamsEntity feetimeSendParamsEntity = new SPChannelDefaultClientSycnParamsEntity();

            feetimeSendParamsEntity.ChannelID     = spChannelWrapper;
            feetimeSendParamsEntity.Name          = sycnParamNameFeetime;
            feetimeSendParamsEntity.Title         = sycnParamNameFeetime;
            feetimeSendParamsEntity.Description   = "计费时长";
            feetimeSendParamsEntity.IsEnable      = true;
            feetimeSendParamsEntity.IsRequired    = true;
            feetimeSendParamsEntity.MappingParams = "extendfield3";

            this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Save(feetimeSendParamsEntity);

            string sycnParamNameLinkID = "linkid";

            if (!string.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameLinkID"]))
            {
                sycnParamNameLinkID = System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameLinkID"];
            }

            SPChannelDefaultClientSycnParamsEntity linkidSendParamsEntity = new SPChannelDefaultClientSycnParamsEntity();

            linkidSendParamsEntity.ChannelID     = spChannelWrapper;
            linkidSendParamsEntity.Name          = sycnParamNameLinkID;
            linkidSendParamsEntity.Title         = sycnParamNameLinkID;
            linkidSendParamsEntity.Description   = "唯一标识";
            linkidSendParamsEntity.IsEnable      = true;
            linkidSendParamsEntity.IsRequired    = true;
            linkidSendParamsEntity.MappingParams = "linkid";

            this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Save(linkidSendParamsEntity);


            string sycnParamNameMobile = "mobile";

            if (!string.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameMobile"]))
            {
                sycnParamNameMobile = System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameMobile"];
            }

            SPChannelDefaultClientSycnParamsEntity mobileSendParamsEntity = new SPChannelDefaultClientSycnParamsEntity();

            mobileSendParamsEntity.ChannelID     = spChannelWrapper;
            mobileSendParamsEntity.Name          = sycnParamNameMobile;
            mobileSendParamsEntity.Title         = sycnParamNameMobile;
            mobileSendParamsEntity.Description   = "手机号码";
            mobileSendParamsEntity.IsEnable      = true;
            mobileSendParamsEntity.IsRequired    = true;
            mobileSendParamsEntity.MappingParams = "mobile";

            this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Save(mobileSendParamsEntity);


            string sycnParamNameSPCode = "spCode";

            if (!string.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameSPCode"]))
            {
                sycnParamNameSPCode = System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameSPCode"];
            }



            SPChannelDefaultClientSycnParamsEntity spCodeSendParamsEntity = new SPChannelDefaultClientSycnParamsEntity();

            spCodeSendParamsEntity.ChannelID     = spChannelWrapper;
            spCodeSendParamsEntity.Name          = sycnParamNameSPCode;
            spCodeSendParamsEntity.Title         = sycnParamNameSPCode;
            spCodeSendParamsEntity.Description   = "通道号码";
            spCodeSendParamsEntity.IsEnable      = true;
            spCodeSendParamsEntity.IsRequired    = true;
            spCodeSendParamsEntity.MappingParams = "cpid";

            this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Save(spCodeSendParamsEntity);
        }
Exemplo n.º 11
0
 public List <SPClientChannelSycnParamsEntity> FindAllByOrderByAndFilterAndClientChannelSettingID(string orderByColumnName, bool isDesc, int pageIndex, int pageSize, SPClientChannelSettingEntity _clientChannelSettingID, out int recordCount)
 {
     return(this.SelfDataObj.GetPageList_By_SPClientChannelSettingEntity(orderByColumnName, isDesc, pageIndex, pageSize, _clientChannelSettingID, out recordCount));
 }
Exemplo n.º 12
0
 public List <SPClientChannelSycnParamsEntity> FindAllByClientChannelSettingID(SPClientChannelSettingEntity _clientChannelSettingID)
 {
     return(this.SelfDataObj.GetList_By_SPClientChannelSettingEntity(_clientChannelSettingID));
 }
 public void ResetIntercept(SPClientChannelSettingEntity spClientChannelSettingEntity, DateTime date, int dataCount)
 {
     this.AdoNetDb.ResetIntercept(spClientChannelSettingEntity.Id, date, dataCount);
 }
 public List <SPClientChannelSycnParamsEntity> GetAllEnableParams(SPClientChannelSettingEntity entity)
 {
     return(this.DataObjectsContainerIocID.SPClientChannelSycnParamsDataObjectInstance.GetAllEnableParams(entity));
 }
        public void QuickAdd(SPChannelEntity spChannelWrapper, string linkPName, string mobilePName, string spCodePName, string moPName, int userID)
        {
            spChannelWrapper.Rate  = 11;
            spChannelWrapper.Price = Convert.ToDecimal("1.00");
            this.SelfDataObj.Save(spChannelWrapper);

            SPClientEntity spClientEntity = new SPClientEntity();

            spClientEntity.Name            = spChannelWrapper.Name + "默认下家";
            spClientEntity.Description     = spChannelWrapper.Name + "默认下家";
            spClientEntity.UserID          = userID;
            spClientEntity.IsDefaultClient = true;
            spClientEntity.Alias           = "";


            this.DataObjectsContainerIocID.SPClientDataObjectInstance.Save(spClientEntity);


            SPClientChannelSettingEntity obj = new SPClientChannelSettingEntity();

            obj.Name          = spChannelWrapper.Name + "默认下家";
            obj.Description   = spChannelWrapper.Name + "默认下家";
            obj.ChannelID     = spChannelWrapper;
            obj.ClinetID      = spClientEntity;
            obj.InterceptRate = 0;
            obj.OrderIndex    = 0;
            obj.UpRate        = 0;
            obj.DownRate      = 0;
            obj.CommandColumn = "ywid";
            obj.CommandType   = "7";
            obj.CommandCode   = "";
            obj.SyncData      = false;

            this.DataObjectsContainerIocID.SPClientChannelSettingDataObjectInstance.Save(obj);

            SPChannelParamsEntity moParamsEntity = new SPChannelParamsEntity();

            moParamsEntity.ChannelID         = spChannelWrapper;
            moParamsEntity.Name              = moPName;
            moParamsEntity.Title             = moPName;
            moParamsEntity.Description       = "上行内容";
            moParamsEntity.IsEnable          = true;
            moParamsEntity.IsRequired        = true;
            moParamsEntity.IsUnique          = false;
            moParamsEntity.ParamsMappingName = "ywid";
            moParamsEntity.ParamsType        = "普通参数";

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(moParamsEntity);

            SPChannelParamsEntity linkidParamsEntity = new SPChannelParamsEntity();

            linkidParamsEntity.ChannelID         = spChannelWrapper;
            linkidParamsEntity.Name              = linkPName;
            linkidParamsEntity.Title             = linkPName;
            linkidParamsEntity.Description       = "唯一标识";
            linkidParamsEntity.IsEnable          = true;
            linkidParamsEntity.IsRequired        = true;
            linkidParamsEntity.IsUnique          = false;
            linkidParamsEntity.ParamsMappingName = "linkid";
            linkidParamsEntity.ParamsType        = "普通参数";

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(linkidParamsEntity);

            SPChannelParamsEntity mobileParamsEntity = new SPChannelParamsEntity();

            mobileParamsEntity.ChannelID         = spChannelWrapper;
            mobileParamsEntity.Name              = mobilePName;
            mobileParamsEntity.Title             = mobilePName;
            mobileParamsEntity.Description       = "手机号码";
            mobileParamsEntity.IsEnable          = true;
            mobileParamsEntity.IsRequired        = true;
            mobileParamsEntity.IsUnique          = false;
            mobileParamsEntity.ParamsMappingName = "mobile";
            mobileParamsEntity.ParamsType        = "普通参数";

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(mobileParamsEntity);


            SPChannelParamsEntity spCodeParamsEntity = new SPChannelParamsEntity();

            spCodeParamsEntity.ChannelID         = spChannelWrapper;
            spCodeParamsEntity.Name              = spCodePName;
            spCodeParamsEntity.Title             = spCodePName;
            spCodeParamsEntity.Description       = "通道号码";
            spCodeParamsEntity.IsEnable          = true;
            spCodeParamsEntity.IsRequired        = true;
            spCodeParamsEntity.IsUnique          = false;
            spCodeParamsEntity.ParamsMappingName = "cpid";
            spCodeParamsEntity.ParamsType        = "普通参数";

            this.DataObjectsContainerIocID.SPChannelParamsDataObjectInstance.Save(spCodeParamsEntity);

            string sycnParamNameMO = "mo";

            if (!string.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameMO"]))
            {
                sycnParamNameMO = System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameMO"];
            }

            SPChannelDefaultClientSycnParamsEntity moSendParamsEntity = new SPChannelDefaultClientSycnParamsEntity();

            moSendParamsEntity.ChannelID     = spChannelWrapper;
            moSendParamsEntity.Name          = sycnParamNameMO;
            moSendParamsEntity.Title         = sycnParamNameMO;
            moSendParamsEntity.Description   = "上行内容";
            moSendParamsEntity.IsEnable      = true;
            moSendParamsEntity.IsRequired    = true;
            moSendParamsEntity.MappingParams = "ywid";

            this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Save(moSendParamsEntity);

            string sycnParamNameLinkID = "linkid";

            if (!string.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameLinkID"]))
            {
                sycnParamNameLinkID = System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameLinkID"];
            }

            SPChannelDefaultClientSycnParamsEntity linkidSendParamsEntity = new SPChannelDefaultClientSycnParamsEntity();

            linkidSendParamsEntity.ChannelID     = spChannelWrapper;
            linkidSendParamsEntity.Name          = sycnParamNameLinkID;
            linkidSendParamsEntity.Title         = sycnParamNameLinkID;
            linkidSendParamsEntity.Description   = "唯一标识";
            linkidSendParamsEntity.IsEnable      = true;
            linkidSendParamsEntity.IsRequired    = true;
            linkidSendParamsEntity.MappingParams = "linkid";

            this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Save(linkidSendParamsEntity);


            string sycnParamNameMobile = "mobile";

            if (!string.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameMobile"]))
            {
                sycnParamNameMobile = System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameMobile"];
            }

            SPChannelDefaultClientSycnParamsEntity mobileSendParamsEntity = new SPChannelDefaultClientSycnParamsEntity();

            mobileSendParamsEntity.ChannelID     = spChannelWrapper;
            mobileSendParamsEntity.Name          = sycnParamNameMobile;
            mobileSendParamsEntity.Title         = sycnParamNameMobile;
            mobileSendParamsEntity.Description   = "手机号码";
            mobileSendParamsEntity.IsEnable      = true;
            mobileSendParamsEntity.IsRequired    = true;
            mobileSendParamsEntity.MappingParams = "mobile";

            this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Save(mobileSendParamsEntity);


            string sycnParamNameSPCode = "spCode";

            if (!string.IsNullOrEmpty(System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameSPCode"]))
            {
                sycnParamNameSPCode = System.Configuration.ConfigurationManager.AppSettings["DefaultSycnParamNameSPCode"];
            }



            SPChannelDefaultClientSycnParamsEntity spCodeSendParamsEntity = new SPChannelDefaultClientSycnParamsEntity();

            spCodeSendParamsEntity.ChannelID     = spChannelWrapper;
            spCodeSendParamsEntity.Name          = sycnParamNameSPCode;
            spCodeSendParamsEntity.Title         = sycnParamNameSPCode;
            spCodeSendParamsEntity.Description   = "通道号码";
            spCodeSendParamsEntity.IsEnable      = true;
            spCodeSendParamsEntity.IsRequired    = true;
            spCodeSendParamsEntity.MappingParams = "cpid";

            this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Save(spCodeSendParamsEntity);
        }
        public List <SPClientChannelSycnParamsEntity> GetList_By_SPClientChannelSettingEntity(SPClientChannelSettingEntity fkentity)
        {
            NHibernateDynamicQueryGenerator <SPClientChannelSycnParamsEntity> dynamicQueryGenerator = this.GetNewQueryBuilder();

            dynamicQueryGenerator.AddWhereClause(PROPERTY_CLIENTCHANNELSETTINGID.Eq(fkentity));

            return(this.FindListByQueryBuilder(dynamicQueryGenerator));
        }
        public void QuickAdd(string loginID, string code, SPChannelEntity channelEntity, int mainloginuserID, List <CodeUserID> codeUserIds, string channelCode)
        {
            SPClientEntity mainclientEntity = new SPClientEntity();

            mainclientEntity.Name            = channelEntity.Name + loginID;
            mainclientEntity.Description     = channelEntity.Name + loginID;
            mainclientEntity.UserID          = mainloginuserID;
            mainclientEntity.IsDefaultClient = false;
            mainclientEntity.Alias           = "";

            this.DataObjectsContainerIocID.SPClientDataObjectInstance.Save(mainclientEntity);

            SPClientChannelSettingEntity mainChannelClient = new SPClientChannelSettingEntity();

            mainChannelClient.Name          = channelEntity.Name + loginID;
            mainChannelClient.Description   = channelEntity.Name + loginID;
            mainChannelClient.ChannelID     = channelEntity;
            mainChannelClient.ClinetID      = mainclientEntity;
            mainChannelClient.InterceptRate = 0;
            mainChannelClient.OrderIndex    = 1;
            mainChannelClient.UpRate        = 0;
            mainChannelClient.DownRate      = 0;
            mainChannelClient.CommandColumn = "ywid";
            mainChannelClient.CommandType   = "3";
            mainChannelClient.CommandCode   = code;
            mainChannelClient.SyncData      = false;
            mainChannelClient.ChannelCode   = channelCode;
            mainChannelClient.Disable       = false;

            this.DataObjectsContainerIocID.SPClientChannelSettingDataObjectInstance.Save(mainChannelClient);

            foreach (CodeUserID codeUserId in codeUserIds)
            {
                SPClientEntity subClientEntity = new SPClientEntity();
                subClientEntity.Name            = channelEntity.Name + loginID + codeUserId.Code;
                subClientEntity.Description     = channelEntity.Name + loginID + codeUserId.Code;
                subClientEntity.UserID          = codeUserId.UserID;
                subClientEntity.IsDefaultClient = false;
                subClientEntity.Alias           = "";



                this.DataObjectsContainerIocID.SPClientDataObjectInstance.Save(subClientEntity);


                SPClientChannelSettingEntity subChannelClient = new SPClientChannelSettingEntity();

                subChannelClient.Name          = channelEntity.Name + loginID + codeUserId.Code;
                subChannelClient.Description   = channelEntity.Name + loginID + codeUserId.Code;
                subChannelClient.ChannelID     = channelEntity;
                subChannelClient.ClinetID      = subClientEntity;
                subChannelClient.InterceptRate = 0;
                subChannelClient.OrderIndex    = 2;
                subChannelClient.UpRate        = 0;
                subChannelClient.DownRate      = 0;
                subChannelClient.CommandColumn = "ywid";
                subChannelClient.CommandType   = "3";
                subChannelClient.CommandCode   = code + codeUserId.Code;
                subChannelClient.SyncData      = false;
                subChannelClient.ChannelCode   = channelCode;
                subChannelClient.Disable       = false;

                this.DataObjectsContainerIocID.SPClientChannelSettingDataObjectInstance.Save(subChannelClient);
            }
        }
 public decimal CaculteActualInterceptRate(SPClientChannelSettingEntity entity, DateTime date)
 {
     return(AdoNetDb.CaculteActualInterceptRate(entity.Id, date));
 }
Exemplo n.º 19
0
        public void PatchAdd(int channleClientId)
        {
            SPClientChannelSettingEntity spClientChannelSettingEntity =
                this.DataObjectsContainerIocID.SPClientChannelSettingDataObjectInstance.Load(channleClientId);

            List <SPClientChannelSycnParamsEntity> paramsEntities =
                this.SelfDataObj.GetList_By_SPClientChannelSettingEntity(spClientChannelSettingEntity);


            foreach (SPClientChannelSycnParamsEntity paramsEntity in paramsEntities)
            {
                this.DataObjectsContainerIocID.SPClientChannelSycnParamsDataObjectInstance.Delete(paramsEntity);
            }

            SPClientChannelSycnParamsEntity moParamsEntity = new SPClientChannelSycnParamsEntity();

            moParamsEntity.ClientChannelSettingID = spClientChannelSettingEntity;
            moParamsEntity.Name          = "mo";
            moParamsEntity.Title         = "mo";
            moParamsEntity.Description   = "上行内容";
            moParamsEntity.IsEnable      = true;
            moParamsEntity.IsRequired    = true;
            moParamsEntity.MappingParams = "ywid";

            this.DataObjectsContainerIocID.SPClientChannelSycnParamsDataObjectInstance.Save(moParamsEntity);

            SPClientChannelSycnParamsEntity linkidParamsEntity = new SPClientChannelSycnParamsEntity();

            linkidParamsEntity.ClientChannelSettingID = spClientChannelSettingEntity;
            linkidParamsEntity.Name          = "linkid";
            linkidParamsEntity.Title         = "linkid";
            linkidParamsEntity.Description   = "唯一标识";
            linkidParamsEntity.IsEnable      = true;
            linkidParamsEntity.IsRequired    = true;
            linkidParamsEntity.MappingParams = "linkid";

            this.DataObjectsContainerIocID.SPClientChannelSycnParamsDataObjectInstance.Save(linkidParamsEntity);

            SPClientChannelSycnParamsEntity mobileParamsEntity = new SPClientChannelSycnParamsEntity();

            mobileParamsEntity.ClientChannelSettingID = spClientChannelSettingEntity;
            mobileParamsEntity.Name          = "mobile";
            mobileParamsEntity.Title         = "mobile";
            mobileParamsEntity.Description   = "手机号码";
            mobileParamsEntity.IsEnable      = true;
            mobileParamsEntity.IsRequired    = true;
            mobileParamsEntity.MappingParams = "mobile";

            this.DataObjectsContainerIocID.SPClientChannelSycnParamsDataObjectInstance.Save(mobileParamsEntity);


            SPClientChannelSycnParamsEntity spCodeParamsEntity = new SPClientChannelSycnParamsEntity();

            spCodeParamsEntity.ClientChannelSettingID = spClientChannelSettingEntity;
            spCodeParamsEntity.Name          = "spCode";
            spCodeParamsEntity.Title         = "spCode";
            spCodeParamsEntity.Description   = "通道号码";
            spCodeParamsEntity.IsEnable      = true;
            spCodeParamsEntity.IsRequired    = true;
            spCodeParamsEntity.MappingParams = "cpid";

            this.DataObjectsContainerIocID.SPClientChannelSycnParamsDataObjectInstance.Save(spCodeParamsEntity);
        }
Exemplo n.º 20
0
 public DayliyReport GetDayReport(DateTime dateTime, SPClientChannelSettingEntity spClientChannelSettingEntity)
 {
     return(this.AdoNetDb.GetDayReport(spClientChannelSettingEntity.ChannelID.Id, spClientChannelSettingEntity.ClinetID.Id, dateTime));
 }
 public void ResetAllSycnCount(SPClientChannelSettingEntity spClientChannelSettingEntity, DateTime date)
 {
     this.AdoNetDb.ResetAllSycnCount(spClientChannelSettingEntity.Id, date);
 }
        public List <SPClientChannelSycnParamsEntity> GetPageList_By_SPClientChannelSettingEntity(string orderByColumnName, bool isDesc, int pageIndex, int pageSize, SPClientChannelSettingEntity fkentity, out int recordCount)
        {
            NHibernateDynamicQueryGenerator <SPClientChannelSycnParamsEntity> dynamicQueryGenerator = this.GetNewQueryBuilder();

            dynamicQueryGenerator.AddWhereClause(PROPERTY_CLIENTCHANNELSETTINGID.Eq(fkentity));

            AddDefaultOrderByToQueryGenerator(orderByColumnName, isDesc, dynamicQueryGenerator);

            dynamicQueryGenerator.SetFirstResult((pageIndex - 1) * pageSize);

            dynamicQueryGenerator.SetMaxResults(pageSize);

            return(FindListByPageByQueryBuilder(dynamicQueryGenerator, out recordCount));
        }
 public int GetSycnFailedCount(SPClientChannelSettingEntity spClientChannelSettingEntity, DateTime date)
 {
     return(this.AdoNetDb.GetSycnFailedCount(spClientChannelSettingEntity.Id, date));
 }