Exemplo n.º 1
0
        private void Login_Button_Click(object sender, RoutedEventArgs e)
        {
            var username = UsernameTextBox.Text;
            var password = PasswordTextBox.Text;

            try
            {
                if (ErrorBox.Text.Length > 0)
                {
                    ErrorBox.Text.Remove(0);
                }
                _crudManager.StudentLogin(username, password);
                StudentMain studentMain = new StudentMain(username);
                this.NavigationService.Navigate(studentMain);
            }
            catch (Exception ex)
            {
                ErrorBox.Text = ex.Message;
            }
        }
Exemplo n.º 2
0
        private void Register_Button_Click(object sender, RoutedEventArgs e)
        {
            var username = UsernameRegistrationTextBox.Text;
            var password = PasswordRegistrationTextBox.Text;
            var email    = EmailRegistrationBox.Text;

            try
            {
                if (ErrorBox.Text.Length > 0)
                {
                    ErrorBox.Text.Remove(0);
                }
                _crudManager.CreateStudentAccount(username, password, email);
                StudentMain studentMain = new StudentMain(username);
                this.NavigationService.Navigate(studentMain);
            }
            catch (Exception ex)
            {
                ErrorBox.Text = ex.Message;
            }
        }