示例#1
0
        public static List<XYPoint> GetIdealBurndownLine(this RMilestoneStatus ms, DateTime startDate)
        {
            //var rep = new ReleaseRepository();
            //var result = rep.GetArtefactsProgress(ms.Release.Id);

            // determine amount days till milestone
            var period = new Period { StartDate = startDate, EndDate = ms.Date };

            // poc: check on deliverableId 28 (artefact code change)
            //var firstDayPoint = result
            //    .Where(x => ms.Id == x.MilestoneId && period.ListWorkingDays[x.StatusDate.ToDutchString()] != null) // get items for specified milestone with statusdate within specified period
            //    .GroupBy(m => m.StatusDate.ToDutchString(), coll => coll.HoursRemaining, (key, values) => new { HoursRemaining = values.Sum(), Date = key }) // group by statusdate, elementselector (every statusdate-key returns enumerable of remaining hours), return new type
            //    .Select(aProgress => new XYPoint { Y = aProgress.HoursRemaining, X = period.ListWorkingDays[aProgress.Date].Number })
            //    .First();
            var firstDayPoint = ms.GetTotalWorkloadHistoryPerDay(startDate).First();
            var lastDayPoint = new XYPoint { X = period.AmountWorkingDays, Y = 0 };

            var points = new List<XYPoint>();
            points.Add(firstDayPoint);
            points.Add(lastDayPoint);
            return points;
        }
示例#2
0
        public static List<XYPoint> GetIdealBurndownLine(this RMilestoneStatus ms, DateTime startDate, int artefactId)
        {
            //var rep = new ReleaseRepository();
            //var result = rep.GetArtefactsProgress(ms.Release.Id);

            //// determine amount days till milestone
            var period = new Period { StartDate = startDate, EndDate = ms.Date };

            //// poc: check on deliverableId 28 (artefact code change)
            //var firstDayPoint = result
            //    .Where(x => ms.Id == x.MilestoneId && x.ArtefactId == artefactId && period.ListWorkingDays[x.StatusDate.ToDutchString()] != null)
            //    .Select(aProgress => new XYPoint { Y = aProgress.HoursRemaining, X = period.ListWorkingDays[aProgress.StatusDate.ToDutchString()].Number })
            //    .First();
            var firstDayPoint = ms.GetWorkloadHistoryPerDayAndArtefact(startDate, artefactId).First();
            var lastDayPoint = new XYPoint { X = period.AmountWorkingDays, Y = 0 };

            var points = new List<XYPoint>();
            points.Add(firstDayPoint);
            points.Add(lastDayPoint);
            return points;
        }