private void AnalyzeProgressForStory() { foreach (var story in CurrentSprint.GetUnCompletedStories()) { StoryProgressItem progressItem = GetStoryProgress(story); ProgressOfStories.Add(progressItem); } ProgressOfStories.Sort(new StoryProgressItemComparer()); }
private StoryProgressItem GetStoryProgress(Story story) { var progressItem = new StoryProgressItem(); progressItem.StoryType = story.Type.ToString(); progressItem.StoryDesc = story.GetDesc(); progressItem.Owner = NameUtil.ConvertToEngName(story.Owner); decimal totalWorkDone = GetTotalStoryWorkDoInHours(story); decimal totalWorkToDo = GetTotalStoryWorkToDoInHours(story); if ((totalWorkToDo + totalWorkDone) == 0) { progressItem.Progress = 0; } else { progressItem.Progress = (int)((totalWorkDone / (totalWorkToDo + totalWorkDone)) * 100); } return(progressItem); }