Inheritance: ISource
Exemplo n.º 1
0
        internal static Story FetchStory(StoryData data)
        {
            var result = new Story();

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

            return result;
        }
Exemplo n.º 2
0
        public static bool StoryDelete(Story story)
        {
            ProjectUserRepository.AuthorizeProjectUser(story.ProjectId);

            Story.DeleteStory(
                new StoryDataCriteria
                {
                    StoryId = story.StoryId
                });

            FeedRepository.FeedAdd(FeedAction.Deleted, story);

            return true;
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
        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();
        }
Exemplo n.º 7
0
        public static Story StoryNew()
        {
            var story = Story.NewStory();

            return(story);
        }
Exemplo n.º 8
0
 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"]);
 }