Ejemplo n.º 1
0
        /// <summary>
        /// Gets today's and future reservations
        /// </summary>
        /// <param name="filepath"></param>
        /// <returns></returns>
        public List <IReservation> GetReservations(string filepath)
        {
            List <IReservation> reservations;

            try
            {
                _reservationsRoot = XMLHelper.DeSerialize <ReservationRoot>(filepath);
                reservations      = new List <IReservation>();
                if (_reservationsRoot != null)
                {
                    foreach (var reservation in _reservationsRoot.Reservations)
                    {
                        if (reservation.CheckInDate >= DateTime.Today.Date)
                        {
                            reservations.Add(reservation as IReservation);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(reservations);
        }
Ejemplo n.º 2
0
 public ReservationService()
 {
     _reservationsRoot = new ReservationRoot();
 }