private void btnResetPass_Click(object sender, EventArgs e) { if (this.gridUsers.CurrentRow != null && this.iGridEXAcc.CurrentRow != null) { var user = (UserDto)this.gridUsers.CurrentRow.DataRow; var account = (AccountDto)this.iGridEXAcc.CurrentRow.DataRow; if (user != null && account != null) { string text = string.Format("آیا از بازگردانی رمز عبور {0} , {1} مطمئن هستید؟", account.Description, user.FullName); if (ISE.Framework.Client.Win.Viewer.MessageViewer.ShowAlert(text) != null) { return; } AccountPresenter accPresenter = new AccountPresenter(); accPresenter.ResetPassword(account.Username, user.UserId); } } }
protected void Page_Load(object sender, EventArgs e) { _accountPresenter = new AccountManagement.AccountPresenter(this); _registrationPresenter = new RegistrationPresenter(this); Control navControl = Master.Page.Controls[0].FindControl("NavigationMenu"); if (navControl != null) { navControl.Visible = false; } if (Page.IsPostBack) { if (string.IsNullOrEmpty(txtChangePasswordCode.Text)) { string resetCodeGeneratedOrRetrieved = _accountPresenter.ResetPasswordRequest(txtUsername.Text, txtEmail.Text); txtChangePasswordCode.Text = resetCodeGeneratedOrRetrieved; txtPassword.Visible = true; txtConfirmPassword.Visible = true; txtPassword.Focus(); } else { bool resultOfResetPassword = _accountPresenter.ResetPassword(txtUsername.Text, txtEmail.Text, txtChangePasswordCode.Text, txtPassword.Text); if (resultOfResetPassword) { lblErrors.Text = "Password Change was successful"; } else { lblErrors.Text = "Password Change was not successful"; } } } }