Пример #1
0
 public static TaskPayload FromEntity(UserTaskInfo task, Domain.ProjectWf project)
 {
     return(new TaskPayload
     {
         TaskId = task.Id,
         TaskType = task.TaskDefinitionKey,
         TaskName = task.Name,
         Assignee = task.Assignee,
         ObjectWfId = project?.Id.ToString(),
         ObjectId = project?.ObjectId.ToString(),
         ObjectName = project?.ObjectName,
         ObjectStatus = project?.Status.ToString(),
         Actions = task.AvailableActions()
     });
 }
Пример #2
0
 public static TaskDto FromEntity(UserTaskInfo task, Order relatedOrder)
 {
     return(new TaskDto
     {
         TaskId = task.Id,
         TaskType = task.TaskDefinitionKey,
         TaskName = task.Name,
         Assignee = task.Assignee,
         OrderId = relatedOrder?.Id.Value,
         RequestedSuperpower = relatedOrder?.Superpower.Name,
         OrderFrom = relatedOrder?.Period.From,
         OrderTo = relatedOrder?.Period.To,
         Customer = relatedOrder?.Customer.Name,
         OrderStatus = relatedOrder?.Status.ToString(),
         Actions = task.AvailableActions()
     });
 }