Пример #1
0
 /// <summary>
 /// 新增系统权限
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public bool AddSystemPermission(Model.DataContext.System_Permission item)
 {
     using (var db = new bbHomeEntities())
     {
         db.System_Permission.AddObject(item);
         return db.SaveChanges() > 0;
     }
 }
Пример #2
0
        /// <summary>
        /// 更新系统权限
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public bool UpdateSystemPermission(Model.DataContext.System_Permission item)
        {
            using (var db = new bbHomeEntities())
            {
                var queryTxt = from a in db.System_Permission
                               where a.Id == item.Id
                               select a;

                var systemPermission = queryTxt.First();

                systemPermission.RefreshTime = item.RefreshTime;
                systemPermission.RequestType = item.RequestType;
                systemPermission.RequestUri = item.RequestUri;
                systemPermission.ReturnParameters = item.ReturnParameters;
                systemPermission.AfferentParameters = item.AfferentParameters;
                systemPermission.MethodAttrs = item.MethodAttrs;

                return db.SaveChanges() > 0;
            }
        }