public static bool ChangePassword(User user) { try { using (var dlg = new dlgPassword(user)) { if (dlg.ShowDialog() == DialogResult.OK) { UpdatePassword(user, dlg.txtNewPassword.Text.Trim()); return(true); } return(false); } } catch (Exception) { throw; } }
public static void ChangePassword() { try { using (var dlg = new dlgPassword()) { if (dlg.ShowDialog() == DialogResult.OK) { var User = (AppUser)dlg.cbUserName.SelectedItem; UpdatePassword(User, dlg.txtNewPassword.Text.Trim()); } else { return; } } ChangePassword(); } catch (Exception) { throw; } }