Esempio n. 1
0
        public AddCarHire(DateTime arrival, DateTime departure, BookingDetails win)
        {
            InitializeComponent();

            this.win       = win;
            this.arrival   = arrival;
            this.departure = departure;
            this.datePickerStart.DisplayDateStart = arrival;
            this.datePickerEnd.DisplayDateStart   = arrival;
            this.datePickerStart.DisplayDateEnd   = departure;
            this.datePickerEnd.DisplayDateEnd     = departure;

            this.btnSaveCarHire.IsEnabled = false;

            lblArrivalDate.Content   = arrival.Date;
            lblDepartureDate.Content = departure.Date;
        }
Esempio n. 2
0
        public AddCarHire(DateTime arrival, DateTime departure, BookingDetails win, CarHire car)
        {
            InitializeComponent();

            this.win       = win;
            this.arrival   = arrival;
            this.departure = departure;
            this.datePickerStart.DisplayDateStart = arrival;
            this.datePickerEnd.DisplayDateStart   = arrival;
            this.datePickerStart.DisplayDateEnd   = departure;
            this.datePickerEnd.DisplayDateEnd     = departure;

            lblArrivalDate.Content   = arrival.Date;
            lblDepartureDate.Content = departure.Date;
            txtBoxDriverName.Text    = car.DriverName;

            this.datePickerStart.SelectedDate = car.StartDate;
            this.datePickerEnd.SelectedDate   = car.EndDate;
        }
Esempio n. 3
0
        private void btnAddCustomer_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                customer = new Customer();

                customer.Address = txtCustomerAddress.Text;
                customer.Name    = txtCustomerName.Text;


                BookingDetails win = new BookingDetails(booking, customer);

                win.Show();
                this.Close();
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message, "Customer");
            }
        }
        private void btnModifyBookingExtrasAndGuests_Click(object sender, RoutedEventArgs e)
        {
            BookingDetails win = new BookingDetails(b, facade.getGuestsForBooking(b), c, this, facade.getCarHireForBooking(b));

            win.Show();
            this.Hide();

            /*
             * List<Guest> guests = data.getGuests(b.BookingReferenceNumber);
             *
             * bool carFlag = data.checkCarHireForBooking(b.BookingReferenceNumber);
             *
             * CarHire car = data.getCarHire(b.BookingReferenceNumber);
             *
             *
             * NewCustomer win = new NewCustomer(b, guests, c, this, carFlag ,car);
             *
             * win.Show();
             * this.Hide();
             */
        }
        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            this.booking = new Booking();

            try
            {
                SelectedDatesCollection Dates = calendarBookingDate.SelectedDates;

                if (Dates.Count <= 1)
                {
                    throw new ArgumentException("You need to select and drag a range of dates!");
                }
                if (Dates.Count > 1)
                {
                    booking.ArrivalDate   = Dates[0];
                    booking.DepartureDate = Dates[Dates.Count - 1];
                }
                if (Dates[0].Date > Dates[Dates.Count - 1].Date)
                {
                    throw new ArgumentException("The Arrival Date Can't be after the Departure Date!");
                }
                if (customer != null)
                {
                    BookingDetails winB = new BookingDetails(booking, customer, true);
                    winB.Show();
                    this.Close();
                }
                else
                {
                    CustomerWindow win = new CustomerWindow(booking);
                    win.Show();
                    this.Close();
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message, "Booking");
            }
        }