/// <summary> /// 取出用户的页面权限 /// </summary> protected List <FineOffice.Modules.SYS_PageAuthority> GetAuthorityList(FineOffice.Modules.SYS_User user) { List <int> roleIDs = this.JsonToList <int>(user.RoleList); List <FineOffice.Modules.SYS_Role> roleList = roleBll.GetList(r => roleIDs.Contains(r.ID)); List <int> authorityIDs = new List <int>(); foreach (FineOffice.Modules.SYS_Role role in roleList) { List <int> tempIDs = this.JsonToList <int>(role.AuthorityList); authorityIDs.AddRange(tempIDs); } return(authorityBll.GetList(m => authorityIDs.Contains(m.ID))); }
/// <summary> /// 取出用户的菜单 /// </summary> protected List <FineOffice.Modules.SYS_MenuList> GetMenuList(FineOffice.Modules.SYS_User user) { List <int> roleIDs = this.JsonToList <int>(user.RoleList); List <FineOffice.Modules.SYS_Role> roleList = roleBll.GetList(r => roleIDs.Contains(r.ID)); List <int> menuIDs = new List <int>(); foreach (FineOffice.Modules.SYS_Role temp in roleList) { List <int> tempIDs = this.JsonToList <int>(temp.MenuList); menuIDs.AddRange(tempIDs); } return(menuBll.GetList(m => menuIDs.Contains(m.ID))); }
public FineOffice.Modules.SYS_User Update(FineOffice.Modules.SYS_User model) { dal.Initialization(); FineOffice.Entity.SYS_User entity = new Entity.SYS_User { ID = model.ID, Remark = model.Remark, IsModify = model.IsModify, CreateDate = model.CreateDate, Password = FineOffice.Common.DEncrypt.DESEncrypt.Encrypt(model.Password), PersonnelID = model.PersonnelID, UserName = model.UserName, Stop = model.Stop, CheckAuthority = model.CheckAuthority, RoleList = model.RoleList }; dal.Update(entity); dal.Dispose(); return(null); }
/// <summary> /// 返回一个model /// </summary> /// <returns></returns> public FineOffice.Modules.SYS_User GetModel(Func <FineOffice.Modules.SYS_User, bool> expression) { dal.Initialization(); FineOffice.Modules.SYS_User model = (from entity in dal.GetListAll() select new FineOffice.Modules.SYS_User { ID = entity.ID, Remark = entity.Remark, IsModify = entity.IsModify, CreateDate = entity.CreateDate, Password = entity.Password, PersonnelID = entity.PersonnelID, UserName = entity.UserName, Stop = entity.Stop, PersonnelNO = entity.HR_Personnel.PersonnelNO, PersonnelName = entity.HR_Personnel.Name, RoleList = entity.RoleList, CheckAuthority = entity.CheckAuthority }).Where(expression).FirstOrDefault(); dal.Dispose(); return(model); }
/// <summary> /// 返回一个model /// </summary> /// <returns></returns> public FineOffice.Modules.SYS_User GetModel(int id) { FineOffice.Modules.SYS_User model = GetModel(u => u.ID == id); return(model); }