예제 #1
0
 public Customer getByID(int id)
 {
     hotelDB = new HotelDB();
     try
     {
         Customer customer = (from c in hotelDB.Customers
                              where c.id == id
                              select c).First();
         return(customer);
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #2
0
 public Product getByID(int id)
 {
     hotelDB = new HotelDB();
     try
     {
         Product prod = (from p in hotelDB.Products
                         where p.id == id
                         select p).First();
         return(prod);
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #3
0
 public Room getByID(int id)
 {
     hotelDB = new HotelDB();
     try
     {
         Room room = (from r in hotelDB.Rooms
                      where r.id == id
                      select r).First();
         return(room);
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #4
0
 public Consume getByID(int id)
 {
     hotelDB = new HotelDB();
     try
     {
         Consume consume = (from c in hotelDB.Consumes
                            where c.id == id
                            select c).First();
         return(consume);
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #5
0
 public Employee getByID(int id)
 {
     hotelDB = new HotelDB();
     try
     {
         Employee employee = (from e in hotelDB.Employees
                              where e.Id == id
                              orderby e.Id
                              select e).First();
         return(employee);
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #6
0
 public Customer getByRoomID(int id)
 {
     hotelDB = new HotelDB();
     try
     {
         Customer customer = (from c in hotelDB.Customers
                              join r in hotelDB.Rooms
                              on c.roomID equals r.id
                              where c.roomID == id
                              select c).First();
         return(customer);
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #7
0
 public Account()
 {
     hotelDB = new HotelDB();
 }