public TaskNode(DObject obj, IRepository repository) { var task = new DTask(obj, repository); Id = task.Id; Title = task.DisplayTitle; Initiator = task.GetInitiatorDisplayName(repository); Executor = task.GetExecutorDisplayName(repository); State = task.State; Kind = task.Kind; DateOfAssignment = task.DateOfAssignment; DeadlineDate = task.DeadlineDate; DateOfStart = task.DateOfStart; }
public TaskDetailsViewModel(Guid taskId, IRepository repository) { var objs = repository.GetObjects(new[] { taskId }); if (!objs.Any()) { return; } var task = new DTask(objs.First(), repository); Title = task.Title; Description = task.Description; Initiator = task.GetInitiatorDisplayName(repository); Executor = task.GetExecutorDisplayName(repository); if (task.InitiatorAttachments.Any()) { Attachments = repository.GetObjects(task.InitiatorAttachments.ToArray()).Select(a => new Attachment(a, repository)); } }