private void FillProjectTaskVm(ProjectTaskVm item) { var employee = EmployeeService.Get(item.EmployeeId); var project = ProjectService.Get(item.ProjectId); item.EmployeeFullName = $"{employee.LastName} {employee.FirstName} {employee.Patronymic}"; item.ProjectShortName = $"{project.ShortName}"; }
private ProjectTaskFilledVm ComposeProjectTaskVm(ProjectTaskVm projectTasksVm, SelectList employeeSelectList, SelectList projectSelectList) { ProjectTaskFilledVm projectTaskFilledVm = new ProjectTaskFilledVm() { ProjectTasks = projectTasksVm, EmployeeSelectList = employeeSelectList, ProjectSelectList = projectSelectList, }; return(projectTaskFilledVm); }
public IActionResult Edit(int id) { logger.LogDebug($"ProjectTask.Edit [get] is called"); IList <EmployeeDto> employeesDto = EmployeeService.GetAll(); IList <ProjectDto> projectesDto = ProjectService.GetAll(); ProjectTaskVm ProjectTaskVm = ConvertToProjectTaskVm.Convert(ProjectTaskService.Get(id)); FillProjectTaskVm(ProjectTaskVm); ProjectTaskFilledVm model = ComposeProjectTaskVm(ProjectTaskVm, GetEmployeeSelectList(employeesDto), GetProjectSelectList(projectesDto)); return(View("CreateOrEdit", model)); }