示例#1
0
        public virtual void Create(IPaymentServicesContext context, Service baseEntity)
        {
            name  = baseEntity.Name;
            price = baseEntity.Price;

            dbContext = context;
        }
示例#2
0
        public override void Create(IPaymentServicesContext context, Service baseEntity)
        {
            base.Create(context, baseEntity);

            IActiveService activeService;

            if (!Exists(out activeService))
            {
                var promotionEntity = new SpecialOffer()
                {
                    PlaceId         = objectId,
                    Placement       = placement,
                    ExpiriationTime = DateTime.MinValue,
                    HandlerName     = baseEntity.HandlerName
                };
                dbContext.SpecialOffers.Add(promotionEntity);
                dbContext.SaveChanges();

                activeEntity = promotionEntity;

                return;
            }

            Init(context, baseEntity, activeService);
        }
示例#3
0
        public override void Create(IPaymentServicesContext context, Service baseEntity)
        {
            base.Create(context, baseEntity);

            IActiveService activeService;

            if (!Exists(out activeService))
            {
                var subscriptionEntity = new Subscription()
                {
                    ExpiriationTime = DateTime.MinValue,
                    UserId          = userId,
                    HandlerName     = baseEntity.HandlerName
                };

                context.Subscriptions.Add(subscriptionEntity);
                context.SaveChanges();

                activeEntity = subscriptionEntity;

                return;
            }

            Init(context, baseEntity, activeService);
        }
示例#4
0
        public virtual void Init(IPaymentServicesContext context, Service baseEntity, IActiveService activeServiceEntity)
        {
            name  = baseEntity.Name;
            price = baseEntity.Price;

            dbContext    = context;
            activeEntity = (TEntity)activeServiceEntity;
        }
示例#5
0
 public ServiceBuilder(IPaymentServicesContext dbContext)
 {
     _dbContext = dbContext;
 }
示例#6
0
 public PaymentServices(IPaymentServicesContext paymentContext, IServiceFactory serviceFactory)
 {
     _dbContext      = paymentContext;
     _serviceFactory = serviceFactory;
 }
示例#7
0
 public ServiceFactory(IPaymentServicesContext paymentDbContext, IBuilder <IService> serviceBuilder)
 {
     _dbContext      = paymentDbContext;
     _serviceBuilder = serviceBuilder;
 }
示例#8
0
        public override void Init(IPaymentServicesContext context, Service baseEntity, IActiveService activeServiceEntity)
        {
            base.Init(context, baseEntity, activeServiceEntity);

            objectId = activeEntity.PlaceId;
        }
示例#9
0
        public override void Init(IPaymentServicesContext context, Service baseEntity, IActiveService activeServiceEntity)
        {
            base.Init(context, baseEntity, activeServiceEntity);

            userId = activeEntity.UserId;
        }