コード例 #1
0
        public void Delete(Location location, AccomodationRepository hotelRepository)
        {
            int locationCount = 0;

            foreach (Hotel hotel in hotelRepository.AccomodationList)
            {
                if (hotel.Location.FullName == location.FullName)
                {
                    locationCount++;
                }
            }

            if (locationCount == 1)
            {
                _locationList.Remove(location);
            }
        }
コード例 #2
0
 public MainRepository()
 {
     _accomodationRepository = new AccomodationRepository();
     _locationRepository     = new LocationRepository();
     _reservationRepository  = new ReservationRepository();
 }