public AdminWindow(string AdminLogin, string AdminPass)
        {
            InitializeComponent();
            StudentEditor.Init();
            AdminEditor.Init();
            DisciplineEditor.Init();
            LoggedAdminLogin = AdminLogin;
            AddAdminTab      = new AddAdminTab(this);

            if (!DBInterface.GetAdminPermission(AdminLogin, AdminPass))
            {
                AddAdminTabItem.IsEnabled = false;
            }
            SAddMaleRB.IsChecked   = true;
            SAddFemaleRB.IsChecked = false;
            DataLoad();
        }
Beispiel #2
0
 private void AdminsSave_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         AdminEditor.SaveChanges();
         MessageBox.Show(AdminWindow,
                         $"Сохраниние успешно!",
                         "Успех!",
                         MessageBoxButton.OK,
                         MessageBoxImage.Information
                         );
     }
     catch (Exception)
     {
         MessageBox.Show(AdminWindow,
                         $"Ошибка при сохранении!",
                         "Ошибка",
                         MessageBoxButton.OK,
                         MessageBoxImage.Error
                         );
     }
 }
Beispiel #3
0
 private void DataLoad()
 {
     AdminsDG.ItemsSource = AdminEditor.GetAdmins();
 }