Exemplo n.º 1
0
        public static void UpdateGuest(Person p)
        {
            CUResortEntities DB = new CUResortEntities();

            DB.Entry(p).State = System.Data.Entity.EntityState.Modified;
            DB.SaveChanges();
        }
Exemplo n.º 2
0
        public static void UpdateReservation(Reservation r)
        {
            CUResortEntities DB = new CUResortEntities();

            DB.Entry(r).State = System.Data.Entity.EntityState.Modified;
            DB.SaveChanges();
        }
Exemplo n.º 3
0
        public static void AddGuest(Person p)
        {
            CUResortEntities DB = new CUResortEntities();

            DB.People.Add(p);
            DB.SaveChanges();
        }
Exemplo n.º 4
0
        public static List <Reservation> GetReservations()
        {
            // ordered by Date Reserved

            CUResortEntities DB = new CUResortEntities();

            return(DB.Reservations.OrderBy(x => x.DateReserved).ToList());
        }
Exemplo n.º 5
0
        public static void DeleteGuest(int ID)
        {
            CUResortEntities DB = new CUResortEntities();
            Person           p  = DB.People.Find(ID);

            DB.People.Remove(p);
            DB.SaveChanges();
        }
Exemplo n.º 6
0
        public static void DeleteReservation(int ID)
        {
            CUResortEntities DB = new CUResortEntities();
            Reservation      r  = DB.Reservations.Find(ID);

            DB.Reservations.Remove(r);
            DB.SaveChanges();
        }
Exemplo n.º 7
0
        public static void AddReservation(Reservation r)
        {
            CUResortEntities DB = new CUResortEntities();

            if (r.DateReserved == null)
            {
                r.DateReserved = DateTime.Now;
            }
            DB.Reservations.Add(r);
            DB.SaveChanges();
        }
Exemplo n.º 8
0
        public static List <Person> GetGuests()
        {
            CUResortEntities DB = new CUResortEntities();

            return(DB.People.OrderBy(x => x.LNAME).ToList());
        }
Exemplo n.º 9
0
        public static int CountGuestReservations(int GuestID)
        {
            CUResortEntities DB = new CUResortEntities();

            return(DB.Reservations.Where(x => x.GID == GuestID).Count());
        }
Exemplo n.º 10
0
        public static Reservation GetReservationByID(int ID)
        {
            CUResortEntities DB = new CUResortEntities();

            return(DB.Reservations.Find(ID));
        }
Exemplo n.º 11
0
        public static Person GetPersonByID(int ID)
        {
            CUResortEntities DB = new CUResortEntities();

            return(DB.People.Find(ID));
        }
Exemplo n.º 12
0
        public static List <Room> GetRooms()
        {
            CUResortEntities DB = new CUResortEntities();

            return(DB.Rooms.ToList());
        }
Exemplo n.º 13
0
        public static List <Anemity> GetAnemities()
        {
            CUResortEntities DB = new CUResortEntities();

            return(DB.Anemities.OrderBy(x => x.Description).ToList());
        }