private void btnDelAllUsers_Click(object sender, RoutedEventArgs e) { LinqToSqlDataContext db = PASS.GeneralClasses.DatabaseSetup.Database; IEnumerable <User> allUsers = from u in db.Users select u; foreach (User u in allUsers) { if (u.id != PASS.GeneralClasses.Authentification.AuthUser.Id) // Aktuální uživatel nepůjde smazat { db.Users.DeleteOnSubmit(u); } } try { db.SubmitChanges(); ManagementSetup.InitializeUserTable(dgUsers); DialogHelper.ShowInfo("Všichni uživatelé kromě aktuálně přihlášeného byli odstraněni."); } catch { throw new NotImplementedException(); } }
private void ShowUserEditWindow(int ID) { EditUserWindow euw = new EditUserWindow(ID); euw.Owner = Window.GetWindow(this); euw.WindowStartupLocation = WindowStartupLocation.CenterOwner; euw.ShowDialog(); ManagementSetup.InitializeUserTable(dgUsers); }
private void btnNewUser_Click(object sender, RoutedEventArgs e) { AddUserWindow newUserWindow = new AddUserWindow(); newUserWindow.Owner = Window.GetWindow(this); newUserWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; newUserWindow.ShowDialog(); ManagementSetup.InitializeUserTable(dgUsers); }
private void InitializeInterface() { ManagementSetup.InitializeUserTable(dgUsers); }