public Sprint GetNextSprint(int projectId) { var project = _projectDAO.GetProjectById(projectId); if (project.Sprints.Count == 0) { var sprint = new Sprint() { Order = 0, State = SprintState.QUEUING, }; _projectDAO.AddSprint(projectId, sprint); _projectDAO.SetStartDate(projectId, DateTime.Today); project = _projectDAO.GetProjectById(projectId); } return(project.Sprints.OrderByDescending(sprint => sprint.Order).First()); }
public ActionResult Index(int projectId) { string userId = User.FindFirst(ClaimTypes.NameIdentifier).Value; ProjectModel project = projectDao.GetProjectById(projectId, userId); ProjectViewModel viewModel = project.ToProjectViewModel(); return(View(viewModel)); }
public PartialViewResult LoadProjectPartial(string mode, int projectId) { string userId = User.FindFirst(ClaimTypes.NameIdentifier).Value; ModifyProjectViewModel viewModel = new(); if (mode == "edit" || mode == "delete") { viewModel = projectDao.GetProjectById(projectId, userId).ToModifyProjectViewModel(); } viewModel.Mode = mode; return(PartialView("~/Views/Dashboard/Partials/ModifyProjectPartial.cshtml", viewModel)); }