public ActionResult DeleteConfirmed(int id) { var pedido = _pedidoAPP.GetById(id); _pedidoAPP.Remove(pedido); return(RedirectToAction("Index")); }
public async Task <IActionResult> DeleteConfirmed(Guid id) { _pedidoAppService.Remove(id); if (!IsValidOperation()) { return(View(_pedidoAppService.GetById(id))); } return(RedirectToAction(nameof(Index))); }
public IActionResult DeleteConfirmed(Guid id) { _pedidoAppService.Remove(id); if (!IsValidOperation()) { return(View(_pedidoAppService.GetById(id))); } ViewBag.Sucesso = "Pedido Removido!"; return(RedirectToAction("Index")); }
public IActionResult DeletePedido(long id) { try { _pedidoApp.Remove(id); pusher.TriggerAsync("favo_de_mel", "pedido", new { message = "" }); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public ActionResult DeleteConfirmed(int id) { try { var pedido = _pedidoApp.GetById(id); foreach (var item in pedido.ItensPedido) { _itensPedidoApp.Remove(item); } _pedidoApp.Remove(pedido); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
public async Task <ActionResult> Delete(Guid id) { return(Ok(await clienteAppService.Remove(id))); }