Ejemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string login    = LoginTextBox.Text;
            string password = MdpPasswordBox.Password;
            bool   success  = false;

            if ((bool)isStudent.IsChecked)
            {
                success = uc.SignIn(login, password, RoleEnum.student);
            }
            if ((bool)isTeacher.IsChecked)
            {
                success = uc.SignIn(login, password, RoleEnum.teacher);
            }

            if (success == true)
            {
                connect.Visibility = Visibility.Hidden;
                if ((bool)isStudent.IsChecked)
                {
                    Nav.GetInstance().GoTo(ViewEnum.studentControl);
                }
                if ((bool)isTeacher.IsChecked)
                {
                    Nav.GetInstance().GoTo(ViewEnum.teacherControl);
                }
            }
            else
            {
                MessageLabel.Content = "Les identifiants sont incorrects";
            }
        }
Ejemplo n.º 2
0
 public MainWindow()
 {
     InitializeComponent();
     Nav.GetInstance().ChangeView += MainWindow_ChangeView;
 }