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); }
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); }