//Update public static void Update(Reservation reservation, object customer, object room, DateTime checkInDate, DateTime checkOutDate) { reservation.Customer = customer; reservation.Room = room; reservation.CheckInDate = checkInDate; reservation.CheckOutDate = checkOutDate; }
public static Reservation Create() { Reservation reservation = new Reservation(); reservations.Add(reservation); return reservation; }
private void button_AddReservation_Click(object sender, RoutedEventArgs e) { Reservation reservation = new Reservation { Customer = "First Name Last Name", Room = "Room Number", CheckInDate = DateTime.Now, CheckOutDate = DateTime.Now }; ReservationRepository.Add(reservation); }
//Create public static Reservation Create(object customer, object room, DateTime checkInDate, DateTime checkOutDate) { Reservation newReservation = new Reservation(); newReservation.Id = Reservation.ReservationsIdCounter; newReservation.Customer = customer; newReservation.Room = room; newReservation.CheckInDate = checkInDate; newReservation.CheckOutDate = checkOutDate; reservations.Add(newReservation); return newReservation; }
//Create public static Reservation Create(int id, DateTime checkin, DateTime checkout, string customer, int room) { Reservation reservation = new Reservation(); reservation.id = id; reservation.CheckInDate = checkin; reservation.CheckOutDate = checkout; reservation.customer = customer; reservation.room = room; reservations.Add(reservation); return reservation; }
private void buttonSaveReservation_Click(object sender, RoutedEventArgs e) { Guid id = ReservationRepository.CreateGuid(); Reservation reservation = new Reservation() { ReservationId = id, Customer = customerSelected, Room = roomSelected, CheckInDate = checkInDate, CheckOutDate = checkOutDate }; ReservationRepository.Add(reservation); }
public static void Delete(Reservation reservation) { reservations.Remove(reservation); }
public static void Add(Reservation reservation) { reservations.Add(reservation); }
//DataGrid Selection changed public void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { currentlySelectedCustomer = (Customer)dataGrid.SelectedItem; currentlySelectedRoom = (Room)dataGridRoom.SelectedItem; currentlySelectedReservation = (Reservation)dataGridReservations.SelectedItem; }
private void dataGridReservations_SelectionChanged(object sender, SelectionChangedEventArgs e) { currentSelectedReservation = (Reservation)dataGridReservations.SelectedItem; }