Exemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                String userName = userTextBox.Text;
                String password = passwordBox.Password.ToString();

                string message;
                if (userName != "" && password != "")
                {
                    message = userLogicTier.AuthenticateUser(userName, password);

                    if (message.Equals("Authentification correct"))
                    {
                        PresentationWindow presentationWindow = new PresentationWindow();
                        this.NavigationService.Navigate(presentationWindow);
                        Response.Text = message;
                    }
                    else
                    {
                        Response.Text = message;
                    }
                }
                else if (userName == "" && password != "")
                {
                    message       = "User name is empty";
                    Response.Text = message;
                }
                else if (userName != "" && password == "")
                {
                    message       = "Password is empty";
                    Response.Text = message;
                }
                else
                {
                    message       = "User name and Password are empty";
                    Response.Text = message;
                }
            }
            catch (Exception a)
            {
                throw a;
            }
        }
Exemplo n.º 2
0
        private void Button_Back_Click(object sender, RoutedEventArgs e)
        {
            PresentationWindow presentationWindow = new PresentationWindow();

            this.NavigationService.Navigate(presentationWindow);
        }