falta que se actualize numProducto y los infomes
This commit is contained in:
@@ -11,15 +11,18 @@ namespace Controladora
|
||||
return RepositorioRemito.Instance.Listar();
|
||||
}
|
||||
|
||||
public string Añadir(Remito t)
|
||||
public string Añadir(Remito t, OrdenDeCompra orden )
|
||||
{
|
||||
if (t == null) return "El Remito es nulo fallo la carga";
|
||||
if (t.Id < 0) return "El id Esta Mal Cargado";
|
||||
|
||||
var retMarcarOrdenEntregada = RepositorioOrdenDeCompra.Instance.MarcarEntregado(orden);
|
||||
if (retMarcarOrdenEntregada == false) return "La orden Esta Mal Cargada";
|
||||
var retRemito = RepositorioRemito.Instance.Add(t);
|
||||
if (retRemito == false) return "El Remito Esta Mal Cargado";
|
||||
var retLotes = RepositorioLote.Instance.Add(t);
|
||||
|
||||
return (!retLotes) ?
|
||||
return (retLotes) ?
|
||||
$"El remito {t.Id} se cargo correctamente":
|
||||
$"Fallo la carga del remito {t.Id}";
|
||||
|
||||
@@ -40,6 +43,42 @@ namespace Controladora
|
||||
$"Fallo la Eliminacion del remito {t.Id}";
|
||||
*/
|
||||
}
|
||||
|
||||
public object ListarLotes()
|
||||
{
|
||||
return RepositorioLote.Instance.Listar().Where(x => x.Habilitado == true)
|
||||
.ToList().AsReadOnly();
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<OrdenDeCompra> ListarOrdenesSinEntregar()
|
||||
{
|
||||
return RepositorioOrdenDeCompra.Instance.Listar()
|
||||
.Where(x => x.Entregado == false)
|
||||
.ToList()
|
||||
.AsReadOnly();
|
||||
}
|
||||
public object ListarDetallesOrdenesDeCompra(OrdenDeCompra orden)
|
||||
{
|
||||
var ordenalistar = RepositorioOrdenDeCompra.Instance.Listar().First(x => x.Id == orden.Id);
|
||||
if (ordenalistar == null) return new ReadOnlyCollection<DetalleOrdenDeCompra>(new List<DetalleOrdenDeCompra>());
|
||||
return ordenalistar.MostrarDetalles();
|
||||
|
||||
}
|
||||
|
||||
public OrdenDeCompra? MostrarOrdenDeCompraPorId(OrdenDeCompra ordenDeCompra)
|
||||
{
|
||||
if (ordenDeCompra == null) return null;
|
||||
if (ordenDeCompra.Id < 0) return null;
|
||||
return RepositorioOrdenDeCompra.Instance.Listar().First(x => x.Id == ordenDeCompra.Id);
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<Lote> ListarLotesPorRemito(Remito rem)
|
||||
{
|
||||
var remalistar = RepositorioRemito.Instance.Listar().First(x => x.Id == rem.Id);
|
||||
if (remalistar == null) return new ReadOnlyCollection<Lote>(new List<Lote>());
|
||||
return remalistar.MostrarLotes();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user