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

            newQuo.Show();
            this.Close();
        }
Ejemplo 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();
        }
Ejemplo n.º 3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.winQuoteReview = ((Group5.QuoteReview)(target));
                return;

            case 2:
                this.cbbRoomType = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 3:
                this.lblRoomType = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.lblNumberOfRooms = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.txtNumberOfRooms = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.lblTitle = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.lblInstructions = ((System.Windows.Controls.Label)(target));
                return;

            case 8:
                this.dtpCheckInDate = ((System.Windows.Controls.DatePicker)(target));

            #line 23 "..\..\QuoteReview.xaml"
                this.dtpCheckInDate.SelectedDateChanged += new System.EventHandler <System.Windows.Controls.SelectionChangedEventArgs>(this.dtpCheckInDate_SelectedDateChange);

            #line default
            #line hidden
                return;

            case 9:
                this.dtpCheckOutDate = ((System.Windows.Controls.DatePicker)(target));

            #line 24 "..\..\QuoteReview.xaml"
                this.dtpCheckOutDate.SelectedDateChanged += new System.EventHandler <System.Windows.Controls.SelectionChangedEventArgs>(this.dtpCheckOutDate_SelectedDateChange);

            #line default
            #line hidden
                return;

            case 10:
                this.btnCalculateQuote = ((System.Windows.Controls.Button)(target));

            #line 25 "..\..\QuoteReview.xaml"
                this.btnCalculateQuote.Click += new System.Windows.RoutedEventHandler(this.btnCalculateQuote_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.btnMakeReservation = ((System.Windows.Controls.Button)(target));

            #line 26 "..\..\QuoteReview.xaml"
                this.btnMakeReservation.Click += new System.Windows.RoutedEventHandler(this.btnMakeReservation_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.btnReturnToMainMenu = ((System.Windows.Controls.Button)(target));

            #line 27 "..\..\QuoteReview.xaml"
                this.btnReturnToMainMenu.Click += new System.Windows.RoutedEventHandler(this.btnReturnToMainMenu_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.lblCheckInDate = ((System.Windows.Controls.Label)(target));
                return;

            case 14:
                this.btnClear = ((System.Windows.Controls.Button)(target));

            #line 29 "..\..\QuoteReview.xaml"
                this.btnClear.Click += new System.Windows.RoutedEventHandler(this.btnClear_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.lblMakeReservation = ((System.Windows.Controls.Label)(target));
                return;

            case 16:
                this.lblCalculateQuote = ((System.Windows.Controls.Label)(target));
                return;

            case 17:
                this.lblCheckOutDate = ((System.Windows.Controls.Label)(target));
                return;

            case 18:
                this.borQuoteReview = ((System.Windows.Controls.Border)(target));
                return;

            case 19:
                this.label = ((System.Windows.Controls.Label)(target));
                return;

            case 20:
                this.lblRoomQuantity = ((System.Windows.Controls.Label)(target));
                return;

            case 21:
                this.lblRoomRates = ((System.Windows.Controls.Label)(target));
                return;

            case 22:
                this.lblRoomAvailability = ((System.Windows.Controls.Label)(target));
                return;

            case 23:
                this.lblSubtotal = ((System.Windows.Controls.Label)(target));
                return;

            case 24:
                this.lblTax = ((System.Windows.Controls.Label)(target));
                return;

            case 25:
                this.lblConvenienceFee = ((System.Windows.Controls.Label)(target));
                return;

            case 26:
                this.lblTotal = ((System.Windows.Controls.Label)(target));
                return;

            case 27:
                this.lblRoomQuantityResult = ((System.Windows.Controls.Label)(target));
                return;

            case 28:
                this.lblRoomAvailabilityResult = ((System.Windows.Controls.Label)(target));
                return;

            case 29:
                this.lblSubtotalResult = ((System.Windows.Controls.Label)(target));
                return;

            case 30:
                this.lblTaxResult = ((System.Windows.Controls.Label)(target));
                return;

            case 31:
                this.lblConvenienceFeeResult = ((System.Windows.Controls.Label)(target));
                return;

            case 32:
                this.lblTotalResult = ((System.Windows.Controls.Label)(target));
                return;

            case 33:
                this.lblRoomRatesResult = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
Ejemplo 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

            //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();
            }
        }
Ejemplo n.º 5
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();
            }
        }