/// <summary>
 /// 添加菜单权限
 /// </summary>
 /// <param name="menuID"></param>
 public static void AddMenuPermissionMap(int menuID)
 {
     try
     {
         var mt = new PermissionMapRepository().Search().Where(b => b.MID == menuID && b.Name == "菜单").First();
         if (mt == null || mt.ID == 0)
         {
             var pml = new PermissionMapRepository();
             var pmt = new PermissionMap()
             {
                 SortID           = 0,
                 MID              = menuID,
                 Name             = "菜单",
                 Description      = "菜单",
                 IsBasic          = 0,
                 CreateUserID     = 2,
                 LastUpdateUserID = 2,
                 CreateDate       = DateTime.Now,
                 LastUpdateDate   = DateTime.Now,
                 IsDeleted        = false
             };
             pml.Insert(pmt);
         }
     }
     catch { }
 }
Esempio n. 2
0
 /// <summary>
 /// 删除实体
 /// <param name="obj">传进的实体</param>
 /// </summary>
 public int Delete(PermissionMap obj)
 {
     return(db.Delete(obj));
 }
Esempio n. 3
0
 /// <summary>
 /// 更新实体
 /// <param name="obj">传进的实体</param>
 /// </summary>
 public int Update(PermissionMap obj)
 {
     return(db.Update(obj));
 }
Esempio n. 4
0
 /// <summary>
 /// 添加实体
 /// <param name="obj">传进的实体</param>
 /// </summary>
 public int Insert(PermissionMap obj)
 {
     return(db.Insert(obj));
 }
Esempio n. 5
0
 /// <summary>
 /// 当前实体查询上下文
 /// </summary>
 public ISearch <PermissionMap> Search(PermissionMap entity)
 {
     return(db.Search <PermissionMap>(entity));
 }