コード例 #1
0
 //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;
 }
コード例 #2
0
        public static Reservation Create()
        {
            Reservation reservation = new Reservation();

            reservations.Add(reservation);

            return reservation;
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        //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;
        }
コード例 #5
0
        //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;

        }
コード例 #6
0
        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);
        }
コード例 #7
0
 public static void Delete(Reservation reservation)
 {
     reservations.Remove(reservation);
 }
コード例 #8
0
 public static void Add(Reservation reservation)
 {
     reservations.Add(reservation);
 }
コード例 #9
0
 //DataGrid Selection changed
 public void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     currentlySelectedCustomer = (Customer)dataGrid.SelectedItem;
     currentlySelectedRoom = (Room)dataGridRoom.SelectedItem;
     currentlySelectedReservation = (Reservation)dataGridReservations.SelectedItem;
 }
コード例 #10
0
 private void dataGridReservations_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     currentSelectedReservation = (Reservation)dataGridReservations.SelectedItem;
 }