예제 #1
0
        public async Task <ActionResult> UpdateTicket(UpdateTicketModel model)
        {
            var result = await TicketWriter.UpdateTicket(User.Identity.GetUserId(), model);

            await SupportHubContext.Clients.All.TicketUpdated(model.TicketId);

            return(CloseModalSuccess(result.Message));
        }
예제 #2
0
        public async Task <ActionResult> MoveTicket(int ticketId, int queueId)
        {
            var result = await TicketWriter.MoveTicket(User.Identity.GetUserId(), ticketId, queueId);

            await SupportHubContext.Clients.All.TicketUpdated(ticketId);

            return(Json(result));
        }
예제 #3
0
        public async Task <ActionResult> ReopenTicket(int ticketId)
        {
            var result = await TicketWriter.UpdateTicketStatus(User.Identity.GetUserId(), ticketId, SupportTicketStatus.Reopened);

            await SupportHubContext.Clients.All.TicketUpdated(ticketId);

            return(Json(result));
        }
        public async Task <ActionResult> CreateTicket(CreateTicketModel model)
        {
            if (!ModelState.IsValid)
            {
                return(CloseModalError("Error Creating Ticket"));
            }

            var result = await TicketWriter.CreateTicket(model);

            if (result.Success)
            {
                return(CloseModalSuccess(result.Message));
            }

            return(CloseModalError(result.Message));
        }