private void LinkChangePass_Click(object sender, EventArgs e) { try { UserResetPasswordForm resetPasswordForm = new UserResetPasswordForm(this.user); resetPasswordForm.ShowDialog(); } catch (Exception ex) { ex.ShowDialog(); } }
private void LinkChangePass_Click(object sender, System.EventArgs e) { try { if (!string.IsNullOrWhiteSpace(this.txtUsername.Text)) { var users = new UserRepository().GetAll(); var user = users?.FirstOrDefault(x => x.Username.Equals(this.txtUsername.Text)); if (user == null) { throw new Exception("Debe espesificar un usuario valido"); } UserResetPasswordForm resetPasswordForm = new UserResetPasswordForm(user); resetPasswordForm.ShowDialog(); } } catch (Exception ex) { ex.ShowDialog(); } }