Exemple #1
0
        /// <summary>
        /// get the details of the ticket.
        /// </summary>
        /// <param name="ticketId">ticket id</param>
        /// <returns></returns>
        public TicketDetailViewModel GetTicket(int ticketId)
        {
            var ticket = ticketReadRepository.GetTicket(ticketId);

            if (ticket == null)
            {
                throw new NotFoundException("Helpdesk ticket is not found");
            }

            var ticketModel = ticketDetailMapper.EntityToModel(ticket);

            if (ticket.AssignedTechnicianId.HasValue)
            {
                ticketModel.AssigedTechnician = userReadManager.GetUser(ticket.AssignedTechnicianId.Value);
            }
            if (ticket.ClientId > 0)
            {
                ticketModel.Client = clientReadManager.GetClientDetail(ticket.ClientId);
            }
            return(ticketModel);
        }
        public async Task <IActionResult> GetClientDetail(int clientId)
        {
            var response = await Task.Run(() => clientReadManager.GetClientDetail(clientId));

            return(new OkObjectResult(response));
        }