Esempio n. 1
0
        // checks the database which chalets are occupied in the specified period and returns a list of available chalets
        public static List <int> AvailableChalets(DateTime arrivalDate, DateTime departureDate, int chaletId)
        {
            List <int> availableChalets = new List <int> {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10
            };

            if (DatabaseCalls.OccupiedChalets(arrivalDate, departureDate, chaletId) != null)
            {
                foreach (int item in DatabaseCalls.OccupiedChalets(arrivalDate, departureDate, chaletId))
                {
                    availableChalets.Remove(item);
                }
            }
            return(availableChalets);
        }