Exemplo n.º 1
0
        public JsonResult ChangePriority(ChangePriorityRequestModel changePriorityRequestModel)
        {
            try
            {
                var result = _tickets.ChangeTicketPriority(changePriorityRequestModel);
                if (result)
                {
                    TicketHistoryHelper ticketHistoryHelper = new TicketHistoryHelper();

                    TicketHistory ticketHistory = new TicketHistory
                    {
                        UserId       = Convert.ToInt32(_sessionHandler.UserId),
                        Message      = ticketHistoryHelper.PriorityMessage(changePriorityRequestModel.PriorityId),
                        ProcessDate  = DateTime.Now,
                        TicketId     = changePriorityRequestModel.TicketId,
                        PriorityId   = changePriorityRequestModel.PriorityId,
                        ActivitiesId = Convert.ToInt16(StatusMain.Activities.PriorityChanged)
                    };
                    _ticketHistory.TicketHistory(ticketHistory);
                    return(Json(true, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(false, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemplo n.º 2
0
 public JsonResult ProcessChangeAllPriority(string[] ticketlist, short priority)
 {
     try
     {
         foreach (var ticketid in ticketlist)
         {
             var changePriorityRequestModel = new ChangePriorityRequestModel
             {
                 TicketId   = Convert.ToInt64(ticketid),
                 PriorityId = priority
             };
             var result = _iTickets.ChangeTicketPriority(changePriorityRequestModel);
         }
         return(Json(new { status = "Success" }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception)
     {
         return(Json(new { status = "Fail" }));
     }
 }