Example #1
0
        public ActionResult Delete(DeleteModel model)
        {
            if (!Current.IsAdmin)
            {
                return(RedirectToAction("Index", new { model.MainId }));
            }

            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            model.Save();

            return(RedirectToAction("Index", "Home"));
        }