コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            var pedido = _pedidoAPP.GetById(id);

            _pedidoAPP.Remove(pedido);

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public async Task <IActionResult> DeleteConfirmed(Guid id)
        {
            _pedidoAppService.Remove(id);

            if (!IsValidOperation())
            {
                return(View(_pedidoAppService.GetById(id)));
            }
            return(RedirectToAction(nameof(Index)));
        }
コード例 #3
0
        public IActionResult DeleteConfirmed(Guid id)
        {
            _pedidoAppService.Remove(id);

            if (!IsValidOperation())
            {
                return(View(_pedidoAppService.GetById(id)));
            }

            ViewBag.Sucesso = "Pedido Removido!";
            return(RedirectToAction("Index"));
        }
コード例 #4
0
 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));
     }
 }
コード例 #5
0
        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());
            }
        }
コード例 #6
0
 public async Task <ActionResult> Delete(Guid id)
 {
     return(Ok(await clienteAppService.Remove(id)));
 }