private void Set_Permissions() { var con = new Controller(); objUser user = con.Get_User(User); con.Set_AdminPermission(user, this); }
private void BtnSearchUser_Click(object sender, RoutedEventArgs e) { string searchString = txtUsername.Text; if (string.IsNullOrEmpty(searchString)) { MessageBox.Show("Search can not be empty", "Search can not be empty", MessageBoxButton.OK, MessageBoxImage.Warning); return; } Controller con = new Controller(); objUser foundUser = con.Get_User(searchString); if (foundUser == null) { MessageBox.Show("Can not find a user with the username " + searchString, "Search can not be empty", MessageBoxButton.OK, MessageBoxImage.Warning); return; } username = foundUser.Username; this.Close(); }