Esempio n. 1
0
        public List <ReportObject> GetReports(DateTime startDate, DateTime endDate)
        {
            var projects      = _projectDAO.GetAllProjectsBetweenDate(startDate, endDate);
            var reportObjects = new List <ReportObject>();

            foreach (var project in projects)
            {
                var reportObject = new ReportObject();
                reportObject.ProjectKey             = project.Key;
                reportObject.ProjectName            = project.Name;
                reportObject.OwnerUsername          = project.CreatedUser.Username;
                reportObject.SumOfMembers           = project.Members.Count;
                reportObject.CurrentSprint          = project.Sprints.Max(s => s.Order);
                reportObject.EpicsRemained          = project.Epics.Where(epic => epic.UserStories.Any(u => u.State != UserStoryState.RESOLVED)).ToList().Count;
                reportObject.UserStoriesRemained    = project.Epics.Sum(e => e.UserStories.Count(u => u.State != UserStoryState.RESOLVED));
                reportObject.StoryPointsAccumulated = project.Epics.Sum(e => e.UserStories.Where(u => u.State == UserStoryState.RESOLVED).Sum(u => u.StoryPoints));
                reportObjects.Add(reportObject);
            }
            return(reportObjects);
        }