public JsonResult ChangeStatus(ChangeStatusRequestModel changeStatusRequestModel) { try { var result = _tickets.ChangeTicketStatus(changeStatusRequestModel); if (result) { TicketHistoryHelper ticketHistoryHelper = new TicketHistoryHelper(); TicketHistory ticketHistory = new TicketHistory { UserId = Convert.ToInt32(_sessionHandler.UserId), Message = ticketHistoryHelper.StatusMessage(changeStatusRequestModel.StatusId), ProcessDate = DateTime.Now, TicketId = changeStatusRequestModel.TicketId, StatusId = changeStatusRequestModel.StatusId, ActivitiesId = Convert.ToInt16(StatusMain.Activities.StatusChanged) }; _ticketHistory.TicketHistory(ticketHistory); return(Json(true, JsonRequestBehavior.AllowGet)); } else { return(Json(false, JsonRequestBehavior.AllowGet)); } } catch (Exception) { throw; } }
public JsonResult ProcessChangeAllStatus(string[] ticketlist, short status) { try { foreach (var ticketid in ticketlist) { var changeStatusRequestModel = new ChangeStatusRequestModel { TicketId = Convert.ToInt64(ticketid), StatusId = status }; var result = _iTickets.ChangeTicketStatus(changeStatusRequestModel); } return(Json(new { status = "Success" }, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(Json(new { status = "Fail" })); } }