예제 #1
0
        public void viewExtractedDetails(int index)
        {
            aGuest = guestController.Find(reservations[index].IdPassport);
            int guestIndex = guestController.FindIndex(aGuest);

            lblResID.Text = reservations[index].Id.ToString();
            lblFname.Text = guests[guestIndex].FirstName;
            lblLname.Text = guests[guestIndex].LastName;
            lblSDate.Text = reservations[index].StartDate;
            lblEDate.Text = reservations[index].EndDate;

            //deposit amnt
            resController.calculateBookingCost(Convert.ToDateTime(reservations[index].StartDate), Convert.ToDateTime(reservations[index].EndDate));
            lblDepositAmount.Text = "R " + String.Format("{0:f2}", resController.Reservation.ReservationAmount * 1 / 10);

            //deposit status
            anAccount = accountController.Find(guestAccounts[index].IDPassport);
            int accountIndex = accountController.FindIndex(anAccount);

            if (guestAccounts[accountIndex].Status == 0)
            {
                lblDepositStatus.Text  = "NOT PAID";
                panelDeposit.BackColor = Color.Red;
            }
            else
            {
                lblDepositStatus.Text  = "PAID";
                panelDeposit.BackColor = Color.Aquamarine;
            }
        }
 private void DisplayDetails(Booking booking)
 {
     roomNumberTextBox.Text      = booking.Room.ToString();
     bookingNoTextBox.Text       = booking.BookingRef.ToString();
     arrivalDateTimePicker.Value = booking.Date;
     endDateDateTimePicker.Value = booking.EndDate;
     try
     {
         guestComboBox.SelectedIndex = guestController.FindIndex(currentBooking.Guest);
     }
     catch
     {
         this.Close();
     }
 }
예제 #3
0
        private void btnCheckIfExists_Click(object sender, EventArgs e)
        {
            if (txtID.Text == "")
            {
                MessageBox.Show("Please fill in missing ID/Passport");
            }
            else
            {
                aGuest = guestController.Find(txtID.Text.Trim());
                int index = guestController.FindIndex(aGuest);
                if (aGuest.IdPassport != txtID.Text)
                {
                    MessageBox.Show("Guest Does not exist. Please create new record.");
                    switchToGuestDetailsPanel();
                }
                else
                {
                    if (guestController.myownfindmethod(txtID.Text) == true)
                    {
                        MessageBox.Show("Guest found.");
                        viewRetrievedGuestDetails(index);
                        switchToGuestDetailsPanel();

                        // add id/passport attribute to reservation
                        reservationController.Reservation.IdPassport = txtID.Text;

                        // show payment form

                        PaymentForm paymentForm = new PaymentForm(restEasy, reservationController, aGuest);
                        paymentForm.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Guest Does not exist. Please create new record.");
                        switchToGuestDetailsPanel();
                    }
                }
            }
        }