public HttpResponseMessage Change(ChangePassword model) { if(!ModelState.IsValid) { return Request.CreateErrorResponse( HttpStatusCode.BadRequest, ModelState); } try { if(changePassword( User.Identity.Name, model.OldPassword, model.NewPassword)) { return Request.CreateResponse(HttpStatusCode.NoContent); } ModelState.AddModelError( "oldPassword", "Old password does not match existing password."); } catch(ArgumentException) { ModelState.AddModelError( "newPassword", "New password does not meet password rule."); } return Request.CreateErrorResponse( HttpStatusCode.BadRequest, ModelState); }
public HttpResponseMessage Change(ChangePassword model) { if (!ModelState.IsValid) { return Request.CreateErrorResponse( HttpStatusCode.BadRequest, ModelState); } var success = changePassword( User.Identity.Name, model.OldPassword, model.NewPassword); return Request.CreateResponse( success ? HttpStatusCode.NoContent : HttpStatusCode.BadRequest); }
public async Task<HttpResponseMessage> Change(ChangePassword model) { if (model == null) { throw new ArgumentNullException("model"); } if (!ModelState.IsValid) { return Request.CreateErrorResponse( HttpStatusCode.BadRequest, ModelState); } try { if (await membershipService.ChangePassword( User.Identity.Name, model.OldPassword, model.NewPassword)) { return Request.CreateResponse(HttpStatusCode.NoContent); } ModelState.AddModelError( "oldPassword", "Old password does not match existing password."); } catch (ArgumentException) { ModelState.AddModelError( "newPassword", "New password does not meet password rule."); } return Request.CreateErrorResponse( HttpStatusCode.BadRequest, ModelState); }
public ActionResult ChangePassword(ChangePassword cp) { if (ModelState.IsValid) { if (!string.IsNullOrEmpty(cp.CurrentPassword) && !string.IsNullOrEmpty(cp.NewPassword) && !string.IsNullOrEmpty(cp.ReEnterPassword)) { User user = db.Users.Find(new Guid(Request.Cookies["INDMS"]["UserID"])); if (user != null) { if (System.Text.Encoding.ASCII.EncodeBase64(cp.CurrentPassword).Equals(user.Password)) { user.Password = System.Text.Encoding.ASCII.EncodeBase64(cp.NewPassword); try { db.SaveChanges(); TempData["MSG"] = "Password changed successfully."; return RedirectToAction("ChangePassword"); } catch (RetryLimitExceededException /* dex */) { //Log the error (uncomment dex variable name and add a line here to write a log. TempData["Error"] = "Unable to save changes. Try again, and if the problem persists, see your system administrator."; } } else { TempData["Error"] = "Current Password not matched."; } } } else { TempData["Error"] = "All Field are required."; } } return View(); }
public Boolean ChangePassword(ChangePassword changePassword) { return(_service.ChangePassword(changePassword)); }
public async Task <AuthenticationResult> CustomerChangePasswsord(ChangePassword pass) { try { var user = await _userManager.FindByEmailAsync(pass.Email); var userPassword = await _userManager.CheckPasswordAsync(user, pass.OldPassword); if (!userPassword) { return(new AuthenticationResult { Status = new APIResponseStatus { IsSuccessful = false, Message = new APIResponseMessage { FriendlyMessage = "This password is not associated to this account", } } }); } string token = await _userManager.GeneratePasswordResetTokenAsync(user); var changepassword = await _userManager.ResetPasswordAsync(user, token, pass.NewPassword); if (!changepassword.Succeeded) { return(new AuthenticationResult { Status = new APIResponseStatus { IsSuccessful = false, Message = new APIResponseMessage { FriendlyMessage = changepassword.Errors.Select(x => x.Description).FirstOrDefault(), } } }); } return(await CustomerGenerateAuthenticationResultForUserAsync(user)); } catch (Exception ex) { #region Log error var errorCode = ErrorID.Generate(4); _logger.Error($"ErrorID : {errorCode} Ex : {ex?.Message ?? ex?.InnerException?.Message} ErrorStack : {ex?.StackTrace}"); return(new AuthenticationResult { Status = new APIResponseStatus { Message = new APIResponseMessage { FriendlyMessage = "Error occured!! Please try again later", MessageId = errorCode, TechnicalMessage = $"ErrorID : {errorCode} Ex : {ex?.Message ?? ex?.InnerException?.Message} ErrorStack : {ex?.StackTrace}" } } }); #endregion } }
public HttpResponseMessage ChangePassword(ChangePassword ChangePassword) { int ret = repository.ChangePassword(pclsCache, ChangePassword.OldPassword, ChangePassword.NewPassword, ChangePassword.UserId, ChangePassword.revUserId, ChangePassword.TerminalName, new CommonFunction().getRemoteIPAddress(), ChangePassword.DeviceType); return(new ExceptionHandler().ChangePassword(Request, ret)); }
public async Task <HttpResponseMessage> PasswordChange(ChangePassword req) { try { SettingDAL dal = new SettingDAL(); //JsonResponse response = await PasswordChanges(req); JsonResponse response = new JsonResponse(); using (MIUEntities db = new MIUEntities()) { try { User user = db.Users.Where(x => x.ID == req.UserID).FirstOrDefault(); if (user == null) { response.Flag = true; response.Message = "User not found."; } else { string Message = ""; if (user.Password == req.CurrentPassword) { if (req.NewPassword == req.ComfirmPassword) { user.Password = req.NewPassword; var AspNetUserID = db.AspNetUsers.Where(x => x.UserName == user.LoginName).Select(x => x.Id).FirstOrDefault(); IdentityResult result = await UserManager.ChangePasswordAsync(AspNetUserID, req.CurrentPassword, req.NewPassword); if (!result.Succeeded) { Message = "Fail to change password!"; } else { db.SaveChanges(); Message = "Update Password Successfully!."; } } else { Message = "New password and confirm password are not same."; } } else { Message = "Current Password is incorrect."; } //db.SaveChanges(); response.Flag = true; response.Message = Message; } } catch (Exception ex) { //return new JsonResponse() { Flag = true, Message = Message }; response.Flag = true; response.Message = ex.Message; } } if (response != null && response.Flag) //if (response) { return(Request.CreateResponse <JsonResponse>(HttpStatusCode.OK, response)); } else { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, MIUWebAPI.Helper.Constants.ErrorNotFound)); } } catch (DbEntityValidationException ex) { var controllerName = ControllerContext.RouteData.Values["controller"].ToString(); var actionName = ControllerContext.RouteData.Values["action"].ToString(); Logger log = new Logger(); log.ErrorLog(ex, controllerName, actionName); return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, MIUWebAPI.Helper.Constants.ErrorSysError)); } }
public ChangePassword LoadSecretQuestions(ChangePassword objChangePassword) { objChangePassword.secretQuestions = objUserManagementLogic.FetchSecretQuestion(); return(objChangePassword); }
public ChangePassword Sendmailsmsresetpassword(ChangePassword Password) { Password.IsStatus = objUserManagementLogic.Sendmailsmsresetpassword(Password.mobileno, Password.emailID); return(Password); }
public async Task<ActionResult> ChangePassword(ChangePassword formModel) { var changePassword = new VirtoCommercePlatformWebModelSecurityChangePasswordInfo { OldPassword = formModel.OldPassword, NewPassword = formModel.NewPassword, }; var result = await _platformApi.SecurityChangePasswordAsync(WorkContext.CurrentCustomer.UserName, changePassword); if (result.Succeeded == true) { return StoreFrontRedirect("~/account"); } else { ModelState.AddModelError("form", result.Errors.First()); return View("customers/account", WorkContext); } }
/// <summary> /// Returns a view to change existing password /// </summary> /// <returns></returns> public ActionResult ChangePassword() { var changePassword = new ChangePassword(); return(View(changePassword)); }
protected void OnActionPasswordActivated(object sender, EventArgs e) { ChangePassword WinPass = new ChangePassword(); WinPass.WorkMode = ChangePassword.Mode.Manual; WinPass.CanSetEmptyPassword = true; WinPass.Show(); if(WinPass.Run() == (int) Gtk.ResponseType.Ok) { MainClass.Parameters.UpdateParameter(QSMain.ConnectionDB, "admin_password", WinPass.NewPassword); } WinPass.Destroy(); }
private void SystemMenuClick(object sender, ItemClickEventArgs e) { switch (e.Item.Name) { case "iRestart": Application.Restart(); break; case "iExit": if (XtraMessageBox.Show("Vui lĆ²ng xĆ”c nhįŗn thoĆ”t khį»i į»©ng dį»„ng?", "XĆ”c nhįŗn", MessageBoxButtons.YesNo) == DialogResult.Yes) { Application.Exit(); } break; case "iUserConfig": UserConfigAcc frmUserConfig = new UserConfigAcc(); if (frmUserConfig.IsShow) { frmUserConfig.ShowDialog(); } break; case "iCheckData": CheckData frmCheckData = new CheckData(true); frmCheckData.ShowDialog(); break; case "iViewHistory": CheckData frmViewHistory = new CheckData(false); frmViewHistory.ShowDialog(); break; case "iChangePassword": ChangePassword frmChangePwd = new ChangePassword(); frmChangePwd.ShowDialog(); break; case "iAbout": About frmAbout = new About(); frmAbout.ShowDialog(); break; case "iHelpOnline": System.Diagnostics.Process.Start("http://www.sgd.com.vn"); break; case "iHelp": string fileHelp = Config.GetValue("Package").ToString() + ".chm"; if (System.IO.File.Exists(fileHelp)) { System.Diagnostics.Process.Start(fileHelp); } break; case "iBackup": DataMaintain dmBk = new DataMaintain(); if (dmBk.BackupData(Application.StartupPath)) { MessageBox.Show("Bakup HoĆ n thĆ nh"); } else { } break; case "iDelete": Xoasolieu fxoasolieu = new Xoasolieu(); fxoasolieu.ShowDialog(); break; case "iRestore": string isAdmin = Config.GetValue("Admin").ToString(); if (isAdmin != "True") { return; } DataMaintain dmRt = new DataMaintain(); DateTime d; FrmDateSelect f = new FrmDateSelect(); f.ShowDialog(); d = f.d; if (d != null) { if (File.Exists(Application.StartupPath + "\\Backup\\" + dbName + d.ToString("dd_MM_yyyy") + ".dat")) { if (MessageBox.Show("Bįŗ”n cĆ³ chįŗÆc chįŗÆn phį»„c hį»i sį» liį»u ngĆ y " + d.ToString("dd/MM/yyyy") + " khĆ“ng?, Dį»Æ liį»u hiį»n tįŗ”i sįŗ½ bį» mįŗ„t sau khi phį»„c hį»i!", "XĆ”c nhįŗn", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (dmRt.RestoreData(Application.StartupPath + "\\Backup\\" + dbName + d.ToString("dd_MM_yyyy") + ".dat")) { MessageBox.Show("Phį»„c hį»i sį» liį»u hoĆ n thĆ nh!"); } else { MessageBox.Show("Phį»„c hį»i sį» liį»u bį» lį»i!"); } } } else { MessageBox.Show("KhĆ“ng tį»n tįŗ”i file backup ngĆ y " + d.ToString("dd/MM/yyyy")); } } break; case "iRestoreAs": string isAdmin1 = Config.GetValue("Admin").ToString(); if (isAdmin1 != "True") { return; } DataMaintain dmRtas = new DataMaintain(); DateTime d1; string dataAnother; FrmRestoreAs fres = new FrmRestoreAs(); fres.ShowDialog(); d1 = fres.d; dataAnother = fres.DataAnother; if (d1 != null && dataAnother != null) { if (File.Exists(Application.StartupPath + "\\Backup\\" + dbName + d1.ToString("dd_MM_yyyy") + ".dat") && !File.Exists(Application.StartupPath + "\\Data2005\\" + dataAnother + ".mdf")) { if (MessageBox.Show("Bįŗ”n cĆ³ chįŗÆc chįŗÆn phį»„c hį»i sį» liį»u ngĆ y " + d1.ToString("dd/MM/yyyy") + " vĆ o dį»Æ liį»u " + dataAnother + " khĆ“ng?", "XĆ”c nhįŗn", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (dmRtas.RestoreDataToAnother(Application.StartupPath + "\\Data2005\\", Application.StartupPath + "\\Backup\\" + dbName + d1.ToString("dd_MM_yyyy") + ".dat", dataAnother)) { MessageBox.Show("Tįŗ”o sį» liį»u hoĆ n thĆ nh!"); } else { MessageBox.Show("Tįŗ”o sį» liį»u bį» lį»i!"); } } } else { MessageBox.Show("KhĆ“ng tį»n tįŗ”i file backup ngĆ y " + d1.ToString("dd/MM/yyyy") + " hoįŗ·c ÄĆ£ tį»n tįŗ”i database " + dataAnother); } } break; case "iCollectData": FrmDataCollection frmDc = new FrmDataCollection(); frmDc.ShowDialog(); break; case "iImportExcel": CDTSystem.fImExcel frmImportEx = new CDTSystem.fImExcel(); frmImportEx.MdiParent = this; frmImportEx.Show(); break; case "iChonNLV": fChonNgayLV fChonNLV = new fChonNgayLV(); fChonNLV.ShowDialog(); break; case "isImportData": DateFilter dfilterIm = new DateFilter(); //dfilter.MdiParent = this; dfilterIm.ShowDialog(); if (dfilterIm.isAccept) { ImportDataFromDat I2Dat = new ImportDataFromDat(dfilterIm.TuNgay, dfilterIm.DenNgay); if (!I2Dat.Import()) { MessageBox.Show("Kįŗæt nhįŗp dį»Æ liį»u khĆ“ng thĆ nh cĆ“ng"); } else { MessageBox.Show("Kįŗæt nhįŗp dį»Æ liį»u thĆ nh cĆ“ng"); } } break; case "isExportData": DateFilter dfilterEx = new DateFilter(); //dfilter.MdiParent = this; dfilterEx.ShowDialog(); if (dfilterEx.isAccept) { ExportData2Dat E2Dat = new ExportData2Dat(dfilterEx.TuNgay, dfilterEx.DenNgay); if (!E2Dat.Export()) { MessageBox.Show("Xuįŗ„t dį»Æ liį»u khĆ“ng thĆ nh cĆ“ng"); } else { MessageBox.Show("Xuįŗ„t dį»Æ liį»u thĆ nh cĆ“ng"); } } break; } }
private void ChangeExecute() { ChangePassword change = new ChangePassword(Username); change.ShowDialog(); }
private void btnChangePassword_Click(object sender, EventArgs e) { ChangePassword password = new ChangePassword(UserId); password.ShowDialog(); }
public async Task <Model.Response.ApplicationUser> UpdatePassword(int applicationUserId, ChangePassword password) { Database.ApplicationUser user = await auth.Users.FindAsync(applicationUserId); if (PasswordHasher.VerifyHashedPassword(user, user.PasswordHash, password.CurrentPassword) != PasswordVerificationResult.Success) { throw new ModelStateException(nameof(password.CurrentPassword), "Current password is not correct"); } user.PasswordHash = PasswordHasher.HashPassword(user, password.NewPassword); try { await auth.SaveChangesAsync(); // TODO: Dodati log } catch (Exception e) { // TODO: Dodati log throw e; } return(mapper.Map <Model.Response.ApplicationUser>(user)); }
public override bool SecurityApiCallRegisterOrChangeNewPassword(string url, string pathController, ChangePassword content = null, RegisterUser user = null) { if (url.Equals("http://academysecuritydos.azurewebsites.net/")) { if (pathController.Equals("api/NewPassword/ChangePassword")) { if (content.UserName != null && content.UserName != "" && content.NewPassword != null && content.NewPassword != "") { return(true); } } else if (pathController.Equals("api/NewUser/CreateUser")) { if (user.UserName == null || user.UserName == "" && user.FirstName == null || user.FirstName == "" && user.LastName == null || user.LastName == "" && user.Password == null || user.Password == "") { return(false); } else { return(true); } } } return(false); }
/// <summary> /// Created By: Satish /// Created Date: 18 July 2013 /// Function for change password which will get credentials from change password page and send user current status. /// </summary> public string ChangePassword(Stream Parameterdetails) { ChangePassword objChangePassword = new ChangePassword(); StreamReader objStreamReader = new StreamReader(Parameterdetails); string JsonStringForDeSerialized = objStreamReader.ReadToEnd(); objStreamReader.Dispose(); objChangePassword = JsonHelper.JsonDeserialize <ChangePassword>(JsonStringForDeSerialized); int UserId = objChangePassword.UserId; string OldPassowrd = objChangePassword.OldPassowrd; string NewPassword = objChangePassword.NewPassword; DataTable dt = new DataTable(); cmd = new SqlCommand(); cmd.CommandText = @"SELECT COUNT(*) as TotalCount FROM Com_Login_Mst WHERE UserID ='" + UserId + "' AND Password ='******'"; dt = objdatacommon.GetDataTableWithQuery(cmd); objChangePassword = new ChangePassword(); if (dt.Rows.Count > 0) { if (dt.Rows[0]["TotalCount"].ToString() == "1" && UserId > 0) { cmd = new SqlCommand(); cmd.Parameters.Add("@UserId", SqlDbType.Int).Value = UserId; cmd.Parameters.Add("@Password", SqlDbType.VarChar).Value = NewPassword; cmd.Parameters.Add("@ModifiedBy", SqlDbType.Int).Value = UserId; cmd.Parameters.Add(new SqlParameter("@ErrorStatus", SqlDbType.VarChar, 10)); cmd.Parameters["@ErrorStatus"].Direction = ParameterDirection.Output; cmd.CommandText = "SP_Update_In_Com_Login_Mst_ForPassword"; cmd = objdatacommon.ExecuteSqlProcedure(cmd); string ErrorStatus = cmd.Parameters["@ErrorStatus"].Value.ToString(); if (ErrorStatus == "0") { objChangePassword.ActiveStatus = "1"; objChangePassword.SaveMessage = "Password has been updated successfully."; objChangePassword.Type = "status"; } else { objChangePassword.ActiveStatus = "0"; objChangePassword.SaveMessage = "Password has not been updated."; objChangePassword.Type = "warning"; } } else { objChangePassword.ActiveStatus = "0"; objChangePassword.SaveMessage = "Old password is wrong."; objChangePassword.Type = "error"; } } string JsonStringForSerialized = JsonHelper.JsonSerializer <ChangePassword>(objChangePassword); return(JsonStringForSerialized); }
public async Task <IActionResult> ChangePassword([FromBody] ChangePassword command) => Json(await _userService.ChangePasswordAsync(UserId, command.CurrentPassword, command.NewPassword));
public BaseResponse ChangePassword(ChangePassword updatePassword) { if (updatePassword.password.Equals(updatePassword.newPassword)) { return(new BaseResponse { status = -4, developerMessage = "Current password is same as old password" }); } BaseResponse response = new BaseResponse(); try { var db = _db; string encryptedPassword = Utils.EncryptionUtils.CreateMD5(updatePassword.password); var obj = db.Users.SingleOrDefault(b => b.Id == updatePassword.userID && b.Password == encryptedPassword); if (obj != null) { obj.Password = Utils.EncryptionUtils.CreateMD5(updatePassword.newPassword); db.SaveChanges(); response.status = 1; } if (response.status == 1) { string subject = Constant.CHANGE_PASSWORD_EMAIL_SUBJECT; string body = Constant.CHANGE_PASSWORD_EMAIL_BODY; string address = obj.Email; if (Utils.EmailUtils.sendEmail(subject, body, address)) { response.status = 1; response.developerMessage = "Password changed successfully"; } else { response.status = -2; response.developerMessage = "Failed to send email; SMTP Server Down"; } } else { return(new BaseResponse { status = -3, developerMessage = "Current Password is not Valid" }); } } catch (Exception e) { return(new BaseResponse { status = -1, developerMessage = "Something went wrong:" + e.Message }); } return(response); }
public JsonResult OnPostChangePassword(ChangePassword command) { var result = _accountApplication.ChangePassword(command); return(new JsonResult(result)); }
public ChangePassword UnlockUserOnSuccess(ChangePassword objChangePassword) { // objChangePassword.Result = objUserManagementLogic.UnlockUserOnSuccess(objChangePassword); return(objChangePassword); }
public void UpdatePassword(ChangePassword command) { this.PasswordHash = command.PasswordHash; this.UpdateAt = command.CreateAt; this.UpdateBy = command.CreateBy; }
public async Task ChangePassword(ChangePassword input) { input.LoginID = this.session.LoginID; await this.authenticateService.ChangePassword(input); }
public virtual async System.Threading.Tasks.Task <SessionResponse> changePasswordAsync(ChangePassword changePassword) { var request = new changePasswordRequest() { passport = passport, applicationInfo = applicationInfo, partnerInfo = partnerInfo, changePassword = changePassword, }; var response = await((NetSuitePortType)this).changePasswordAsync(request); return(response.sessionResponse); }
public async Task <IActionResult> Post([FromBody] ChangePassword command) { await _userService.ChangePassword(UserId, command.CurrentPassword, command.NewPassword); return(NoContent()); }
public BaseResponse ChangePassword([FromBody] ChangePassword updatePassword) { return(new BLL.BLL_Users(_db).changePassword(updatePassword)); }
public async Task <IActionResult> ChangePassword([FromBody] ChangePassword dto) { throw new NotImplementedException(); }
public async Task <IActionResult> ChangePassword([FromBody] ChangePassword command) => await ProcessCommand(command);
public async Task <ActionResult <User> > Reset(int id, ChangePassword ResetPassword) { return(await(this._repository as UserRepository).ResetPassword(id, ResetPassword)); }
static public List <Button> CreateAdministrativoView() { var buttonList = new List <Button>(); var menuButtonStyle = (Style)Application.Current.Resources["MenuButton"]; var numRow = 0; var HomeButton = new Button() { Name = "HomeButton", Content = "Home", Style = menuButtonStyle }; buttonList.Add(HomeButton); Grid.SetRow(HomeButton, numRow); numRow++; var ChangePassButton = new Button() { Name = "ChangePassButton", Content = "Cambiar ContraseƱa", Style = menuButtonStyle }; buttonList.Add(ChangePassButton); Grid.SetRow(ChangePassButton, numRow); numRow++; var BuscadorPersona = new Button() { Name = "BuscadorPersona", Content = "Buscar Personas", Style = menuButtonStyle }; buttonList.Add(BuscadorPersona); Grid.SetRow(BuscadorPersona, numRow); numRow++; var FichaPersona = new Button() { Name = "FichaPersona", Content = "Fichas Personales", Style = menuButtonStyle }; buttonList.Add(FichaPersona); Grid.SetRow(FichaPersona, numRow); numRow++; var FormCurso = new Button() { Name = "FormCurso", Content = "Formularios Curso", Style = menuButtonStyle }; buttonList.Add(FormCurso); Grid.SetRow(FormCurso, numRow); numRow++; var FormAsignatura = new Button() { Name = "FormAsignatura", Content = "Formularios Asignatura", Style = menuButtonStyle }; buttonList.Add(FormAsignatura); Grid.SetRow(FormAsignatura, numRow); numRow++; var FormAula = new Button() { Name = "FormAula", Content = "Formularios Aula", Style = menuButtonStyle }; buttonList.Add(FormAula); Grid.SetRow(FormAula, numRow); numRow++; var FormDepartamento = new Button() { Name = "FormDepartamento", Content = "Formularios Departamento", Style = menuButtonStyle }; buttonList.Add(FormDepartamento); Grid.SetRow(FormDepartamento, numRow); numRow++; var FormHorario = new Button() { Name = "FormHorario", Content = "Formularios Horario", Style = menuButtonStyle }; buttonList.Add(FormHorario); Grid.SetRow(FormHorario, numRow); numRow++; var LogOutButton = new Button() { Name = "LogOutButton", Content = "Salir", Style = menuButtonStyle }; buttonList.Add(LogOutButton); Grid.SetRow(LogOutButton, numRow); numRow++; void AdministrativoView_Click(object sender, RoutedEventArgs e) { if (sender is Button btnSender) { if (btnSender == HomeButton) { var backUpMainPanel = XamlBridge.BackUpMainPanel; XamlFunctionality.ReplaceGrids(XamlBridge.MainPanelInstance, backUpMainPanel); XamlBridge.MainPanelInstance = backUpMainPanel; } else if (btnSender == ChangePassButton) { var mainPanel = new ChangePassword().MainPanel; XamlFunctionality.ReplaceGrids(XamlBridge.MainPanelInstance, mainPanel); XamlBridge.MainPanelInstance = mainPanel; } else if (btnSender == BuscadorPersona) { var backUpMainPanel = new BuscadorV2().MainPanel; XamlFunctionality.ReplaceGrids(XamlBridge.MainPanelInstance, backUpMainPanel); XamlBridge.MainPanelInstance = backUpMainPanel; } else if (btnSender == FormCurso) { var backUpMainPanel = new FormularioCurso().MainPanel; XamlFunctionality.ReplaceGrids(XamlBridge.MainPanelInstance, backUpMainPanel); XamlBridge.MainPanelInstance = backUpMainPanel; } else if (btnSender == FormAsignatura) { var backUpMainPanel = new FormularioAsignatura().MainPanel; XamlFunctionality.ReplaceGrids(XamlBridge.MainPanelInstance, backUpMainPanel); XamlBridge.MainPanelInstance = backUpMainPanel; } else if (btnSender == FormAula) { var backUpMainPanel = new FormularioAula().MainPanel; XamlFunctionality.ReplaceGrids(XamlBridge.MainPanelInstance, backUpMainPanel); XamlBridge.MainPanelInstance = backUpMainPanel; } else if (btnSender == FormDepartamento) { var backUpMainPanel = new FormularioDepartamento().MainPanel; XamlFunctionality.ReplaceGrids(XamlBridge.MainPanelInstance, backUpMainPanel); XamlBridge.MainPanelInstance = backUpMainPanel; } else if (btnSender == FormHorario) { var backUpMainPanel = new FormularioHorario().MainPanel; XamlFunctionality.ReplaceGrids(XamlBridge.MainPanelInstance, backUpMainPanel); XamlBridge.MainPanelInstance = backUpMainPanel; } else if (btnSender == FichaPersona) { var fichaPersona = new FichaPersona(); var backUpMainPanel = fichaPersona.MainPanel; XamlBridge.FichaPersona = fichaPersona; fichaPersona.Close(); XamlFunctionality.ReplaceGrids(XamlBridge.MainPanelInstance, backUpMainPanel); XamlBridge.MainPanelInstance = backUpMainPanel; } else if (btnSender == LogOutButton) { StaticButtonViews.LogOutFromMainWindow(); } } }; foreach (var button in buttonList) { button.Click += new RoutedEventHandler(AdministrativoView_Click); } return(buttonList); }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); if (Page.IsPostBack) { ChangePassword changePassword = NamingContainer as ChangePassword; if (changePassword != null) { Control container = changePassword.ChangePasswordTemplateContainer; if (container != null) { CommandEventArgs cmdArgs = null; String[] prefixes = { "ChangePassword", "Cancel", "Continue" }; String[] postfixes = { "PushButton", "Image", "Link" }; foreach (string prefix in prefixes) { foreach (string postfix in postfixes) { string id = prefix + postfix; Control ctrl = container.FindControl(id); if ((ctrl != null) && (!String.IsNullOrEmpty(Page.Request.Params.Get(ctrl.UniqueID)))) { switch (prefix) { case "ChangePassword": cmdArgs = new CommandEventArgs(ChangePassword.ChangePasswordButtonCommandName, this); break; case "Cancel": cmdArgs = new CommandEventArgs(ChangePassword.CancelButtonCommandName, this); break; case "Continue": cmdArgs = new CommandEventArgs(ChangePassword.ContinueButtonCommandName, this); break; } break; } } if (cmdArgs != null) { break; } } if ((cmdArgs != null) && (cmdArgs.CommandName == ChangePassword.ChangePasswordButtonCommandName)) { Page.Validate(); if (!Page.IsValid) { cmdArgs = null; } } if (cmdArgs != null) { RaiseBubbleEvent(this, cmdArgs); } } } } }
public ValidationResult GetValidationResult(ChangePassword model) { var validator = new ChangePasswordValidator(_repository); return(validator.Validate(model)); }
public ActionResult ChangePassword(ChangePassword command) { return Handle(command, RedirectToAction("ChangePasswordSuccess")); }
private void OnChangePassword(object sender, EventArgs e) { //TODO: Validate password changePassword += new ChangePassword(ChangePassword); alertWindow.OnChangePassword(changePassword, newPass, confirm, Activity); }
//change password private void tsmi_ChangePass_Click(object sender, EventArgs e) { ChangePassword ChangePass = new ChangePassword(userID, userName, pass); ChangePass.ShowDialog(); }
private void menuChangePass_Click(object sender, EventArgs e) { ChangePassword frmChangePass = new ChangePassword(); pnlMain.Controls.Clear(); frmChangePass.ShowDialog(); }
public ChangePassword GetResendOTPInformation(ChangePassword objChangePassword, string UserName) { objChangePassword = new ChangePassword(); objChangePassword.Result = objUserManagementLogic.ResendOTPInformation(UserName); return(objChangePassword); }
public async Task<IHttpActionResult> ChangePassword(ChangePasswordVM vm) { bool match = _userSecurityService.VerifyPassword(UserId.Value, vm.Password); if (!match) { return BadRequest(); } ChangePassword action = new ChangePassword( UserId.Value,DateTime.Now,UserId.Value, _userSecurityService.PasswordHash(UserId.Value, vm.NewPassword)); ActionResponse actionResponse = await ActionBus.SendAsync<UserActionBase, ChangePassword>(action); return Ok(ActionResponseVM.ToVM(actionResponse)); }
public ChangePassword VerifyOTPInformation(ChangePassword objChangePassword) { objChangePassword.Result = objUserManagementLogic.VerifyOTPInformation(objChangePassword.OTP, objChangePassword.userName); return(objChangePassword); }
public ActionResult ChangePassword(ChangePassword command) { return Handle(command, () => RedirectToAction("ChangePasswordSuccess"), () => RedirectToAction("SignUp", "Account")); }