public async Task <IActionResult> TicketDetail([FromQuery] long id)
        {
            var ticket = _ticketService.GetTicket(id);
            var model  = new TicketDetailViewModel();

            if (ticket != null)
            {
                model.copyValsFrom(ticket);
            }
            model.AssignableUsers = (await _projectRolesService.GetUsersWithProjectRoleForProject(model.Project.Name)).projectUser.Where(ll => ll.Role > eProjectRoles.Reporter).ToList();

            if (User.Identity.IsAuthenticated && ticket.Id > 0)
            {
                await _ticketService.MarkTicketAsSeen(id, User.Identity.Name);
            }
            return(View(model));
        }
Example #2
0
        public async Task <IActionResult> UserRoleByProjectGet([FromRoute] string projectName)
        {
            var keyAuthResult = await _authService.AuthByApiKey();

            if (keyAuthResult.User == null)
            {
                return(BadRequest(ErrorResponse.GetErrorList(keyAuthResult.ErrorText)));
            }

            var userRoles = await _projectRoleService.GetUsersWithProjectRoleForProject(projectName);

            var response = _mapper.Map <List <UserRoleResponse> >(userRoles.projectUser);

            return(Ok(response));
        }
Example #3
0
        public async Task <IActionResult> ProjectDetail(long id)
        {
            var project = _ticketService.GetProject(id);

            if (project == null)
            {
                return(RedirectToAction("Projects"));
            }
            var projectSummary = _ticketService.GetProjectSummary(id);

            var ticketsClosed = projectSummary != null ? projectSummary.TicketsTotal - projectSummary.TicketsOpen : 0;
            var ticketsOpen   = projectSummary != null ? projectSummary.TicketsOpen : 0;

            ProjectDetaiViewModel model = new ProjectDetaiViewModel()
            {
                Project = project.Name, Id = id, Description = project.Description, CreatedTs = project.CreateTs, TicketsClosed = ticketsClosed, TicketsOpen = ticketsOpen
            };
            var users = await _projectRolesService.GetUsersWithProjectRoleForProject(project.Name);

            model.ProjectUser = users.projectUser.ToList();
            model.OtherUser   = users.otherUser.ToList();
            return(View(model));
        }