private void GuestListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            Guest guest;

            if (mdiParentForm.currentGuestForm == null)
            {
                guestForm = new GuestForm(guestController, accountDB);
                mdiParentForm.currentGuestForm = guestForm;
            }

            else
            {
                if (mdiParentForm.currentGuestForm.guestFormClosed)
                {
                    guestForm = new GuestForm(guestController, accountDB);
                    mdiParentForm.currentGuestForm = guestForm;
                }
                else
                {
                    guestForm = mdiParentForm.currentGuestForm;
                }
            }

            guest = guestController.FindByID(guestListView.FocusedItem.Text);
            guestForm.MdiParent = (GuestMDIParent)this.MdiParent;
            guestForm.Show();
            guestForm.Display(guest, GuestForm.FormState.Edit);
            guestListView.Refresh();
        }
        private void GuestComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string toconv = guestComboBox.SelectedItem + "";
            int    pos    = toconv.IndexOf(')');
            string id     = toconv.Substring(0, pos);

            currentGuest = guestController.FindByID(id);
            setUpBookingListView();
            setUpAccountListView();
        }
        private void fillBookings(SqlDataReader reader, string dataTable)
        {
            Booking booking;

            while (reader.Read())
            {
                booking            = new Booking();
                booking.BookingRef = reader.GetInt32(0);
                booking.Room       = reader.GetInt32(1);
                booking.Date       = reader.GetDateTime(2);
                booking.EndDate    = reader.GetDateTime(3);
                string guestID = reader.GetInt32(4) + "";
                booking.Guest = guestController.FindByID(guestID);
                bookings.Add(booking);
            }
        }
        private Booking PopulateBooking()
        {
            Booking booking = new Booking();

            booking.BookingRef = Convert.ToInt32(bookingNoTextBox.Text);
            booking.Room       = Convert.ToInt32(roomNumberTextBox.Text);
            booking.Date       = arrivalDateTimePicker.Value;
            booking.EndDate    = endDateDateTimePicker.Value;
            string toconv = guestComboBox.SelectedItem + "";
            int    pos    = toconv.IndexOf(')');
            string id     = toconv.Substring(0, pos);

            booking.Guest = guestController.FindByID(id);



            return(booking);
        }
Beispiel #5
0
        private Account PopulateAccount()
        {
            Account account = new Account();

            account.AccountNo = Convert.ToInt32(accountNumberTextBox.Text);
            String guestID = guestIDTextBox.Text;

            account.Guest     = guestController.FindByID(guestID);
            account.AmountDue = Convert.ToDouble(amtDueTextBox.Text);
            account.CardNo    = cardNoTextBox.Text;
            account.CardName  = cardNameTextBox.Text;

            account.ExpYear = Decimal.ToInt32(expYearUpDown.Value);

            account.ExpMonth = Decimal.ToInt32(expMonthUpDown.Value);



            return(account);
        }
Beispiel #6
0
        private void FillAccounts(SqlDataReader reader, string dataTable)
        {
            Account account;

            while (reader.Read())
            {
                account           = new Account();
                account.AccountNo = reader.GetInt32(0);

                string guestID = reader.GetInt32(1) + "";

                account.Guest = guestController.FindByID(guestID);

                account.AmountDue = reader.GetFloat(2);

                account.CardNo   = reader.GetString(3).Trim();
                account.CardName = reader.GetString(4).Trim();
                account.ExpMonth = reader.GetInt32(5);
                account.ExpYear  = reader.GetInt32(6);
                accounts.Add(account);
            }
        }