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; } }
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; } }
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; } }
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; } }
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; } }
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; } }
public Account() { hotelDB = new HotelDB(); }