コード例 #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();
     }
 }