コード例 #1
0
 public ActionResult DeleteOperation(Operations model)
 {
     if (ModelState.IsValid)
     {
         Operation   OperationToDelete = gm.DeleteOperation(model.Id, model.OperationId);
         List <User> Users             = gm.FindGroup(model.Id).Users.ToList();
         UserManager um = new UserManager(new DBContext());
         foreach (User user in Users)
         {
             if (user.Operations.Contains(OperationToDelete))
             {
                 um.DeleteOperation(user.Id, model.OperationId);
             }
         }
         return(RedirectToAction("Details", new { Id = model.Id }));
     }
     return(View(model));
 }