internal static Story FetchStory(StoryData data) { var result = new Story(); result.Fetch(data); result.MarkOld(); return result; }
public static bool StoryDelete(Story story) { ProjectUserRepository.AuthorizeProjectUser(story.ProjectId); Story.DeleteStory( new StoryDataCriteria { StoryId = story.StoryId }); FeedRepository.FeedAdd(FeedAction.Deleted, story); return true; }
public static Story StoryUpdate(Story story) { if (!story.IsDirty) { return story; } story = story.Save(); SourceRepository.SourceUpdate(story.StoryId, SourceType.Story, story.StoryId.ToString()); FeedRepository.FeedAdd(FeedAction.Edited, story); return story; }
public static Story StorySave(Story story) { if (!story.IsValid) { return story; } ProjectUserRepository.AuthorizeProjectUser(story.ProjectId); Story result; if (story.IsNew) { result = StoryRepository.StoryInsert(story); } else { result = StoryRepository.StoryUpdate(story); } return result; }
public static Story StoryInsert(Story story) { story = story.Save(); SourceRepository.SourceAdd(story.StoryId, SourceType.Story, story.StoryId.ToString()); FeedRepository.FeedAdd(FeedAction.Created, story); return story; }
internal static void FeedAdd(string action, Story story) { var feed = FeedRepository.FeedNew(action, SourceType.Story, story.StoryId); if (action == FeedAction.Edited) { feed.Description = story.Auditor.Audit(story); } else { feed.Description = story.Description; } feed.Sources.Add(SourceType.Project, story.ProjectId); feed.Save(); }
public static Story StoryNew() { var story = Story.NewStory(); return(story); }
private void Map(FormCollection source, Story destination) { destination.AssignedTo = int.Parse(source["AssignedTo"]); destination.Description = source["Description"]; destination.EstimatedCompletedDate = DateTime.Parse(source["EstimatedCompletedDate"]); destination.EstimatedDuration = decimal.Parse(source["EstimatedDuration"]); destination.IsArchived = ModelHelper.ToBoolean(source["IsArchived"]); destination.SprintId = int.Parse(source["SprintId"]); destination.StatusId = int.Parse(source["StatusId"]); }