public IActionResult ReplyTicket([Bind("id", "Thread")] TicketTread ticketTread) { var orgId = getOrg(); var userId = User.FindFirst(ClaimTypes.NameIdentifier).Value; if (ModelState.IsValid) { var tickthr = new TicketTread() { Id = Guid.NewGuid(), TicketId = ticketTread.Id, Thread = ticketTread.Thread, ResponseType = userId, OrganisationId = orgId, }; _context.Add(tickthr); _context.SaveChangesAsync(); //return RedirectToAction(nameof(Index)); } ModelState.Clear(); return(View(ticketTread)); }
public IActionResult AdminReplyTicket(TicketTread ticketTread) { // var ticketDetails = await _context.Tickets.Include(x => x.Organisation).SingleOrDefaultAsync(i => i.Id == id); if (ticketTread == null) { return(View()); } ticketTread.Id = Guid.NewGuid(); _context.Add(ticketTread); _context.SaveChangesAsync(); return(RedirectToAction("AllTickets")); }
public IActionResult AdminReplyTicket(PostThreads ticketTread) { var orgId = getOrg(); if (ticketTread == null) { return(RedirectToAction("AdminViewTicket", new { id = ticketTread.Id })); } TicketTread tt = new TicketTread(); tt.Id = Guid.NewGuid(); tt.OrganisationId = orgId; tt.ResponseType = "Admin"; tt.TicketId = ticketTread.Id; tt.Thread = ticketTread.Thread; _context.Add(tt); _context.SaveChangesAsync(); return(RedirectToAction("AdminViewTicket", new { id = ticketTread.Id })); }