コード例 #1
0
 public ActionResult EditGroup(int id)
 {
     if (User.Identity.IsAuthenticated && User.IsInRole("Admin"))
     {
         Group group = StatementManager.GetGroupById(id);
         return(View(group));
     }
     return(RedirectToAction("Index", "Home"));
 }
コード例 #2
0
 public ActionResult RemoveGroup(int id)
 {
     if (User.Identity.IsAuthenticated && User.IsInRole("Admin"))
     {
         return(View(new RemoveGroupViewModel {
             Id = id, Value = StatementManager.GetGroupById(id).Value
         }));
     }
     return(RedirectToAction("Index", "Home"));
 }
コード例 #3
0
 public ActionResult RemoveGroup(RemoveGroupViewModel model)
 {
     if (User.Identity.IsAuthenticated && User.IsInRole("Admin"))
     {
         if (StatementManager.GetGroupById(model.Id) != null)
         {
             StatementManager.RemoveGroup(model.Id);
         }
         return(RedirectToAction("Groups", "Admin"));
     }
     return(RedirectToAction("Index", "Home"));
 }