private void BtnRegister_Click(object sender, RoutedEventArgs e)
 {
     if (TbLogin.Text == "" || TbPassword.Text == "")
         MessageBox.Show(Resource.BlankLoginPassword);
     if (_dc.Register(TbLogin.Text, TbPassword.Text))
     {
         var mainPage = new MainPage();
         var navigationService = NavigationService;
         navigationService?.Navigate(mainPage);
     }
     else MessageBox.Show("Логин уже занят!");
 }
 private void BtnLogIn_Click(object sender, RoutedEventArgs e)
 {
     if (TbLogin.Text == "" || TbPassword.Text == "")
         MessageBox.Show(Resource.BlankLoginPassword);
     if (_dc.Login(TbLogin.Text, TbPassword.Text))
     {
         var mainPage = new MainPage();
         var navigationService = NavigationService;
         navigationService?.Navigate(mainPage);
     }
     else MessageBox.Show("Неверная пара логин/пароль!");
 }
        private void BtnAddSubject_Click(object sender, RoutedEventArgs e)
        {
            _dc.AddSubject(_dc.ReturnActiveUser(), new Subject
            {
                Name = TbName.Text,
                HasExam = (bool)CheckExam.IsChecked,
                HasMidterm = (bool)CheckMidterm.IsChecked,
                Summary = TbSummary.Text
            });

            _dc.Entity.SaveChanges();
            var mainPage = new MainPage();
            var navigationService = NavigationService;
            navigationService?.Navigate(mainPage);
        }
Beispiel #4
0
 public App()
 {
     // The root page of your application
     MainPage = new MainPage();
 }