示例#1
0
        public JsonResult GetReleaseProgress(int phaseid, int milestoneId)
        {
            // get complete progress data per artefact
            var rep = new ReleaseRepository();
            var progress = rep.GetArtefactsProgress(phaseid, milestoneId);

            // get burndown for total
            var msRep = new MilestoneRepository();
            var ms = msRep.GetItemById(milestoneId);

            try
            {
                // TODO: determine startdate by using the Phase startdate to which the Milestone is connected
                var uc = new GetBurndownData(new Milestone { Id = milestoneId, Date = ms.Date, Release = new Release { Id = phaseid } }, DateTime.Now.AddDays(-40));
                var burndown = uc.Execute();

                return this.Json(new { Progress = progress, Burndown = burndown }, JsonRequestBehavior.AllowGet);
            }
            catch (ConditionNotMetException ex)
            {
                HttpContext.Response.StatusDescription = string.Format("A condition has not been met: {0}", ex.Message);
                HttpContext.Response.StatusCode = 400;
                return this.Json(string.Format("A condition has not been met: {0}", ex.Message), JsonRequestBehavior.AllowGet);
            }
            catch (ProcessException ex)
            {
                HttpContext.Response.StatusDescription = string.Format("A use case processing exception has occurred: {0}", ex.Message);
                HttpContext.Response.StatusCode = 400;
                return this.Json(string.Format("A use case processing exception has occurred: {0}", ex.Message), JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {
                HttpContext.Response.StatusDescription = string.Format("An exception has occurred: {0}", ex.Message);
                HttpContext.Response.StatusCode = 500;
                return this.Json(string.Format("An exception has occurred: {0}", ex.Message), JsonRequestBehavior.AllowGet);
            }
        }
示例#2
0
 public JsonResult GetProcessPerformance(int releaseId)
 {
     // todo: return performance data
     var uc = new GetBurndownData(new Milestone { Id = 24, Release = new Release { Id = releaseId }, Date = DateTime.Parse("24 April 2013") }, DateTime.Now.AddDays(-40));
     var burndown = uc.Execute();
     return this.Json(burndown, JsonRequestBehavior.AllowGet);
 }