feat: añadidos mostrar faltantantes
This commit is contained in:
@@ -10,24 +10,24 @@ namespace Entidades
|
||||
public class OrdenDeCompra
|
||||
{
|
||||
public int Id { get; set; }
|
||||
private List<DetalleOrdenDeCompra> productos = new List<DetalleOrdenDeCompra>();
|
||||
private List<DetalleOrdenDeCompra> detalles = new List<DetalleOrdenDeCompra>();
|
||||
public Proveedor Proveedor { get; set; }
|
||||
|
||||
public void AñadirDetalle(DetalleOrdenDeCompra detalle)
|
||||
{
|
||||
productos.Add(detalle);
|
||||
detalles.Add(detalle);
|
||||
}
|
||||
|
||||
public bool EliminarDetalle(DetalleOrdenDeCompra detalle)
|
||||
{
|
||||
var aeliminar = productos.Find(x => x.Id == detalle.Id);
|
||||
var aeliminar = detalles.Find(x => x.Id == detalle.Id);
|
||||
if (aeliminar == null) return false;
|
||||
return productos.Remove(aeliminar);
|
||||
return detalles.Remove(aeliminar);
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<DetalleOrdenDeCompra> MostrarDetalles()
|
||||
{
|
||||
return productos.AsReadOnly();
|
||||
return detalles.AsReadOnly();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,15 @@ namespace Entidades
|
||||
detalles.Add(det);
|
||||
}
|
||||
|
||||
public bool EliminarCategoria(DetallePresupuesto det) {
|
||||
public bool EliminarDetalle(DetallePresupuesto det) {
|
||||
var dAEliminar = detalles.FirstOrDefault(x => x.Id == det.Id);
|
||||
if (dAEliminar == null) return false;
|
||||
return detalles.Remove(dAEliminar);
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<DetallePresupuesto> MostrarDetalles()
|
||||
{
|
||||
return detalles.AsReadOnly();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -24,5 +25,8 @@ namespace Entidades
|
||||
return categorias.Remove(cAEliminar);
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<Categoria> MostrarCategorias(){
|
||||
return categorias.AsReadOnly();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,26 +11,23 @@ namespace Entidades
|
||||
public class Remito
|
||||
{
|
||||
public int Id { get; set; }
|
||||
private List<Lote> LotesDeProductosEntregados { get; set; }
|
||||
private List<Lote> lotesDeProductosEntregados = new List<Lote>();
|
||||
public Proveedor Proveedor { get; set; }
|
||||
|
||||
public ReadOnlyCollection<Lote> MostrarLotes()
|
||||
{
|
||||
return LotesDeProductosEntregados.AsReadOnly();
|
||||
return lotesDeProductosEntregados.AsReadOnly();
|
||||
}
|
||||
public bool AñadirLote(Lote lote)
|
||||
public void AñadirLote(Lote lote)
|
||||
{
|
||||
bool ret = false;
|
||||
try
|
||||
{
|
||||
LotesDeProductosEntregados.Add(lote);
|
||||
ret= true;
|
||||
lotesDeProductosEntregados.Add(lote);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user