Beispiel #1
0
        public ActionResult DeleteAttchmentFormTcket(int id)
        {
            var ticketId = db.Attachments.Find(id).TicketId;

            TicketHelper.DeleteAttchmentFormTcket(id);
            return(RedirectToAction("Detail", new { id = ticketId }));
        }
Beispiel #2
0
 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));
 }