Beispiel #1
0
        public ActionResult UserManagement()
        {
            var model = new ConsoleModels.UserManagementDto();

            var list = _repo.All <User>().FindAll(x => x.IsActive);

            if (list.Count > 0)
            {
                var mapper = UserDto.ConfigMapper().CreateMapper();
                var users  = mapper.Map <IEnumerable <UserDto> >(list.AsEnumerable()).ToList();

                // 按工号升序排列
                int no;
                model.Users = users.OrderBy(x => int.TryParse(x.EmployeeNo, out no) ? no : 0).ToList();
            }

            return(View(model));
        }