internal static Timeline FetchTimeline(TimelineData data)
        {
            var result = new Timeline();

            result.Fetch(data);
            result.MarkOld();

            return result;
        }
        public static bool TimelineDelete(Timeline timeline)
        {
            Timeline.DeleteTimeline(
                new TimelineDataCriteria
                {
                    TimelineId = timeline.TimelineId
                });

            return true;
        }
        public static Timeline TimelineInsert(Timeline timeline)
        {
            timeline = timeline.Save();

            return timeline;
        }
        public static Timeline TimelineUpdate(Timeline timeline)
        {
            if (!timeline.IsDirty)
            {
                return timeline;
            }

            timeline = timeline.Save();

            return timeline;
        }
        public static Timeline TimelineSave(Timeline timeline)
        {
            if (!timeline.IsValid)
            {
                return timeline;
            }

            Timeline result;

            if (timeline.IsNew)
            {
                result = TimelineRepository.TimelineInsert(timeline);
            }
            else
            {
                result = TimelineRepository.TimelineUpdate(timeline);
            }

            return result;
        }
 private void Map(FormCollection source, Timeline destination)
 {
     destination.Body = source["Body"];
 }
 public ActionResult Redirect(Timeline timeline)
 {
     switch (timeline.SourceTypeName)
     {
         case "User":
             return this.RedirectToAction("Index", "Home");
         case "Project":
             return this.RedirectToAction("Details", "Project", new { id = timeline.SourceId });
         default:
             throw new InvalidSourceException();
     }
 }