Exemple #1
0
 public ActionResult EditTestF(EditTestAndQuestionsViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return(RedirectToAction("ViewTests", "Admin"));
     }
     _testStore.UpdateTest(model.ToDataModel());
     HelpingClass.FEach(model.Questions, x => _questionStore.UpdateQuestion(x));
     return(RedirectToAction("ViewTests", "Admin"));
 }
Exemple #2
0
        public ActionResult DeleteConfirm(ModelUser model)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction("Delete", "Admin"));
            }
            List <ModelUserRole> UR = _userRoleStore.GetUserRolesByUser(model.Username).ToList();

            HelpingClass.FEach(UR, x => _userRoleStore.DeleteUserRole(x));
            _userStore.DeleteUser(model);
            return(RedirectToAction("Delete", "Admin"));;
        }