Пример #1
0
        internal static Timeline FetchTimeline(TimelineData data)
        {
            var result = new Timeline();

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

            return result;
        }
Пример #2
0
        public static bool TimelineDelete(Timeline timeline)
        {
            Timeline.DeleteTimeline(
                new TimelineDataCriteria
                {
                    TimelineId = timeline.TimelineId
                });

            return true;
        }
Пример #3
0
        public static Timeline TimelineInsert(Timeline timeline)
        {
            timeline = timeline.Save();

            return timeline;
        }
Пример #4
0
        public static Timeline TimelineUpdate(Timeline timeline)
        {
            if (!timeline.IsDirty)
            {
                return timeline;
            }

            timeline = timeline.Save();

            return timeline;
        }
Пример #5
0
        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;
        }
Пример #6
0
 private void Map(FormCollection source, Timeline destination)
 {
     destination.Body = source["Body"];
 }
Пример #7
0
 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();
     }
 }