Ejemplo n.º 1
0
        internal static void FeedAdd(string action, Note note)
        {
            var feed = FeedRepository.FeedNew(action, SourceType.Note, note.NoteId);

            switch ((SourceType)note.SourceTypeId)
            {
            case SourceType.Project:
                feed.Sources.Add(SourceType.Project, note.SourceId);
                break;

            case SourceType.Sprint:
                var sprint = SprintRepository.SprintFetch(note.SourceId);
                feed.Sources.Add(SourceType.Project, sprint.ProjectId);
                feed.Sources.Add(SourceType.Sprint, sprint.SprintId);
                break;

            case SourceType.Story:
                var story = StoryRepository.StoryFetch(note.SourceId);
                feed.Sources.Add(SourceType.Project, story.ProjectId);
                feed.Sources.Add(SourceType.Story, story.StoryId);
                break;
            }

            feed.Description = note.Body;

            feed.Save();
        }
Ejemplo n.º 2
0
 public static StoryInfoList StoryFetchInfoList(IUser assignedTo, bool?isArchived)
 {
     return(StoryRepository.StoryFetchInfoList(new StoryDataCriteria
     {
         AssignedTo = assignedTo.UserId,
         IsArchived = isArchived
     }));
 }
Ejemplo n.º 3
0
        public static void StoryUpdateDuration(int storyId)
        {
            var story = StoryRepository.StoryFetch(storyId);
            var hour  = HourRepository.HourFetchInfoList(story);

            story.Duration = hour.Sum(row => row.Duration);

            StoryRepository.StoryUpdate(story);
        }
Ejemplo n.º 4
0
        public static bool HourDelete(Hour hour)
        {
            Hour.DeleteHour(
                new HourDataCriteria
            {
                HourId = hour.HourId
            });

            StoryRepository.StoryUpdateDuration(hour.StoryId);

            FeedRepository.FeedAdd(FeedAction.Deleted, hour);

            return(true);
        }
Ejemplo n.º 5
0
        public static Hour HourSave(Hour hour)
        {
            if (!hour.IsValid)
            {
                return(hour);
            }

            Hour result;

            if (hour.IsNew)
            {
                result = HourRepository.HourInsert(hour);
            }
            else
            {
                result = HourRepository.HourUpdate(hour);
            }

            StoryRepository.StoryUpdateDuration(hour.StoryId);

            return(result);
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
0
 public static StoryInfoList StoryFetchInfoList()
 {
     return(StoryRepository.StoryFetchInfoList(new StoryDataCriteria()));
 }
Ejemplo n.º 8
0
 public static bool StoryDelete(int storyId)
 {
     return(StoryRepository.StoryDelete(
                StoryRepository.StoryFetch(storyId)));
 }