Exemple #1
0
        public virtual RoomBookingDTO Compute(Client currentClient, int id, object param)
        {
            repo = (IRoomBookingRepository)base.repo;
            List <PeopleBooking> listPeopleBooking = null;
            List <Period>        listPeriod        = null;

            repo.includes.Add("Booking");
            repo.includes.Add("Room");
            ProcessDTOPostPut(null, id, currentClient);
            ValidateOrig();
            repo.includes.Add("PeopleCategory");
            listPeopleBooking = repo.GetPeopleBookingFromRoomBooking(orig.Id, currentClient.Id).ToList();
            listPeriod        = repo.GetPeriods((DateTime)orig.Booking.DateArrival, (DateTime)orig.Booking.DateDeparture, currentClient.Id).ToList();

            finalPriceHT  = 0;
            finalPriceTTC = 0;
            if (listPeopleBooking.Count == 0)
            {
                ComputeUniqPrice(listPeriod, currentClient);
            }
            else
            {
                ComputePricePerPerson(listPeopleBooking, listPeriod, currentClient);
            }
            if (!validationDictionnary.IsValid)
            {
                throw new ManahostValidationException(validationDictionnary);
            }
            orig.PriceHT  = finalPriceHT;
            orig.PriceTTC = finalPriceTTC;
            repo.Update(orig);
            repo.Save();
            return(GetMapper.Map <RoomBooking, RoomBookingDTO>(orig));
        }
 public RoomBookingController(IRoomBookingRepository repository, ITimeSlotRepository timeSlotRepository,
                              IRoomRepository roomRepository)
 {
     this.timeSlotRepository = timeSlotRepository;
     this.roomRepository     = roomRepository;
     this.repository         = repository;
 }
Exemple #3
0
 public CreateRoomBooking(IRoomBookingRepository roomBookingRepository, ITimeSlotRepository timeSlotRepository,
                          IRoomRepository roomRepository, CreateRoomBookingInput input)
 {
     this.roomBookingRepository = roomBookingRepository;
     this.timeSlotRepository    = timeSlotRepository;
     Input = input;
     this.roomRepository = roomRepository;
 }
 public UpdateRoomBooking(IRoomBookingRepository roomBookingRepository, IRoomRepository roomRepository,
                          ITimeSlotRepository timeSlotRepository, domain.RoomBooking roomBooking)
 {
     this.roomBookingRepository = roomBookingRepository;
     this.roomBooking           = roomBooking;
     this.roomRepository        = roomRepository;
     this.timeSlotRepository    = timeSlotRepository;
 }
 public GetRoomBookingsWithPaging(IRoomBookingRepository roomBookingRepository, int page, int amount)
 {
     this.roomBookingRepository = roomBookingRepository;
     Page   = page;
     Amount = amount;
 }
 public GetAllRoomBookings(IRoomBookingRepository roomBookingRepository)
 {
     this.roomBookingRepository = roomBookingRepository;
 }
 public DeleteRoombooking(IRoomBookingRepository roomBookingRepository, long id)
 {
     this.roomBookingRepository = roomBookingRepository;
     Id = id;
 }
 public GetRoomBookingById(IRoomBookingRepository roomBookingRepository, long roomId)
 {
     this.roomBookingRepository = roomBookingRepository;
     RoomId = roomId;
 }
Exemple #9
0
 public GetBookingsOfRoom(IRoomBookingRepository roomBookingRepository, long roomId)
 {
     this.roomBookingRepository = roomBookingRepository;
     RoomId = roomId;
 }
Exemple #10
0
 public GetBookingsOfRoomStartingAt(IRoomBookingRepository roomBookingRepository, long roomId, DateTime dateTime)
 {
     this.roomBookingRepository = roomBookingRepository;
     RoomId   = roomId;
     DateTime = dateTime;
 }
Exemple #11
0
 public GetRoomBookingsFromDate(IRoomBookingRepository roomBookingRepository, DateTime dateTime)
 {
     this.roomBookingRepository = roomBookingRepository;
     DateTime = dateTime;
 }
Exemple #12
0
 public RoomBookingService(IRoomBookingRepository repo, IValidation <RoomBooking> validation) : base(repo, validation)
 {
     this.repo = repo;
 }
 public GetRoomBookingsOfUser(IRoomBookingRepository roomBookingRepository, long userId)
 {
     this.roomBookingRepository = roomBookingRepository;
     UserId = userId;
 }