/// <summary>已重载。在事务保护范围内处理业务,位于Valid之后</summary> /// <returns></returns> protected override int OnUpdate() { //数据库存储的菜单权限json字符串与前端传送过来的不一致,表明修改了菜单权限 if (Permission != MenuPermission) { Permission = MenuPermission; //先删除关联菜单权限 if (RoleMenus != null) { RoleMenus.Delete(); } if (RoleMenuButtons != null) { RoleMenuButtons.Delete(); } //插入菜单权限 InsertMenuPermission(); } //数据库存储的数据权限字符串与前端传送过来的不一致,表明修改了权限 if (DataPermission != DataPermissionTemp) { DataPermission = DataPermissionTemp; //先删除关联数据权限 if (RoleDataPermissions != null) { RoleDataPermissions.Delete(); } //插入数据权限 InsertDataPermission(); } return(base.OnUpdate()); }
/// <summary>已重载。删除关联数据</summary> /// <returns></returns> protected override int OnDelete() { if (MenuButtons != null) { MenuButtons.Delete(); } if (RoleMenus != null) { RoleMenus.Delete(); } if (RoleMenuButtons != null) { RoleMenuButtons.Delete(); } return(base.OnDelete()); }
/// <summary>已重载。删除关联数据</summary> /// <returns></returns> protected override int OnDelete() { if (AdminRoles != null) { AdminRoles.Delete(); } if (RoleDataPermissions != null) { RoleDataPermissions.Delete(); } if (RoleMenus != null) { RoleMenus.Delete(); } if (RoleMenuButtons != null) { RoleMenuButtons.Delete(); } return(base.OnDelete()); }