public ActionResult AddOperation(Operations model)
 {
     if (ModelState.IsValid)
     {
         Operation NewOperation = gm.AddOperation(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(NewOperation))
             {
                 um.AddOperation(user.Id, model.OperationId);
             }
         }
         return RedirectToAction("Details", new { Id = model.Id });
     }
     return View(model);
 }
예제 #2
0
 public MarketController()
 {
     db = new DBContext();
      um = new UserManager(db);
 }
예제 #3
0
 public UserController()
 {
     um = new UserManager(new DBContext());
 }