public ActionResult Edit(int id) { var model = new TimelineFormModel(); var timeline = TimelineRepository.TimelineFetch(id); model.Title = "Timeline Edit"; model.Timeline = timeline; return this.View(model); }
public ActionResult Create(int sourceId, int sourceTypeId) { var model = new TimelineFormModel(); var timeline = TimelineRepository.TimelineNew(sourceId, (SourceType)sourceTypeId); model.Title = "Timeline Create"; model.Timeline = timeline; return this.View(model); }
public ActionResult Create(int sourceId, int sourceTypeId, FormCollection collection) { var model = new TimelineFormModel(); var timeline = TimelineRepository.TimelineNew(sourceId, (SourceType)sourceTypeId); this.Map(collection, timeline); timeline = TimelineRepository.TimelineSave(timeline); if (timeline.IsValid) { return this.Redirect(timeline); } model.Title = "Timeline Create"; model.Timeline = timeline; ModelHelper.MapBrokenRules(this.ModelState, timeline); return this.View(model); }
public ActionResult Edit(int id, FormCollection collection) { var model = new TimelineFormModel(); var timeline = TimelineRepository.TimelineFetch(id); this.Map(collection, timeline); timeline = TimelineRepository.TimelineSave(timeline); if (timeline.IsValid) { return this.Redirect(timeline); } model.Title = "Timeline Edit"; model.Timeline = timeline; ModelHelper.MapBrokenRules(this.ModelState, timeline); return this.View(model); }