using Longbow.Data; using System.Collections.Generic; namespace Bootstrap.DataAccess { /// /// author:liuchun /// date:2016.10.22 /// public static class GroupHelper { /// /// 查询所有群组信息 /// /// /// public static IEnumerable RetrieveGroups(int id = 0) => DbAdapterManager.Create().RetrieveGroups(id); /// /// 删除群组信息 /// /// public static bool DeleteGroup(IEnumerable value) => DbAdapterManager.Create().DeleteGroup(value); /// /// 保存新建/更新的群组信息 /// /// /// public static bool SaveGroup(Group p) => DbAdapterManager.Create().SaveGroup(p); /// /// 根据用户查询部门信息 /// /// /// public static IEnumerable RetrieveGroupsByUserId(int userId) => DbAdapterManager.Create().RetrieveGroupsByUserId(userId); /// /// 保存用户部门关系 /// /// /// /// public static bool SaveGroupsByUserId(int id, IEnumerable groupIds) => DbAdapterManager.Create().SaveGroupsByUserId(id, groupIds); /// /// 根据角色ID指派部门 /// /// /// public static IEnumerable RetrieveGroupsByRoleId(int roleId) => DbAdapterManager.Create().RetrieveGroupsByRoleId(roleId); /// /// 根据角色ID以及选定的部门ID,保到角色部门表 /// /// /// /// public static bool SaveGroupsByRoleId(int id, IEnumerable groupIds) => DbAdapterManager.Create().SaveGroupsByRoleId(id, groupIds); } }