public void ChangePassword() { AdminPanelViewModel userToChange = admin.ReceiveUserById(user.curUser); RestoreViewModel rvm = new RestoreViewModel() { email = userToChange.Email }; RestorePassword(rvm); }
public ActionResult AccountRestoring(int id) { AdminPanelViewModel apvm = admin.ReceiveUserById(id); RestoreViewModel rvm = new RestoreViewModel() { email = apvm.Email }; return(View(rvm)); }
public ActionResult Restore(int pageSectionId) { var pageSection = _sectionService.Get(pageSectionId); var model = new RestoreViewModel { PageSectionId = pageSectionId, PageSectionBackup = pageSection.PageSectionBackups.ToList() }; return(View("_Restore", model)); }
public async Task <ActionResult> Restore(int pageSectionId) { var pageSection = await _sectionService.GetAsync(pageSectionId); var model = new RestoreViewModel { PageSectionId = pageSectionId, PageSectionBackup = pageSection.PageSectionBackups.ToList() }; return(View("_Restore", model)); }
public ActionResult RestorePassword() { if (user.curUser != -1) { AdminPanelViewModel userToChange = admin.ReceiveUserById(user.curUser); RestoreViewModel rvm = new RestoreViewModel() { email = userToChange.Email }; return(View(rvm)); } else { return(View()); } }
public ActionResult RestorePassword(RestoreViewModel rvm) { if (admin.RecieveUserByEmail(rvm.email) != null) { if (rvm.password == rvm.repetedpassword) { admin.Restore(rvm); return(Login()); } else { ModelState.AddModelError("", "Passwords are different"); return(View(rvm)); } } else { ModelState.AddModelError("", "There are no a user wit such email in db"); return(View(rvm)); } }
public ActionResult AccountRestoring(RestoreViewModel model) { admin.Restore(model); return(Redirect("~/Home/Index")); }