Пример #1
0
        public ActionResult UserAdmin(UserAdminView model)
        {
            if (Request.Form["resetbutton"] != null)
            {
                return(RedirectToAction("UserAdmin"));
            }

            if (ModelState.IsValid)
            {
                if (Request.Form["savebutton"] != null)
                {
                    AppUserHelpers.UpdateAppUsers(db, model.UserAdminActiveView, true, User);
                    return(RedirectToAction("Dashboard", "Home"));
                }

                if (Request.Form["addusersbutton"] != null)
                {
                    AppUserHelpers.UpdateAppUsers(db, model.UserAdminActiveView, true, User);
                    return(RedirectToAction("AddUser"));
                }

                if (Request.Form["saveinactivebutton"] != null)
                {
                    AppUserHelpers.UpdateAppUsers(db, model.UserAdminNonActiveView, false, User);
                    return(RedirectToAction("Dashboard", "Home"));
                }

                return(RedirectToAction("Dashboard", "Home"));
            }
            return(View(model));
        }