public virtual 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 JsonTaskHoursPerSprint(int productId, int currentSprintId) : base() { Data = new List<object>(); Ticks = new List<string>(); YAxisMin = 0; if (productId >= 0) { ScrumTimeEntities scrumTimeEntities = new ScrumTimeEntities(); ProductService productService = new ProductService(scrumTimeEntities); Product product = productService.GetProductById(productId); Data.Add(CreateTaskHoursPerSprintJsonList(product, currentSprintId)); } else HandleBadProductId(); }
public virtual ActionResult CurrentReadOnly() { ProductService productService = new ProductService(_ScrumTimeEntities); Product product = productService.GetProductById(SessionHelper.GetCurrentProductId(User.Identity.Name, Session)); return PartialView(product); }
public virtual ActionResult SetCurrent(int productId) { SessionHelper.SetCurrentProductId(User.Identity.Name, Session, productId); ProductService productService = new ProductService(_ScrumTimeEntities); Product product = productService.GetProductById(SessionHelper.GetCurrentProductId(User.Identity.Name, Session)); if (product.Sprints != null && product.Sprints.Count() > 0) { Sprint sprint = product.Sprints.First<Sprint>(); SessionHelper.SetCurrentSprintId(User.Identity.Name, Session, sprint.SprintId); } else { SessionHelper.SetCurrentSprintId(User.Identity.Name, Session, -1); } return new SecureJsonResult(new { productId }); }