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); }
public IEnumerable <FacilityReservation> RetrieveByReserveeId(int reserveeId) { return(_facilityReservationRepository.GetByReserveeId(reserveeId)); }