Exemple #1
0
        public async Task <ActionResult> ApproveTicket(long ticketId, int poolId, string termId)
        {
            try
            {
                repo.ApproveTicket(new TicketInfo
                {
                    TicketId    = ticketId,
                    PoolId      = poolId,
                    TerminalId  = termId,
                    Status      = TicketStatus.Approved,
                    AdminId     = AdminId,
                    ApproveTime = EasternStandardTimeNow
                });

                await SendApproveConfirmEmailAsync(ticketId);
                await SendNotificationApprovedAsync(ticketId);

                return(Json(new { success = true, message = "Ticket approved successfully and confirmation email send." }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, message = ex.Message }, JsonRequestBehavior.AllowGet));
            }
        }