Beispiel #1
0
        private void btnCollectCar_Click(object sender, EventArgs e)
        {
            if (cboCollectCar.Text.Equals(""))
            {
                MessageBox.Show("Chose booking to collect car", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                cboCollectCar.Focus();
                return;
            }

            var bookingStatus = new Booking();

            bookingStatus.setStatus(txtBookingStatus.Text);
            bookingStatus.setBookNo(Convert.ToInt32(txtBookingID.Text));
            bookingStatus.bookingStatus();

            var reCar = new Cars();

            reCar.setAvailability(txtStatusCar.Text);
            reCar.setRegNo(txtReg.Text);


            reCar.collectCar();

            //Display Confirmation Message
            MessageBox.Show("Car " + cboCollectCar.Text + " has been collected", "Confirmation", MessageBoxButtons.OK,
                            MessageBoxIcon.Information);
            clearUi();
            cboCollectCar.Items.Clear();
            loadData();
        }
Beispiel #2
0
        public void updateBookingCar()
        {
            var bookingStatus = new Booking();

            bookingStatus.setStatus(txtBookingStatus.Text);
            bookingStatus.setBookNo(Convert.ToInt32(txtBookingID.Text));
            bookingStatus.bookingStatus();

            var reCar = new Cars();

            reCar.setAvailability(txtStatusCar.Text);
            reCar.setRegNo(txtReg.Text);

            reCar.collectCar();

            MessageBox.Show("Car with registration " + txtReg.Text + " has been returned", "Confirmation", MessageBoxButtons.OK,
                            MessageBoxIcon.Information);
            print();
        }