Exemplo n.º 1
0
 public ActionResult AddAttchmentToTicket(int id, TicketAttachment attchment)
 {
     if (ModelState.IsValid)
     {
         attchment.TicketId = id;
         attchment.Date     = DateTime.Now;
         attchment.UserId   = User.Identity.GetUserId();
         TicketHelper.AddAttchmentToTcket(db, attchment);
         return(RedirectToAction("Detail", "Tickets", new { id }));
     }
     return(View(attchment));
 }
Exemplo n.º 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));
 }