más cambios ahora funciona el tema de las facturas pero no el emailer
This commit is contained in:
@@ -18,18 +18,17 @@ namespace Controladora
|
||||
repositorioLotes = new(new Context());
|
||||
}
|
||||
|
||||
public string DisminuirStock(ReadOnlyCollection<DetalleFactura> detalleFactura)
|
||||
public string DisminuirStock(Factura factura)
|
||||
{
|
||||
var ret = false;
|
||||
foreach (var detalle in detalleFactura)
|
||||
foreach (var detalle in factura.Detalles)
|
||||
{
|
||||
if (detalle == null) return "El detalle es nulo";
|
||||
if (detalle.Producto.Id < 0) return "Esta mal cargada la Id de producto";
|
||||
var productos = ControladoraProductos.Instance.Listar();
|
||||
if (!productos.Any(x => x.Id == detalle.Producto.Id)) return "No hay Productos con esa id";
|
||||
ret = repositorioLotes.DisminuirStock(detalle);
|
||||
|
||||
}
|
||||
var ret = repositorioLotes.DisminuirStock(factura);
|
||||
repositorioLotes.Guardar();
|
||||
return (ret) ?
|
||||
"Se Descontaron los productos":
|
||||
|
||||
Reference in New Issue
Block a user