Ejemplo n.º 1
0
 /// <summary>
 /// Delete a permission
 /// </summary>
 /// <param name="permission">Permission</param>
 public virtual void DeleteSystemPermission(SystemPermission permission)
 {
     if (permission == null)
         throw new ArgumentNullException("permission");
     using (var context = new SsepsIIEntities())
     {
         context.SystemPermissions.Attach(permission);
         ((IObjectContextAdapter)context).ObjectContext.ObjectStateManager.ChangeObjectState(permission, System.Data.EntityState.Modified);
         context.SystemPermissions.Remove(permission);
         context.SaveChanges();
     }
     ClearCache();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Inserts a permission
        /// </summary>
        /// <param name="permission">Permission</param>
        public virtual void InsertSystemPermission(SystemPermission permission)
        {
            if (permission == null)
                throw new ArgumentNullException("permission");
            using (var context = new SsepsIIEntities())
            {
                context.SystemPermissions.Add(permission);
                context.SaveChanges();
            }

            ClearCache();
        }
Ejemplo n.º 3
0
 public void DeleteSystemRolePermission(SystemRolePermission rolePermission)
 {
     using (var context = new SsepsIIEntities())
     {
         context.SystemRolePermissions.Attach(rolePermission);
         ((IObjectContextAdapter)context).ObjectContext.ObjectStateManager.ChangeObjectState(rolePermission, System.Data.EntityState.Modified);
         context.SystemRolePermissions.Remove(rolePermission);
         context.SaveChanges();
     }
     ClearCache();
 }
Ejemplo n.º 4
0
        public void InsertSystemRolePermission(SystemRolePermission rolePermissionRecord)
        {
            using (var context = new SsepsIIEntities())
            {
                context.SystemRolePermissions.Add(rolePermissionRecord);
                context.SaveChanges();
            }

            ClearCache();
        }