Пример #1
0
        public RentalWindow(IRentalService rentalService, Equipment equipment)
        {
            RentalService = rentalService;

            InitializeComponent();

            ViewModel = DataContext as RentalWindowVM;
            ViewModel.Equipment = equipment;
        }
        public ReturnReceipt MakeRentalReturn(string rentalNumber, double currentMilage, DateTime returnDateTime, IRentalService rentalService)
        {
            var returnRequest = new ReturnRequest()
            {
                CurrentMilageKm = currentMilage,
                RentalNumber = rentalNumber,
                ReturnDateTime = returnDateTime,
            };

            var returnReceipt = rentalService.ReturnVehicle(returnRequest);

            return returnReceipt;
        }
        public RentalReceipt MakeRentalRequest(string vehicleTypeName, string regNo, DateTime rentalDay, string personnummer, double currentMilage, IRentalService rentalService)
        {
            // Rental request data
            string vehicleTypeToRent = vehicleTypeName;

            var rentalRequest = new RentalRequest()
            {
                RentDateTime = rentalDay,
                CurrentMilageKm = currentMilage,
                CustomerInfo = new CustomerInfo() { PersonNummer = personnummer },
                VehicleTypeName = vehicleTypeToRent,
                RegNo = regNo
            };
            var rentalReceipt = rentalService.RentVehicle(rentalRequest);
            return rentalReceipt;
        }
Пример #4
0
 public RentalsController(IRentalService rentalService)
 {
     _rentalService = rentalService;
 }
Пример #5
0
 public RentalsController(IRentalService rentalService, IPaymentService paymentService)
 {
     _rentalService  = rentalService;
     _paymentService = paymentService;
 }
 public ScenarioHelper(ICarService carService, IDriverService driverService, IScooterService scooterService, IRentalService rentalService)
 {
     this._driverService  = driverService;
     this._carService     = carService;
     this._rentalService  = rentalService;
     this._scooterService = scooterService;
 }
 public CustomersController(ICustomerService customerService, IRentalService rentalService)
 {
     _customerService = customerService;
     _rentalService   = rentalService;
 }
Пример #8
0
 public RentalController(IRentalService rentalService,
                         ILogger <RentalController> logger)
 {
     _rentalService = rentalService;
     _logger        = logger;
 }
Пример #9
0
 public RentalController(IRentalService rentalsService, LinkGenerator linkGenerator)
 {
     this.rentalsService = rentalsService;
     this.linkGenerator  = linkGenerator;
 }
Пример #10
0
 public RentalsController(IRentalService rentalService, IFakeBankService bankService)
 {
     _rentalService = rentalService;
     _bankService   = bankService;
 }
Пример #11
0
 public RentalsController(IRentalService _services)
 {
     services = _services;
 }
 public void Setup()
 {
     _rentalServiceMock         = Substitute.For <IRentalService>();
     _rentalViewModelMapperMock = Substitute.For <IRentalViewModelMapper>();
 }
Пример #13
0
 public InvoiceController(IRentalService rentalService)
 {
     _rentalService = rentalService;
 }
Пример #14
0
 public PaymentsController(IRentalService rentalService, IPaymentService paymentService)
 {
     _paymentService = paymentService;
 }
Пример #15
0
 public OrdersController(IRentalService rentalService, IOrdersRepository ordersRepository, IMemoryCache memoryCache)
 {
     _rentalService    = rentalService;
     _ordersRepository = ordersRepository;
     _memoryCache      = memoryCache;
 }
Пример #16
0
 public RentalController(IRentalService rentalService)
 {
     this._rentalService = rentalService;
 }
Пример #17
0
 public RentalController(IRentalService service)
 {
     this.service = service;
 }
Пример #18
0
        private double GetRentalCost(string vehicleTypeName, string regNo, double numberOfDays, double numberOfKm, IRentalService rentalService)
        {
            //
            // Make a rental request and check that registred
            //
            const double currentMilage = 10001;
            var rentalDay = new DateTime(2015, 10, 14);
            var rentalReceipt = MakeRentalRequest(vehicleTypeName, regNo, rentalDay, "19800101-8211", currentMilage, rentalService);
            Assert.IsTrue(rentalReceipt.Status == ERentalRequestStatus.Ok);
            var rentalInfo = rentalService.GetRental(rentalReceipt.RentalNumber);
            Assert.IsTrue(rentalInfo.Status == RentalInfo.ERentStatus.Rented);

            //
            // Make a rental return and check that registred
            //
            var returnReceipt = MakeRentalReturn(rentalReceipt.RentalNumber, currentMilage + numberOfKm, rentalDay.AddDays(numberOfDays), rentalService);
            Assert.IsTrue(returnReceipt.Status == ERentalReturnStatus.Ok);
            rentalInfo = rentalService.GetRental(rentalReceipt.RentalNumber);
            Assert.IsTrue(rentalInfo.Status == RentalInfo.ERentStatus.Returned);

            var rentalToPay = rentalService.GetPriceForRental(rentalReceipt.RentalNumber, _dailyBaseCost, _milageKmBaseCost);

            return rentalToPay;
        }
Пример #19
0
 public PaymentManager(IRentalService rentalService)
 {
     _rentalService = rentalService;
 }
Пример #20
0
 public PaymentManager(IPaymentDal paymentDal, IRentalService rentalService, ICustomerService customerService)
 {
     _paymentDal      = paymentDal;
     _rentalService   = rentalService;
     _customerService = customerService;
 }
Пример #21
0
 public CarManager(ICarDal carDal,IRentalService rentalService)
 {
     _carDal = carDal;
     _rentalService = rentalService;
   
 }
Пример #22
0
 public RentalsController(IRentalService _rentalService)
 {
     rentalService = _rentalService;
 }
Пример #23
0
 public UserService(IUserRepository userRepository, IRentalService rentalService)
 {
     this.userRepository = userRepository;
     this.rentalService  = rentalService;
 }
Пример #24
0
        public static void SeedInitialData(IDriverService driverService, ICarService carService, IRentalService rentalService,
                                           IRentalAreaService rentalAreaService)
        {
            var driver = new DriverDTO
            {
                Id            = Guid.NewGuid(),
                FirstName     = "Mikołaj",
                LastName      = "Fitowski",
                LicenseNumber = "CDJ813"
            };

            var driver1 = new DriverDTO
            {
                Id            = Guid.NewGuid(),
                FirstName     = "Paweł",
                LastName      = "Nowak",
                LicenseNumber = "ABBCDEFD"
            };

            var driver2 = new DriverDTO
            {
                Id            = new Guid(),
                FirstName     = "Michał",
                LastName      = "Kowalski",
                LicenseNumber = "CD1813"
            };

            driverService.CreateDriver(driver);
            driverService.CreateDriver(driver1);
            driverService.CreateDriver(driver2);

            var rentalArea = new RentalAreaDTO()
            {
                Id   = Guid.NewGuid(),
                Name = "Kraków",
                OutOfBondsPenaltyPerDistanceUnit = 2.5m,
                Area = new List <PositionDTO>()
                {
                    new PositionDTO()
                    {
                        Latitude  = 50.010231,
                        Longitude = 19.899144
                    },
                    new PositionDTO()
                    {
                        Latitude  = 50.011054,
                        Longitude = 20.042123
                    },
                    new PositionDTO()
                    {
                        Latitude  = 50.093429,
                        Longitude = 20.057025
                    },
                    new PositionDTO()
                    {
                        Latitude  = 50.094973,
                        Longitude = 19.870131
                    }
                },
                CarStartingPositionDTO = new PositionDTO()
                {
                    Latitude  = 50.057236,
                    Longitude = 19.945147,
                }
            };

            rentalAreaService.CreateRentalArea(rentalArea);

            var car = new CarDTO
            {
                Id = Guid.NewGuid(),
                RegistrationNumber = "KR12245",
                RentalAreaId       = rentalArea.Id,
                CurrentLatitude    = 50.057236,
                CurrentLongitude   = 19.945147,
                PricePerMinute     = 1
            };
            var car1 = new CarDTO
            {
                Id = Guid.NewGuid(),
                RegistrationNumber = "KR16345",
                RentalAreaId       = rentalArea.Id,
                CurrentLatitude    = 50.057236,
                CurrentLongitude   = 19.945147,
                PricePerMinute     = 1
            };
            var car2 = new CarDTO
            {
                Id = Guid.NewGuid(),
                RegistrationNumber = "KR02345",
                RentalAreaId       = rentalArea.Id,
                CurrentLatitude    = 50.057236,
                CurrentLongitude   = 19.945147,
                PricePerMinute     = 1
            };
            var car3 = new CarDTO
            {
                Id = Guid.NewGuid(),
                RegistrationNumber = "KRA2345",
                RentalAreaId       = rentalArea.Id,
                CurrentLatitude    = 50.057236,
                CurrentLongitude   = 19.945147,
                PricePerMinute     = 0.5m
            };

            carService.CreateCar(car);
            carService.CreateCar(car1);
            carService.CreateCar(car2);
            carService.CreateCar(car3);


            var rentalId  = Guid.NewGuid();
            var startTime = new DateTime(2020, 04, 19);

            rentalService.TakeCar(rentalId, car.Id, driver.Id, startTime);
            rentalService.ReturnCar(rentalId, DateTime.Now);

            var rentalId1  = Guid.NewGuid();
            var startTime1 = new DateTime(2020, 05, 19);

            rentalService.TakeCar(rentalId1, car1.Id, driver.Id, startTime1);
            rentalService.ReturnCar(rentalId1, DateTime.Now);

            var rentalId2  = Guid.NewGuid();
            var startTime2 = new DateTime(2020, 05, 17);

            rentalService.TakeCar(rentalId2, car2.Id, driver.Id, startTime2);
            rentalService.ReturnCar(rentalId2, DateTime.Now);

            var rentalId3  = Guid.NewGuid();
            var startTime3 = new DateTime(2020, 06, 25, 20, 0, 20);

            rentalService.TakeCar(rentalId3, car3.Id, driver1.Id, startTime3);
        }
Пример #25
0
 public PaymentManager(IPaymentDal paymentDal, IRentalService rentalService)
 {
     _paymentDal    = paymentDal;
     _rentalService = rentalService;
 }
Пример #26
0
 public ProductService(IProductRepository productRepository, IRentalService rentalService)
 {
     this.productRepository = productRepository;
     this.rentalService     = rentalService;
 }
 public RentalForAdminController(IRentalService rentalService)
 {
     _rentalService = rentalService;
 }
Пример #28
0
 public EquipmentController(IRentalService rentalService)
 {
     _rentalService = rentalService;
 }
 public PaymentManager(ICreditCardService creditCardService, IRentalService rentalService, IBankPosService bankPosService)
 {
     _creditCardService = creditCardService;
     _rentalService     = rentalService;
     _bankPosService    = bankPosService;
 }
Пример #30
0
 public RentalController(IRentalService rentalManager)
 {
     _rentalManager = rentalManager;
 }
 public RentalController(IRentalService rentalService, IMapper mapper) : base(mapper)
 {
     _rentalService = rentalService;
 }
 public ReservationApiController(IInventoryService inventoryService, IRentalService rentalService)
 {
     _InventoryService = inventoryService;
     _RentalService    = rentalService;
 }
Пример #33
0
 public RentalsController(IRentalService rentalService) : base(rentalService)
 {
 }
 public ReservationApiController(IInventoryService inventoryService, IRentalService rentalService)
 {
     _InventoryService = inventoryService;
     _RentalService = rentalService;
 }
 public CreditCardManager(ICreditCardDal creditCardDal, ICarService carService, IRentalService rentalService)
 {
     _creditCardDal     = creditCardDal;
     this.carService    = carService;
     this.rentalService = rentalService;
 }