Ejemplo n.º 1
0
        /// <summary>
        /// This function is responsible for the series of actions that will be performed when this button is clicked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void submit_Click(object sender, RoutedEventArgs e)
        {
            string    password = PasswordContent.Password;
            string    userName = userNameTxtBox.Text;
            authority au;

            if (Status == "PASSENGER")
            {
                au = authority.Passenger;
            }
            else if (Status == "DRIVER")
            {
                au = authority.Driver;
            }
            else
            {
                au = authority.CEO;
            }
            try
            {
                User user = bl.Authinticate(userName, password, au);
                if (Status == "PASSENGER")
                {
                    new OptionsForPassenger().Show();
                }
                else if (Status == "DRIVER")
                {
                    new OptionsForDriver().Show();
                }
                else
                {
                    new OptionsForCEO().Show();
                }
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Exception", MessageBoxButton.OK, MessageBoxImage.Information);
                new SignIn(Status).Show();
                this.Close();
            }
        }