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 void PatchAdd(int channleId)
        {
            SPChannelEntity spChannelEntity =
                this.DataObjectsContainerIocID.SPChannelDataObjectInstance.Load(channleId);

            List <SPChannelDefaultClientSycnParamsEntity> paramsEntities =
                this.SelfDataObj.GetList_By_SPChannelEntity(spChannelEntity);

            foreach (SPChannelDefaultClientSycnParamsEntity paramsEntity in paramsEntities)
            {
                this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Delete(paramsEntity);
            }

            SPChannelDefaultClientSycnParamsEntity moParamsEntity = new SPChannelDefaultClientSycnParamsEntity();

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

            this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Save(moParamsEntity);

            SPChannelDefaultClientSycnParamsEntity linkidParamsEntity = new SPChannelDefaultClientSycnParamsEntity();

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

            this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Save(linkidParamsEntity);

            SPChannelDefaultClientSycnParamsEntity mobileParamsEntity = new SPChannelDefaultClientSycnParamsEntity();

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

            this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Save(mobileParamsEntity);


            SPChannelDefaultClientSycnParamsEntity spCodeParamsEntity = new SPChannelDefaultClientSycnParamsEntity();

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

            this.DataObjectsContainerIocID.SPChannelDefaultClientSycnParamsDataObjectInstance.Save(spCodeParamsEntity);
        }
        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);
        }
Example #4
0
 internal SPChannelDefaultClientSycnParamsWrapper(SPChannelDefaultClientSycnParamsEntity entityObj)
 {
     entity = entityObj;
 }
Example #5
0
        internal static SPChannelDefaultClientSycnParamsWrapper ConvertEntityToWrapper(SPChannelDefaultClientSycnParamsEntity entity)
        {
            if (entity == null)
            {
                return(null);
            }

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

            return(new SPChannelDefaultClientSycnParamsWrapper(entity));
        }
Example #6
0
 internal SPChannelDefaultClientSycnParamsWrapper(SPChannelDefaultClientSycnParamsEntity entityObj)
 {
     entity = entityObj;
 }
Example #7
0
        internal static SPChannelDefaultClientSycnParamsWrapper ConvertEntityToWrapper(SPChannelDefaultClientSycnParamsEntity entity)
        {
            if (entity == null)
                return null;
				
            if (entity.Id == 0)
                return null;

            return new SPChannelDefaultClientSycnParamsWrapper(entity);
        }