public IActionResult Delete(int id)
 {
     try
     {
         service.Delete(id);
     }
     catch (ValidationException e)
     {
         return(BadRequest(new { Exception = e.Message }));
     }
     return(NoContent());
 }
Exemplo n.º 2
0
 public ActionResult DeleteConfirmed([Bind(Include = "ticketId")] int ticketId)
 {
     try
     {
         _service.Delete(ticketId);
         return(new HttpStatusCodeResult(HttpStatusCode.OK));
     }
     catch
     {
         return(new HttpStatusCodeResult(HttpStatusCode.NotModified));
     }
 }
Exemplo n.º 3
0
        public IActionResult Delete(int id)
        {
            var ticket = _tasksService.GetTaskDtoById(id);

            if (ticket == null)
            {
                return(NotFound());
            }
            var ticketName = ticket.Name;

            _tasksService.Delete(id);
            var userIDAsString = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;

            _messageHubService.Clients.User(userIDAsString).GetMessage($"{ticketName} was deleted");
            //_hubContext.Clients.All.GetMessage($"{ticketName} was deleted");

            return(Ok());
        }
Exemplo n.º 4
0
        public IActionResult Delete(int ticketId)
        {
            ticketsService.Delete(ticketId);

            return(Ok());
        }
Exemplo n.º 5
0
 public ActionResult Delete(int id)
 {
     _ticketService.Delete(id);
     return(Json(new { success = true }));
 }
        public IActionResult Delete(int id)
        {
            var response = _ticketsService.Delete(id);

            return(RedirectToAction("Overview", "Ticket"));
        }