private void btnChangeReservation_Click(object sender, EventArgs e)
        {
            var customerID = mainForm.GetSelectedCustomerID();
            var dbm        = new DBmanager();

            dbm.DeleteReservation(customerID);
            using (var subform = new BookARoomForm(mainForm))
            {
                subform.ShowDialog();
            }
            this.Close();
        }
        public void FillInformation()
        {
            var selectedcustomerID = mainForm.GetSelectedCustomerID();
            var dbm = new DBmanager();
            var selectedCustomer = dbm.GetCustomerInformation(selectedcustomerID);

            tBoxFirstName.Text  = selectedCustomer.FirstName.ToString();
            tBoxLastName.Text   = selectedCustomer.LastName.ToString();
            tBoxAddress.Text    = selectedCustomer.Address.ToString();
            tBoxPostalCode.Text = selectedCustomer.PostalCode.ToString();
            tBoxCity.Text       = selectedCustomer.City.ToString();
            tBoxCountry.Text    = selectedCustomer.Country.ToString();
            tBoxPhone.Text      = selectedCustomer.Phone.ToString();
        }
        private void btnBookTheRoom_Click(object sender, EventArgs e)
        {
            if (lstAvaibleRooms.SelectedIndex > -1)
            {
                var selectedRoomType = GetRoomType(lstAvaibleRooms.Text);
                int days             = Convert.ToInt32((checkOutEndDate.Value - CheckInStartDate.Value).TotalDays);

                var bookingDate  = DateTime.Today;
                var lastDayToPay = bookingDate.AddDays(10);

                using (HotelDBContext context = new HotelDBContext())
                {
                    Room room = context.Rooms.FirstOrDefault(r => r.RoomTypeID == selectedRoomType.RoomTypeID);

                    ReservationRoom reservationRoom = new ReservationRoom
                    {
                        RoomID = room.RoomID
                    };
                    Payment payment = new Payment
                    {
                        PaymentAmount = selectedRoomType.PricePerDay * days,
                        Paid          = "No",
                        BookingDate   = DateTime.Today,
                        LastDayToPay  = lastDayToPay
                    };
                    Reservation reservation = new Reservation
                    {
                        StartDate          = CheckInStartDate.Value,
                        EndDate            = checkOutEndDate.Value,
                        CustomerID         = mainForm.GetSelectedCustomerID(),
                        ReservationRoomsID = reservationRoom.ReservationRoomsID,
                        PaymentID          = payment.PaymentID
                    };

                    context.ReservationRooms.Add(reservationRoom);
                    context.Payments.Add(payment);
                    context.Reservations.Add(reservation);
                    context.SaveChanges();
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("You have not selected a room");
            }
        }