Ejemplo n.º 1
0
        public List <Guest> GetGuestsFor29()
        {
            List <Guest> guests = _guestRepo.GetGuests("29thFeb").ToList();

            guests.ForEach(c => c.TimeOfRSVP = c.TimeOfRSVP.ToLocalTime());
            return(guests);
        }
Ejemplo n.º 2
0
        public GuestDTO[] GetGuests()
        {
            string           connectionString = ConfigurationManager.ConnectionStrings["HotelDatabase"].ConnectionString;
            IGuestRepository repository       = new GuestRepository(connectionString);

            var guests = repository.GetGuests();

            var GuestDTOs = new List <GuestDTO>();

            foreach (var guest in guests)
            {
                GuestDTOs.Add(new GuestDTO()
                {
                    Id = guest.Id, Name = guest.Name, Surname = guest.Surname, Email = guest.Email, Phone = guest.Phone
                });
            }
            return(GuestDTOs.ToArray());
        }
Ejemplo n.º 3
0
 public static List <GuestModel> GetGuests(int year)
 {
     return(GuestRepository.GetGuests(year).OrderBy(g => g.AccessCode).ToList());
 }