コード例 #1
0
        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}";
        }
コード例 #2
0
        private ProjectTaskFilledVm ComposeProjectTaskVm(ProjectTaskVm projectTasksVm, SelectList employeeSelectList, SelectList projectSelectList)
        {
            ProjectTaskFilledVm projectTaskFilledVm = new ProjectTaskFilledVm()
            {
                ProjectTasks       = projectTasksVm,
                EmployeeSelectList = employeeSelectList,
                ProjectSelectList  = projectSelectList,
            };

            return(projectTaskFilledVm);
        }
コード例 #3
0
        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));
        }