public JsonSprintBurnDown(int sprintId)
            : base()
        {
            Data     = new List <object>();
            YAxisMin = 0;

            if (sprintId >= 0)
            {
                ScrumTimeEntities scrumTimeEntities = new ScrumTimeEntities();
                SprintService     sprintService     = new SprintService(scrumTimeEntities);
                Sprint            sprint            = sprintService.GetSprintById(sprintId);
                if (sprint != null && sprint.Scrums.Count() > 0)
                {
                    Data.Add(CreateIdealScrumTaskJsonList(sprint));
                    Data.Add(CreateScrumTaskJsonList(sprint));

                    XAxisMinDate = sprint.StartDate.ToString("MM/dd/yyyy");
                    XAxisMaxDate = sprint.FinishDate.ToString("MM/dd/yyyy");
                    YAxisMin     = 0;

                    ScrumService scrumService = new ScrumService(scrumTimeEntities);
                    YAxisMax = scrumService.GetMaxTaskHourCountBySprintId(sprint.SprintId);
                }
                else
                {
                    HandleBadSprint();
                }
            }
            else
            {
                HandleBadSprint();
            }
        }
        public ActionResult Index()
        {
            ScrumTimeEntities scrumTimeEntities  = new ScrumTimeEntities();
            string            currentProductName = "None";
            string            currentSprintName  = "None";
            string            nextReleaseName    = "None";
            ProductService    productService     = new ProductService(scrumTimeEntities);
            Product           product            = productService.GetProductById(SessionHelper.GetCurrentProductId(User.Identity.Name, Session));

            if (product != null && product.ProductId > 0)
            {
                currentProductName = product.Name;
                SprintService sprintService = new SprintService(scrumTimeEntities);
                Sprint        sprint        = sprintService.GetSprintById(SessionHelper.GetCurrentSprintId(User.Identity.Name, Session));
                if (sprint != null && sprint.SprintId > 0)
                {
                    currentSprintName = sprint.Name;
                    ReleaseService releaseService = new ReleaseService(scrumTimeEntities);
                    Release        nextRelease    = releaseService.GetNextReleaseEqOrAfterDate(sprint.ProductId, sprint.FinishDate);
                    if (nextRelease != null && nextRelease.ReleaseId > 0)
                    {
                        nextReleaseName = nextRelease.Name;
                    }
                }
            }
            DashboardViewModel dashboardViewModel = new DashboardViewModel()
            {
                CurrentProductName = currentProductName,
                CurrentSprintName  = currentSprintName,
                NextReleaseName    = nextReleaseName
            };

            return(PartialView(dashboardViewModel));
        }
        public ActionResult CurrentReadOnly()
        {
            SprintService sprintService = new SprintService(_ScrumTimeEntities);
            Sprint        sprint        = sprintService.GetSprintById(SessionHelper.GetCurrentSprintId(User.Identity.Name, Session));

            return(PartialView(sprint));
        }
        public ActionResult CurrentSprintName()
        {
            string currentSprintName = "";
            int    currentSprintId   = SessionHelper.GetCurrentSprintId(User.Identity.Name, Session);

            if (currentSprintId > 0)
            {
                Sprint currentSprint = SprintService.GetSprintById(_ScrumTimeEntities, currentSprintId);
                if (currentSprint != null)
                {
                    currentSprintName = currentSprint.Name;
                }
            }
            return(new SecureJsonResult(currentSprintName));
        }
Exemple #5
0
        public ActionResult Index()
        {
            DateTime      fromDate      = DateTime.Now.AddDays(-60);
            DateTime      toDate        = DateTime.Now.AddDays(60);
            SprintService sprintService = new SprintService(_ScrumTimeEntities);
            Sprint        currentSprint = sprintService.GetSprintById(SessionHelper.GetCurrentSprintId(User.Identity.Name, Session));

            if (currentSprint != null && currentSprint.SprintId > 0)
            {
                fromDate = currentSprint.StartDate.AddDays(-60);
                toDate   = currentSprint.FinishDate.AddDays(60);
            }
            ScheduleViewModel scheduleViewModel = new ScheduleViewModel()
            {
                FromDate = fromDate,
                ToDate   = toDate
            };

            return(View(scheduleViewModel));
        }
        public ActionResult ReadOnly(int id)
        {
            Sprint sprint = _SprintService.GetSprintById(id);

            return(PartialView(sprint));
        }