예제 #1
0
파일: UserManager.cs 프로젝트: baomen/bmmf
        /// <summary>
        /// 添加实体的扩展属性
        /// </summary>
        /// <param name="item"></param>
        protected override void AppendExtention(User item)
        {
            item.Roles = userRoleManager.GetList(new UserRoleFilter {
                UserId = item.Id
            }).Select(p => roleManager.Get(p.RoleId)).Where(p => p != null).ToList();
            IDepartmentManager           departmentManager = serviceProvider.GetRequiredService <IDepartmentManager>();
            ICollection <UserDepartment> userDepartments   = userDepartmentManager.GetList(new UserDepartmentFilter {
                UserId = item.Id
            });

            item.Departments = userDepartments.Select(p => departmentManager.Get(p.DepartmentId)).ToList();
        }
예제 #2
0
        public ActionResult Edit(int?id)
        {
            var vm = _departmentManager.Get(id);

            return(View(vm));
        }