Esempio n. 1
0
        public ActionResult Create(UserGroup usergroup)
        {
            if (ModelState.IsValid)
            {
                usergroup.UserGroupID = Guid.NewGuid();
                db.UserGroups.Add(usergroup);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(usergroup);
        }
Esempio n. 2
0
 public ActionResult Edit(UserGroup usergroup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(usergroup).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(usergroup);
 }