// On load private void EmployeeInterface_Load(object sender, EventArgs e) { hms = new HotelManagementSystem(); // Instantiate hms customers = hms.getCustomerData(); // Get a list of all customers foreach (var pair in customers) // Add each to the listbox for customers { customerListBox.Items.Add($"{pair.Value.getId()} - {pair.Value.getName()} - {pair.Value.getDateOfBirth()}"); } hotels = hms.getHotelData(); // Get a list of all hotels foreach (var pair in hotels) // Add each to the listbox for hotels { hotelListBox.Items.Add($"{pair.Value.getId()} - {pair.Value.getName()} - {pair.Value.getStreetAddress()}, {pair.Value.getCity()}, {pair.Value.getState()}"); managementHotelListBox.Items.Add($"{pair.Value.getId()} - {pair.Value.getName()} - {pair.Value.getStreetAddress()}, {pair.Value.getCity()}, {pair.Value.getState()}"); } }
private void CustomerInterface_Load(object sender, EventArgs e) { Dictionary <int, Reservation> reservations = hms.getActiveReservationsOfCustomer(this.customer.getId()); foreach (var pair in reservations) { reservationListBox.Items.Add($"{pair.Value.getId()} - {pair.Value.getRoomId()} - {pair.Value.getStartDate()} - {pair.Value.getEndDate()}"); } hotels = hms.getHotelData(); // Get a list of all hotels foreach (var pair in hotels) // Add each to the listbox for hotels { hotelListBox.Items.Add($"{pair.Value.getId()} - {pair.Value.getName()} - {pair.Value.getStreetAddress()}, {pair.Value.getCity()}, {pair.Value.getState()}"); } this.rewardPointsLabel.Text = $"Reward Points: {this.customer.getRewardPoints()}"; // Set the label to current worth of reward points // Set the update information text boxes this.usernameTextBox.Text = this.customer.getUsername(); this.firstTextBox.Text = this.customer.getName(); this.passwordTextBox.Text = this.customer.getPassword(); }