public static string GetTitle(this DTask task) { if (string.IsNullOrEmpty(task.Title)) { return(task.Description.LimitCharacters(150)); } return(task.Title); }
public static string GetExecutorDisplayName(this DTask task, IRepository repository) { string name; if (task.Executor == null) { name = repository.GetOrganisationUnit(task.ExecutorPosition.Id).Title; } else { name = task.Executor.Id == repository.CurrentPerson().Id ? "You" : task.Executor.ActualName(); } return(name); }