public async Task <IActionResult> CreateOrEdit(EmployeeVM boVM) { if (ModelState.IsValid) { var x = await _boVMService.SaveBo(boVM); if (x) { return(RedirectToAction("CommonList")); } else { _boVMService.SetTypeItems(boVM); ViewData["ModuleName"] = "组织与人员管理"; ViewData["FunctionName"] = "编辑员工数据"; return(PartialView("_CreateOrEdit", boVM)); } } _boVMService.SetTypeItems(boVM); var titleString = "编辑员工数据"; if (boVM.IsNew) { titleString = "新建员工数据"; } ViewData["ModuleName"] = "组织与人员管理"; ViewData["FunctionName"] = titleString; return(PartialView("_CreateOrEdit", boVM)); }
/// <summary> /// 根据用户 Id 更新地址 /// </summary> /// <param name="id"></param> /// <param name="valString"></param> /// <returns></returns> public async Task <IActionResult> EditPersonAddress(Guid id, string valString) { var updateStatus = true; // 更新用户相关的 var employeeService = new EmployeeVMService(_employeeRepository, _studentRepository, _gradeAndClassRepository, _departmentRepository, _businessImageRepository, _jobTitleRepository, _userManager, _roleManager); var employeeVM = await _boVMService.GetEmployeeVMByUserId(id); if (employeeVM != null) { employeeVM.Address = valString; updateStatus = await employeeService.SaveBo(employeeVM); } return(Json(updateStatus)); }