public async Task <IActionResult> EditTaskAsync(int taskId, string errorMessage) { var task = await _manageTasksService.GetTaskByIdAsync(taskId); var team = await _manageSprintsService.GetTeam(task.TeamId); var teamMembers = await GetAllTeamMembersAsync(task.TeamId); var taskMemberName = teamMembers.FirstOrDefault(t => t.Id == task.MemberId).Member.Email; TaskFormViewModel model = new TaskFormViewModel { TeamId = task.TeamId, TaskId = task.Id, TaskSprintId = task.SprintId.GetValueOrDefault(), TeamName = team.TeamName, TaskName = task.Name, TaskLink = task.Link, TaskStoryPoints = task.StoryPoints, TaskMemberId = task.MemberId, ErrorMessage = errorMessage, TaskMemberName = taskMemberName, TeamMembers = new List <TeamMemberViewModel>() }; teamMembers.ForEach(t => model.TeamMembers.Add(new TeamMemberViewModel() { Member = t.Member, Id = t.Id })); return(View(model)); }
public async Task <IActionResult> AllSprints(int teamId, DisplayOptions options) { List <Sprint> sprints; options.SortDirection = SortDirection.ByStatus; if (await _accessCheckService.OwnerOrMemberAsync(teamId)) { var ienumarableSprints = await _manageSprintsService.GetAllSprintsAsync(teamId, options); sprints = ienumarableSprints.ToList(); } else { return(View("ErrorGetAllSprints")); } var isOwner = false; if (await _accessCheckService.IsOwnerAsync(teamId)) { isOwner = true; } var team = await _manageSprintsService.GetTeam(teamId); var teamMembers = await GetAllTeamMembersAsync(teamId, new DisplayOptions { }); team.SetTeamMembers(teamMembers); var sprintViewModel = SprintAndTeamViewModel.Create(null, sprints, team, isOwner, new List <MemberWorkingDays>()); return(View(sprintViewModel)); }
public async Task <IActionResult> AllSprints(int teamId, DisplayOptions options) { List <Sprint> sprints; if (await _accessCheckService.OwnerOrMemberAsync(teamId)) { sprints = (List <Sprint>) await _manageSprintsService.GetAllSprintsAsync(teamId, options); } else { return(View("ErrorGetAllSprints")); } var team = await _manageSprintsService.GetTeam(teamId); if (await _accessCheckService.IsOwnerAsync(teamId)) { ViewBag.AddVision = "visible"; } else { ViewBag.AddVision = "collapse"; } ViewData["DaysInSprint"] = _localizer["DaysInSprint"]; ViewData["StoryPointInHours"] = _localizer["StoryPointInHours"]; ViewData["NameOfSprint"] = _localizer["NameOfSprint"]; ViewData["AddMember"] = _localizer["AddMember"]; ViewData["RemoveMember"] = _localizer["RemoveMember"]; ViewData["Remove"] = _localizer["Remove"]; ViewData["Cancel"] = _localizer["Cancel"]; List <TeamMember> teamMembers = await GetAllTeamMembersAsync(teamId, new DisplayOptions { }); var sprintAndTeam = new SprintAndTeamViewModel { Sprints = new List <SprintViewModel>() }; sprints.ForEach(t => sprintAndTeam.Sprints.Add(new SprintViewModel() { Id = t.Id, DaysInSprint = t.DaysInSprint, Status = t.Status, Name = t.Name, StoryPointInHours = t.StoryPointInHours, TeamId = t.TeamId } )); sprintAndTeam.Team = new TeamViewModel() { Id = team.Id, Owner = team.Owner, TeamName = team.TeamName, TeamMembers = new List <TeamMemberViewModel>() }; teamMembers.ForEach(t => sprintAndTeam.Team.TeamMembers.Add(new TeamMemberViewModel() { Member = t.Member, MemberId = t.MemberId })); return(View(sprintAndTeam)); }
public async Task <IActionResult> AllSprints(int teamId, DisplayOptions options) { List <Sprint> sprints; if (await _accessCheckService.OwnerOrMemberAsync(teamId)) { sprints = (List <Sprint>) await _manageSprintsService.GetAllSprintsAsync(teamId, options); } else { return(View("ErrorGetAllSprints")); } List <TeamMember> teamMembers = await GetAllTeamMembersAsync(teamId, new DisplayOptions { }); var sprintViewModel = new SprintAndTeamViewModel { Sprints = new List <SprintViewModel>() }; if (await _accessCheckService.IsOwnerAsync(teamId)) { sprintViewModel.IsOwner = true; } else { sprintViewModel.IsOwner = false; } sprints.ForEach(t => sprintViewModel.Sprints.Add(new SprintViewModel() { Id = t.Id, DaysInSprint = t.DaysInSprint, Status = t.Status, Name = t.Name, StoryPointInHours = t.StoryPointInHours, TeamId = t.TeamId } )); var team = await _manageSprintsService.GetTeam(teamId); sprintViewModel.Team = new TeamViewModel() { Id = team.Id, Owner = team.Owner, TeamName = team.TeamName, TeamMembers = new List <TeamMemberViewModel>() }; teamMembers.ForEach(t => sprintViewModel.Team.TeamMembers.Add(new TeamMemberViewModel() { Member = t.Member, MemberId = t.MemberId })); return(View(sprintViewModel)); }
public async Task <IActionResult> EditTaskAsync(int taskId, string errorMessage) { var task = await _manageTasksService.GetTaskByIdAsync(taskId); var team = await _manageSprintsService.GetTeam(task.TeamId); var teamMembers = await GetAllTeamMembersAsync(task.TeamId); var teamMember = teamMembers.FirstOrDefault(t => t.Id == task.MemberId); var taskFormViewModel = TaskFormViewModel.Create(task, errorMessage, teamMembers, new List <Sprint>()); return(View(taskFormViewModel)); }
public async Task <IActionResult> GetAllWorkingDays(int sprintId) { var sprint = await _manageSprintsService.GetSprintAsync(sprintId, true); var workingDays = await _manageMemberWorkingDaysService.GetAllWorkingDaysForSprintAsync(sprintId); var team = await _manageSprintsService.GetTeam(sprint.TeamId); List <TeamMember> teamMembers = await _manageTeamsMembersService.GetAllTeamMembersAsync(sprint.TeamId, new DisplayOptions { }); var model = new SprintAndTeamViewModel { Sprints = new List <SprintViewModel>(), memberWorkingDays = new List <MemberWorkingDaysViewModels>() }; model.sprintId = sprintId; model.Team = new TeamViewModel() { Id = team.Id, Owner = team.Owner, TeamName = team.TeamName, TeamMembers = new List <TeamMemberViewModel>() }; teamMembers.ForEach(t => model.Team.TeamMembers.Add(new TeamMemberViewModel() { Id = t.Id, Member = t.Member, MemberId = t.MemberId })); workingDays.ToList().ForEach(t => model.memberWorkingDays.Add(new MemberWorkingDaysViewModels() { Id = t.Id, SprintId = sprintId, MemberId = t.MemberId, WorkingDays = t.WorkingDays })); return(PartialView("_WorkingDaysPartial", model)); }
public async Task <IActionResult> GetAllWorkingDays(int sprintId) { var sprint = await _manageSprintsService.GetSprintAsync(sprintId, true); var workingDays = await _manageMemberWorkingDaysService.GetAllWorkingDaysForSprintAsync(sprintId); var team = await _manageSprintsService.GetTeam(sprint.TeamId); var isOwner = false; if (await _accessCheckService.IsOwnerAsync(team.Id)) { isOwner = true; } var sprintAndTeamViewModel = SprintAndTeamViewModel.Create(sprint, new List <Sprint>(), team, isOwner, workingDays.ToList()); return(PartialView("_WorkingDaysPartial", sprintAndTeamViewModel)); }