public IActionResult CreateOrEdit(Guid id) { var boVM = _boVMService.GetVM(id); ViewData["ModuleName"] = "组织与人员管理"; ViewData["FunctionName"] = "编辑学生数据"; return(PartialView("_CreateOrEdit", boVM)); }
/// <summary> /// 根据用户 Id 返回学生视图模型 /// </summary> /// <param name="id"></param> /// <returns></returns> public async Task <StudentVM> GetStudentVMByUserId(Guid id) { StudentVM studentVM = null; var studentService = new StudentVMService(_studentRepository, _gradeAndClassRepository, _employeeRepository, _departmentRepository, _businessImageRepository, _jobTitleRepository, _userManager, _roleManager); var studentUserItems = await _employeeRepository.GetAllIncludingAsyn(x => x.User); var studentUser = studentUserItems.Where(x => x.User != null).FirstOrDefault(x => x.User.Id == id); if (studentUser != null) { studentVM = studentService.GetVM(studentUser.Id); } return(studentVM); }