예제 #1
0
        public ActionResult AddRole(Roles obj, String Roles, String Rights)
        {
            System.Web.HttpContext.Current.Session["Users"] = null;
            System.Web.HttpContext.Current.Session["membershipService"] = null;
            obj.ID = Guid.NewGuid();
            obj.Roles1 = _db.GetRoleID(Roles);
            obj.Rights = _db.GetRightID(Rights);
            if (!_db.IsDuplicateRight(obj.Roles1, obj.Rights))
                _db.AddRole(obj);
            else
                return RedirectToAction("AddRole", "Admin");

               return RedirectToAction("RolesList", "Admin");
        }
예제 #2
0
 public void AddRole(Roles obj)
 {
     _DB.Roles.AddObject(obj);
     _DB.SaveChanges();
 }
예제 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Roles EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRoles(Roles roles)
 {
     base.AddObject("Roles", roles);
 }
예제 #4
0
 /// <summary>
 /// Create a new Roles object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 public static Roles CreateRoles(global::System.Guid id)
 {
     Roles roles = new Roles();
     roles.ID = id;
     return roles;
 }