// GET: Venta/Delete/5 public async Task <IActionResult> Delete(string id) { try { if (id == null) { return(NotFound()); } var venta = await ventaRepository.GetById(id); if (venta == null) { return(NotFound()); } ViewBag.CantidadAlarmas = (await productoRepository.GetCantidadAlarmas()).Cantidad; return(View(venta)); } catch (Exception e) { return(StatusCode((int)System.Net.HttpStatusCode.Unauthorized, e.Message)); //return Unauthorized(e.Message); } }