Example #1
0
        public SequenceModel GetSequence(int taskId)
        {
            SequenceModel model = new SequenceModel();

            Task parent = session.Load<Task>(taskId);

            model.Parent = new LiteItemModel();
            model.Parent.FilledBy(parent);

            model.Children = new List<LiteItemModel>();
            foreach (Task task in parent.Children)
            {
                LiteItemModel item = new LiteItemModel();
                item.FilledBy(task);
                model.Children.Add(item);
            }

            return model;
        }
Example #2
0
 private static void filledBy(this IList<LiteItemModel> models, IList<Task> tasks)
 {
     foreach (Task task in tasks)
     {
         LiteItemModel model = new LiteItemModel();
         model.FilledBy(task);
         models.Add(model);
     }
 }
Example #3
0
 public LiteItemModel GetLite(int taskId)
 {
     Task task = session.Get<Task>(taskId);
     LiteItemModel model = null;
     if (task != null)
     {
         model = new LiteItemModel();
         model.FilledBy(task);
     }
     return model;
 }
Example #4
0
 private static void filledByTail(this  LinkedList<LiteItemModel> models, Task tail)
 {
     while (tail.Parent != null)
     {
         LiteItemModel item = new LiteItemModel();
         item.FilledBy(tail);
         models.AddFirst(item);
         tail = tail.Parent;
     }
     LiteItemModel first = new LiteItemModel();
     first.FilledBy(tail);
     models.AddFirst(first);
 }