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 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 static void CreateFirstTimeDefaults(string username) { ScrumTimeEntities scrumTimeEntities = new ScrumTimeEntities(); UserSetting userSetting = UserSettingService.GetUserSettingByUsername(scrumTimeEntities, username); if (userSetting == null) { // Load sample product id ProductService productService = new ProductService(scrumTimeEntities); int productIdOfSample = productService.GetProductIdOfSample(); if (productIdOfSample > -1) { SprintService sprintService = new SprintService(scrumTimeEntities); List<Sprint> mostRecentSprints = sprintService.GetMostRecentSprints(productIdOfSample, -1, 1); if (mostRecentSprints.Count > 0 && mostRecentSprints[0] != null) { userSetting = new UserSetting() { CurrentProduct = productIdOfSample, CurrentSprint = mostRecentSprints[0].SprintId, LastMainTabSelected = 1, Username = username }; scrumTimeEntities.AddToUserSettings(userSetting); scrumTimeEntities.SaveChanges(System.Data.Objects.SaveOptions.AcceptAllChangesAfterSave); } } } }
public void GetSprintsWithinDateRangeTest() { ScrumTimeEntities scrumTimeEntities = new ScrumTimeEntities(); SprintService sprintService = new SprintService(scrumTimeEntities); List<Sprint> sprints = sprintService.GetSprintsWithinDateRange(1, new DateTime(2010, 1, 1), new DateTime(2010, 6, 5)); Assert.AreEqual(5, sprints.Count()); }
public Scrum GenerateNewScrumDetails(int sprintId, Scrum scrum) { SprintService sprintService = new SprintService(_ScrumTimeEntities); Sprint sprint = sprintService.GetSprintById(sprintId); if (sprint != null) { foreach (Story story in sprint.Stories) { foreach (Task task in story.Tasks) { ScrumDetail scrumDetail = BuildScrumDetail(sprint, task); scrum.ScrumDetails.Add(scrumDetail); } } } return scrum; }
public Scrum GenerateNewScrumDetails(int sprintId, Scrum scrum) { SprintService sprintService = new SprintService(_ScrumTimeEntities); Sprint sprint = sprintService.GetSprintById(sprintId); if (sprint != null) { foreach (Story story in sprint.Stories) { foreach (Task task in story.Tasks) { ScrumDetail scrumDetail = BuildScrumDetail(sprint, task); scrum.ScrumDetails.Add(scrumDetail); } } } return(scrum); }
public virtual 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); }
// [['08/03/2010', 51, '08/03/2010'], ['08/05/2010', 0, '08/05/2010']] private List<object> CreateIdealScrumTaskJsonList(Sprint sprint) { ScrumTimeEntities scrumTimeEntities = new ScrumTimeEntities(); SprintService sprintService = new SprintService(scrumTimeEntities); List<object> idealScrumTaskJsonList = new List<object>(); List<object> scrumDetailList1 = new List<object>(); List<object> scrumDetailList2 = new List<object>(); if (sprint != null) { scrumDetailList1.Add(sprint.StartDate.ToString("MM/dd/yyyy")); scrumDetailList1.Add(sprintService.GetTotalHourCount(sprint.SprintId)); scrumDetailList1.Add(sprint.StartDate.ToString("MM/dd/yyyy")); idealScrumTaskJsonList.Add(scrumDetailList1); scrumDetailList2.Add(sprint.FinishDate.ToString("MM/dd/yyyy")); scrumDetailList2.Add(0); scrumDetailList2.Add(sprint.FinishDate.ToString("MM/dd/yyyy")); idealScrumTaskJsonList.Add(scrumDetailList2); } return idealScrumTaskJsonList; }
// [[1, 250, 'Unscheduled'], [2, 54, 'Sprint 1'], [3, 20, 'Sprint Banana'], [4, 0, 'Sprint Cross Reference'], [5, 8, 'Sprint Sammy']] private List<object> CreateTaskHoursPerSprintJsonList(Product product, int currentSprintId) { List<object> taskHoursPerSprintJsonList = new List<object>(); ScrumTimeEntities scrumTimeEntities = new ScrumTimeEntities(); TaskService taskService = new TaskService(scrumTimeEntities); decimal unassignedTaskHours = taskService.GetUnassignedTaskHours(product.ProductId); CheckSetYAxisMax(unassignedTaskHours); List<object> unassignedHoursList = new List<object>(); unassignedHoursList.Add(1); unassignedHoursList.Add(unassignedTaskHours); unassignedHoursList.Add("Unassigned"); taskHoursPerSprintJsonList.Add(unassignedHoursList); Ticks.Add(" "); SprintService sprintService = new SprintService(scrumTimeEntities); List<Sprint> mostRecentSprints = sprintService.GetMostRecentSprints(product.ProductId, currentSprintId, 4); int index = 2; foreach (Sprint recentSprint in mostRecentSprints) { List<object> sprintHoursList = new List<object>(); sprintHoursList.Add(index); sprintHoursList.Add(CalculateHoursForSprint(recentSprint)); sprintHoursList.Add(recentSprint.Name); taskHoursPerSprintJsonList.Add(sprintHoursList); Ticks.Add(" "); index++; } return taskHoursPerSprintJsonList; }
public virtual ActionResult CurrentReadOnly() { SprintService sprintService = new SprintService(_ScrumTimeEntities); Sprint sprint = sprintService.GetSprintById(SessionHelper.GetCurrentSprintId(User.Identity.Name, Session)); return PartialView(sprint); }
public SprintController() { _ScrumTimeEntities = new ScrumTimeEntities(); _SprintService = new SprintService(_ScrumTimeEntities); _ProductService = new ProductService(_ScrumTimeEntities); }
public ScheduleController() { _ScrumTimeEntities = new ScrumTimeEntities(); _SprintService = new SprintService(_ScrumTimeEntities); _ReleaseService = new ReleaseService(_ScrumTimeEntities); }