//Navegacion entre ventanas
        private void btnNewReservation_Click(object sender, RoutedEventArgs e)
        {
            QuoteReview newQuo = new QuoteReview();

            newQuo.Show();
            this.Close();
        }
Esempio n. 2
0
        //Redirect user to quote review window and allow user to adjust reservation details
        private void btnCancel_Click(object sender, RoutedEventArgs e)
        {
            QuoteReview quoRev = new QuoteReview();

            quoRev.Show();
            this.Close();
        }
Esempio n. 3
0
        private void btnCreateReservation_Click(object sender, RoutedEventArgs e)
        {
            #region User Input Validation
            //Validate all entries (except email) is filled
            if (txtFirstName.Text == "" ||
                txtLastName.Text == "" ||
                txtCreditCardNumber.Text == "" ||
                txtPhone.Text == "")
            {
                MessageBox.Show("Please enter the required information (marked by *).");
                return;
            }

            //Validate phone number
            string strPhoneNumber, strEmail;
            strPhoneNumber = txtPhone.Text;
            if (strPhoneNumber.Length != 10 || !strPhoneNumber.All(Char.IsDigit))
            {
                MessageBox.Show("Please enter a valid phone number.");
                return;
            }

            //Validate email address
            strEmail = txtEmail.Text;
            if (!IsValidEmailAddress(strEmail))
            {
                MessageBox.Show("Please enter a valid email address or leave it blank.");
                return;
            }

            //Validate credit card
            if (!bolValidCreditCard || lblCreditCardType.ContentStringFormat == "")
            {
                MessageBox.Show("Please enter a valid credit card information.");
                return;
            }
            #endregion

            //Set customer details for the reservation
            CurReservation.setCustomerDetails(txtFirstName.Text, txtLastName.Text, lblCreditCardTypeResult.ContentStringFormat,
                                              txtCreditCardNumber.Text, txtPhone.Text, txtEmail.Text);

            //Show a message box displaying all information for confirmation
            MessageBoxResult messageBoxResult = MessageBox.Show("Please confirm reservation details"
                                                                + Environment.NewLine + Environment.NewLine + CurReservation.ToString()
                                                                , "Reserve"
                                                                , MessageBoxButton.YesNo);

            //Add reservation to the reservation file and redirect user to quote review
            //window to prepare for a new reservation
            if (messageBoxResult == MessageBoxResult.Yes)
            {
                reservationList.Add(CurReservation);
                AppendToFile(CurReservation);
                ClearUserInput();
                MessageBox.Show("New reservation created!");
                QuoteReview quoRev = new QuoteReview();
                quoRev.Show();
                this.Close();
            }
        }
Esempio n. 4
0
        private void btnCreateReservation_Click(object sender, RoutedEventArgs e)
        {
            #region User Input Validation
            //Validate all entries (except email) is filled
            if (txtFirstName.Text == "" ||
                txtLastName.Text == "" ||
                txtCreditCardNumber.Text == "" ||
                txtPhone.Text == "")
            {
                MessageBox.Show("Please enter the required information (marked by *).");
                return;
            }

            //Validate phone number
            string strPhoneNumber, strEmail;
            strPhoneNumber = txtPhone.Text;
            if (strPhoneNumber.Length != 10 || !strPhoneNumber.All(Char.IsDigit))
            {
                MessageBox.Show("Please enter a valid phone number.");
                return;
            }

            //Validate email address
            strEmail = txtEmail.Text;
            if (!IsValidEmailAddress(strEmail))
            {
                MessageBox.Show("Please enter a valid email address or leave it blank.");
                return;
            }

            //Validate credit card
            if (!bolValidCreditCard || lblCreditCardType.ContentStringFormat == "")
            {
                MessageBox.Show("Please enter a valid credit card information.");
                return;
            }
            #endregion

            //Establecer los detalles del cliente para la reserva.
            CurReservation.setCustomerDetails(txtFirstName.Text, txtLastName.Text, lblCreditCardTypeResult.ContentStringFormat,
                                              txtCreditCardNumber.Text, txtPhone.Text, txtEmail.Text);

            //Muestra un cuadro de mensaje que muestra toda la información para confirmación.
            MessageBoxResult messageBoxResult = MessageBox.Show("Por favor confirme los detalles de la reserva"
                                                                + Environment.NewLine + Environment.NewLine + CurReservation.ToString()
                                                                , "Reserva"
                                                                , MessageBoxButton.YesNo);

            //Agregar reserva al archivo de reserva y redirigir al usuario a la revisión de cotización
            //Ventana para preparar una nueva reserva.
            if (messageBoxResult == MessageBoxResult.Yes)
            {
                reservationList.Add(CurReservation);
                AppendToFile(CurReservation);
                ClearUserInput();
                MessageBox.Show("Nueva reserva creada!");
                QuoteReview quoRev = new QuoteReview();
                quoRev.Show();
                this.Close();
            }
        }