public bool DeleteReservation(FacilityReservation facilityReservation)
 {
     if (_facilityReservationRepository.GetById(facilityReservation.ReservationIdDetails()) == null)
     {
         return(false);
     }
     _facilityReservationRepository.Delete(facilityReservation);
     return(true);
 }
예제 #2
0
        public bool DeleteGuest(Guest guest)
        {
            if (guest == null || _guestRepository.GetById(guest.GuestIdDetails()) == null || guest.OutstandingChargesDetails() > 0)
            {
                return(false);
            }

            // Delete all facility reservations made by guest
            IList <FacilityReservation> facilityReservations = _facilityReservationRepository.GetByReserveeId(guest.GuestIdDetails()).ToList();

            foreach (var facilityReservation in facilityReservations)
            {
                _facilityReservationRepository.Delete(facilityReservation);
            }

            _guestRepository.Delete(guest);
            return(true);
        }