public static DTO.Task TranslateModelUserTaskToDTOTask(Model.UserTask ut) { if (ut == null) { return(null); } return(new DTO.Task { Code = ut.Code, Comments = Mapper.TranslateModelCommentListToDTOCommentList(ut.Comments), Completed = ut.Completed, Control = ControlMapper.TranslateModelControlToDTOControl(ut.Control), ControlId = ut.ControlId, ControlCode = ut.ControlCode, ControlSetCode = ut.ControlSetCode, ControlSetId = ut.ControlSetId, ControlSetTitle = ut.ControlSetTitle, ControlTitle = ut.ControlTitle, Created = ut.Created, CreatedByUserId = ut.CreatedByUserId, Description = ut.Description, Due = ut.Due, DueStatus = Mapper.TranslateModelDueStatusToDTODueStatus(ut.DueStatus), Events = Mapper.TranslateModelEventListToDTOEventList(ut.Events), Id = ut.Id, Link = ut.Link, RaciTeam = Mapper.TranslateModelRaciTeamToDTORaciTeam(ut.RaciTeam), TaskDefinitionId = ut.TaskDefinitionId, TaskState = Mapper.TranslateModelTaskStateToDTOTaskState(ut.TaskState), Title = ut.Title, WorkingSet = WorkingSetMapper.TranslateModelWorkingSetToDTOWorkingSet(ut.WorkingSet), WorkingSetId = ut.WorkingSetId }); }
public static DTO.TaskInfo TranslateModelUserTaskToDTOTaskInfo(Model.UserTask ut) { if (ut == null) { return(null); } return(new DTO.TaskInfo { Id = ut.Id, Code = ut.Code, Source = (ut.Control != null && ut.Control.DefinitionSource != null) ? ut.Control.DefinitionSource.Source : null, ControlId = ut.ControlId, ControlCode = ut.ControlCode, ControlSetCode = ut.ControlSetCode, ControlSetId = ut.ControlSetId, ControlSetTitle = ut.ControlSetTitle, ControlTitle = ut.ControlTitle, TaskState = Mapper.TranslateModelTaskStateToDTOTaskState(ut.TaskState), ResponsibleUser = (ut.RaciTeam != null) ? UserMapper.TranslateModelUserToDTOUser(ut.RaciTeam.ResponsibleUser) : null, Due = ut.Due, DueStatus = Mapper.TranslateModelDueStatusToDTODueStatus(ut.DueStatus), Completed = ut.Completed, Title = ut.Title }); }