Ejemplo n.º 1
0
 public ActionResult AddUsers(Group group)
 {
     try {
         var usergroup = new UsersGroup { UserID = group.UserID, GroupID = group.GroupID };
         db.UsersGroups.Add(usergroup);
         db.SaveChanges();
         return RedirectToAction("AddUsers", new { id = group.GroupID });
     }
     catch(Exception ex)
     {
         Group dto = db.Groups.Find(group.GroupID);
         this.ModelState.AddModelError(string.Empty, ex.Message);
         return View(dto);
     }
 }
Ejemplo n.º 2
0
 // GET: Groups/Create
 public ActionResult CreateGroup(string formView)
 {
     var dto = new Group { FormView = formView };
     return PartialView("_Create", dto);
 }