public ActionResult DeleteAttachment(RequestAttachments requestAttachments) { try { var result = _attachments.DeleteAttachmentByAttachmentId(requestAttachments.AttachmentsId); if (result > 0) { TicketHistoryHelper ticketHistoryHelper = new TicketHistoryHelper(); TicketHistory ticketHistory = new TicketHistory { UserId = Convert.ToInt32(_sessionHandler.UserId), Message = ticketHistoryHelper.DeleteTicketAttachment(), ProcessDate = DateTime.Now, TicketId = requestAttachments.TicketId, ActivitiesId = Convert.ToInt16(StatusMain.Activities.DeletedAttachment) }; _ticketHistory.TicketHistory(ticketHistory); return(Json(true, JsonRequestBehavior.AllowGet)); } else { return(Json(false, JsonRequestBehavior.AllowGet)); } } catch (Exception) { throw; } }
// GET: DeleteAttachment public ActionResult Delete(string trackingId, long?ticketId) { if (ticketId != null && !string.IsNullOrEmpty(trackingId)) { _attachments.DeleteAttachmentByAttachmentId(ticketId); return(RedirectToAction("Details", "TicketDetails", new { TrackingId = trackingId })); } else { return(RedirectToAction("Dashboard", "UserDashboard")); } }