private static void emptyTableRoom() { RoomService roomSrv = new RoomService(); roomSrv.emptyTable(); List<RoomBO> bookings = roomSrv.getAllFromTable(); Assert.AreEqual(0, bookings.Count(), string.Format("'Room' Table should be empty.")); }
public RoomsV() { InitializeComponent(); RoomService roomSrv = new RoomService(); List<RoomBO> rooms =roomSrv.getAllFromTable(); listRooms.ItemsSource = rooms; _planButtons.Add(btnPlan1); _planButtons.Add(btnPlan2); _planButtons.Add(btnPlan3); namePlan(rooms); }
// constructor for current logged in admin public ReportV(String adminName) { InitializeComponent(); // determine last available date for period date pickers endDate.DisplayDateEnd = DateTime.Today.AddDays(-1); startDate.DisplayDateEnd = DateTime.Today.AddDays(-1); if (startDate.SelectedDate == null) { startDate.DisplayDate = DateTime.Today.AddDays(-1); } if (endDate.SelectedDate == null) { endDate.DisplayDate = DateTime.Today.AddDays(-1); } RoomService roomSrv = new RoomService(); CustomerService customerSrv = new CustomerService(); AdministratorService adminSrv = new AdministratorService(); //populate list of Customers with Customer Names from database. List<CustomerBO> customers = customerSrv.getAllFromTable(); List<String> customerNames = new List<String>(); foreach (CustomerBO customer in customers) { String customerName = customer.CompanyName; customerNames.Add(customerName); } listCustomers.ItemsSource = customerNames; //populate comboBox of Rooms with room names from database List<RoomBO> rooms = roomSrv.getAllFromTable(); List<String> roomNames = new List<String>(); foreach (RoomBO room in rooms) { String roomName = room.Name; roomNames.Add(roomName); } cboxRooms.ItemsSource = roomNames; }
private static void fullFillTableBooking() { RoomService roomSrv = new RoomService(); List<RoomBO> rooms = roomSrv.getAllFromTable(); Assert.AreNotEqual(0, rooms.Count(), string.Format("There should be values in 'Rooms' Table.")); int existingRoomID = rooms.ElementAt(0).RoomID; CustomerService customerSrv = new CustomerService(); List<CustomerBO> customers = customerSrv.getAllFromTable(); Assert.AreNotEqual(0, customers.Count(), string.Format("There should be values in 'Customer' Table.")); int existingCustomerID = customers.ElementAt(0).CustomerID; AdministratorService adminSrv = new AdministratorService(); List<AdministratorBO> admins = adminSrv.getAllFromTable(); Assert.AreNotEqual(0, admins.Count(), string.Format("There should be values in 'Administrator' Table.")); int existingAdminID = admins.ElementAt(0).AdminID; //Verify that booking cannot be created before Customer (CustomerID foreign key) //Verify that booking cannot be created before Room (RoomID foreign key) //Verify that booking cannot be created before Administrator (AdminID foreign key) BookingService bookingSrv = new BookingService(); bookingSrv.addNew(DateTime.Now.AddDays(1), existingRoomID, existingCustomerID, 25, DateTime.Now, existingAdminID, "no smoking");// take first from list bookingSrv.addNew(DateTime.Now.AddDays(1), existingRoomID, existingCustomerID, 40, DateTime.Now, existingAdminID, "no pets allowed"); bookingSrv.addNew(DateTime.Now.AddDays(10), existingRoomID, existingCustomerID, 77, DateTime.Now, existingAdminID, "reconfirm by phone"); bookingSrv.addNew(DateTime.Now.AddDays(17), existingRoomID, existingCustomerID, 55, DateTime.Now, existingAdminID, "reconfirm by phone tomorrow"); bookingSrv.addNew(DateTime.Now.AddDays(-5), existingRoomID, existingCustomerID, 10, DateTime.Now.AddDays(-8), existingAdminID, "catering "); bookingSrv.addNew(DateTime.Now.AddDays(-2), existingRoomID, existingCustomerID, 100, DateTime.Now.AddDays(-5), existingAdminID, "no catering"); List<BookingBO> bookings = bookingSrv.getAllFromTable(); Assert.AreNotEqual(0, bookings.Count(), string.Format("There should be values in 'Booking' Table.")); }
private static void fullFillTableRoom() { RoomService roomSrv = new RoomService(); roomSrv.addNew("Saturn", 130, true);//TODO: take first from list roomSrv.addNew("Marss", 30, false); roomSrv.addNew("Merkuur", 55, true); List<RoomBO> rooms = roomSrv.getAllFromTable(); Assert.AreNotEqual(0, rooms.Count(), string.Format("There should be values in 'Rooms' Table.")); }