public ActionResult DeleteAttchmentFormTcket(int id) { var ticketId = db.Attachments.Find(id).TicketId; TicketHelper.DeleteAttchmentFormTcket(id); return(RedirectToAction("Detail", new { id = ticketId })); }
public ActionResult EditAttchment(int id, TicketAttachment attchment) { if (ModelState.IsValid) { var oldA = db.Attachments.Find(id); attchment.TicketId = oldA.TicketId; attchment.Date = DateTime.Now; attchment.UserId = User.Identity.GetUserId(); TicketHelper.DeleteAttchmentFormTcket(id); TicketHelper.AddAttchmentToTcket(db, attchment); return(RedirectToAction("Detail", "Tickets", new { id = attchment.TicketId })); } return(View("AddAttchmentToTicket", attchment)); }