Beispiel #1
0
        public async Task <int> SeedDiscounts(IDiscountsService discountsService)
        {
            if (discountsService.All().Count == 0)
            {
                var child = new InputDiscountViewModel
                {
                    Name    = InputModelsConstants.ChildDiscountText,
                    Percent = InputModelsConstants.ChildDiscountPercent
                };
                var senior = new InputDiscountViewModel
                {
                    Name    = InputModelsConstants.SeniorDiscountText,
                    Percent = InputModelsConstants.SeniorDiscountPercent
                };
                var student = new InputDiscountViewModel
                {
                    Name    = InputModelsConstants.StudentDiscountText,
                    Percent = InputModelsConstants.StudentDiscountPercent
                };
                var normal = new InputDiscountViewModel
                {
                    Name    = InputModelsConstants.NormalDiscountText,
                    Percent = InputModelsConstants.NormalDiscountPercent
                };
                await discountsService.Add(child);

                await discountsService.Add(senior);

                await discountsService.Add(student);

                await discountsService.Add(normal);
            }

            return(0);
        }
 public TicketsController(ITicketsService ticketsService, ITripsService tripsService, IDiscountsService discountsService, UserManager <User> userManager)
 {
     this._ticketsService   = ticketsService;
     this._tripsService     = tripsService;
     this._discountsService = discountsService;
     this._userManager      = userManager;
 }
Beispiel #3
0
 public TripsService(IRepository <Trip> tripsRepository, ICitiesService citiesService, ITransportsService transportsService, IDiscountsService discountsService)
 {
     this._tripsRepository   = tripsRepository;
     this._citiesService     = citiesService;
     this._transportsService = transportsService;
     this._discountsService  = discountsService;
 }
Beispiel #4
0
 public PriceCalculator(IPriceService priceService, IDiscountsService discountsService,
                        IEnumerable <ItemId> oldItemsIds)
 {
     _priceService     = priceService;
     _discountsService = discountsService;
     _oldItems         = oldItemsIds.ToList();
 }
Beispiel #5
0
 public InvoicesController(IInvoiceService invoiceService, ICustomerService customerService,
                           IDiscountsService discountsService, IProductService productService)
 {
     _invoiceService   = invoiceService;
     _discountsService = discountsService;
     _customerService  = customerService;
     _productService   = productService;
 }
Beispiel #6
0
 public InvoiceService(shopRUDBContext context,
                       ICustomerService customerService, IDiscountsService discountsService, IProductService productService)
 {
     _context          = context;
     _customerService  = customerService;
     _discountsService = discountsService;
     _productService   = productService;
 }
 public MedicinesService(
     IDeletableEntityRepository <Medicine> medicinesRepository,
     ITargetsService targetsService,
     IDiscountsService discountsService)
 {
     this.medicinesRepository = medicinesRepository;
     this.targetsService      = targetsService;
     this.discountsService    = discountsService;
 }
 public OrdersModel(UserManager <User> userManager, IOrderService orderService, ICustomerService customerService, IDeliveryAddressService deliveryAddressService, IAddressService addressService, IItemService itemService, IOrderHasItemService orderHasItemService, IPhotoService photoService, IDiscountsService discountsService)
 {
     _userManager            = userManager;
     _orderService           = orderService;
     _customerService        = customerService;
     _deliveryAddressService = deliveryAddressService;
     _addressService         = addressService;
     _itemService            = itemService;
     _orderHasItemService    = orderHasItemService;
     _photoService           = photoService;
     _discountsService       = discountsService;
 }
 public ProductsController(
     IProductsService productsService,
     ICategoryService categoryService,
     IBagService bagService,
     UserManager <ApplicationUser> userManager,
     IDiscountsService discountsService)
 {
     this.productsService  = productsService;
     this.categoryService  = categoryService;
     this.bagService       = bagService;
     this.userManager      = userManager;
     this.discountsService = discountsService;
 }
Beispiel #10
0
 public AdministrationController(
     IProductsService productsService,
     IImgService imgService,
     ICategoryService categoryService,
     IBagService bagService,
     IOrderDataService orderDataService,
     IDiscountsService discountsService)
 {
     this.productsService  = productsService;
     this.imgService       = imgService;
     this.categoryService  = categoryService;
     this.bagService       = bagService;
     this.orderDataService = orderDataService;
     this.discountsService = discountsService;
 }
 public BagController(IBagService bagService, UserManager <ApplicationUser> userManager, IDiscountsService discountsService)
 {
     this.bagService       = bagService;
     this.userManager      = userManager;
     this.discountsService = discountsService;
 }
 public TicketsService(IRepository <Ticket> ticketRepository, IDiscountsService discountsService, ITripsService tripsService)
 {
     this._ticketRepository = ticketRepository;
     this._discountsService = discountsService;
     this._tripsService     = tripsService;
 }
Beispiel #13
0
 public PriceCalculator(IPriceService priceService, IDiscountsService discountsService)
     : this(priceService, discountsService, new List <ItemId>())
 {
 }
Beispiel #14
0
 public DiscountsController(IBusPublisher busPublisher,
                            IDiscountsService discountsService, ITracer tracer) : base(busPublisher, tracer)
 {
     _discountsService = discountsService;
 }
 public DiscountsModel(IDiscountsService discountsService)
 {
     _discountsService = discountsService;
 }
Beispiel #16
0
 public DiscountsController(IDiscountsService discountsService)
 {
     this._discountsService = discountsService;
 }
Beispiel #17
0
        public async Task InvokeAsync(HttpContext httpContext, TravelDreamDbContext dbContext, RoleManager <IdentityRole> roleManager, UserManager <User> userManager, IDiscountsService discountsService)
        {
            this._roleManager = roleManager;
            this._userManager = userManager;
            this.SeedRoles(roleManager, userManager);
            await this.SeedDiscounts(discountsService);

            await this.SeedAdmin(roleManager, userManager);

            await this._next(httpContext);
        }