Example #1
0
        private void SignIn_OnClick(object sender, RoutedEventArgs e)
        {
            CustomerWindow.ClientInfo.LoginDetails.Password = PasswordBox.Password;


            if (firstName.Background != Brushes.White && firstName.BorderBrush != Brushes.Gray ||
                lastName.Background != Brushes.White && lastName.BorderBrush != Brushes.Gray ||
                phon.Background != Brushes.White && phon.BorderBrush != Brushes.Gray ||
                email.Background != Brushes.White && email.BorderBrush != Brushes.Gray ||
                userName.Background != Brushes.White && userName.BorderBrush != Brushes.Gray ||
                PasswordBox.Background != Brushes.White && PasswordBox.BorderBrush != Brushes.Gray ||
                confirme.Background != Brushes.White && confirme.BorderBrush != Brushes.Gray ||
                Gender.SelectedIndex == -1 /* dp1.Length == 0*/)
            {
                MessageBox.Show("Some details you entered are incorrect, please try again", "Failed",
                                MessageBoxButton.OK, MessageBoxImage.Information,
                                MessageBoxResult.None);
                return;
            }

            try
            {
                try
                {
                    _instance.AddCustomerContactInfo(CustomerWindow);
                    MessageBox.Show("Your registration has been successfully completed");

                    NewGuestRequest newRequest = new NewGuestRequest(CustomerWindow.ClientInfo.LoginDetails);
                    newRequest.Show();
                    this.Close();
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.Message);
                    return;
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
                return;
            }
        }