Ejemplo n.º 1
0
        private void NewUser_Click(object sender, RoutedEventArgs e)
        {
            UserDialogView dialog = new UserDialogView();

            dialog.ShowDialog();
            GridUsers.ItemsSource = null;
            GridUsers.ItemsSource = AuthController.GetAllUsers();
        }
Ejemplo n.º 2
0
        private void Find_Click(object sender, RoutedEventArgs e)
        {
            User u = AuthController.LoadByLogin(FindBox.Text);

            if (u == null)
            {
                MessageBox.Show("Пользователь не найден", "Ошибка поиска", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                UserDialogView dialog = new UserDialogView(u);
                dialog.ShowDialog();
                FindBox.Text          = null;
                GridUsers.ItemsSource = null;
                GridUsers.ItemsSource = AuthController.GetAllUsers();
            }
        }
Ejemplo n.º 3
0
        private void ChangePass_Click(object sender, RoutedEventArgs e)
        {
            User u;

            if (sender as MenuItem != null)
            {
                u = AuthController.LoadByLogin("Admin");
            }
            else
            {
                u = (User)GridUsers.SelectedItem;
            }
            if (u != null)
            {
                UserDialogView dialog = new UserDialogView(u);
                dialog.ShowDialog();
                GridUsers.ItemsSource = null;
                GridUsers.ItemsSource = AuthController.GetAllUsers();
            }
            else
            {
                MessageBox.Show("Пользователь не выбран", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }