Пример #1
0
        public void ChangePassword()
        {
            AdminPanelViewModel userToChange = admin.ReceiveUserById(user.curUser);
            RestoreViewModel    rvm          = new RestoreViewModel()
            {
                email = userToChange.Email
            };

            RestorePassword(rvm);
        }
Пример #2
0
        public ActionResult AccountRestoring(int id)
        {
            AdminPanelViewModel apvm = admin.ReceiveUserById(id);
            RestoreViewModel    rvm  = new RestoreViewModel()
            {
                email = apvm.Email
            };

            return(View(rvm));
        }
Пример #3
0
        public ActionResult Restore(int pageSectionId)
        {
            var pageSection = _sectionService.Get(pageSectionId);

            var model = new RestoreViewModel
            {
                PageSectionId     = pageSectionId,
                PageSectionBackup = pageSection.PageSectionBackups.ToList()
            };

            return(View("_Restore", model));
        }
Пример #4
0
        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));
        }
Пример #5
0
 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());
     }
 }
Пример #6
0
 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));
     }
 }
Пример #7
0
 public ActionResult AccountRestoring(RestoreViewModel model)
 {
     admin.Restore(model);
     return(Redirect("~/Home/Index"));
 }