cosas que faltaban

This commit is contained in:
2024-08-03 21:09:08 +01:00
parent aa3a281092
commit c493033009
83 changed files with 2217 additions and 39603 deletions

View File

@@ -6,19 +6,20 @@ namespace Modelo
{
override public bool Add(Proveedor t)
{
bool ret = false;
if (ExistePorCuit(t.Cuit))
{
throw new InvalidOperationException($"El Proveedor con el CUIT {t.Cuit} ya existe.");
}
try
{
almacen.Add(t);
ret = true;
return true;
}
catch (Exception)
{
throw;
}
return ret;
}
override public bool Mod(Proveedor t)
@@ -45,7 +46,7 @@ namespace Modelo
override public bool Del(Proveedor t)
{
bool ret = false;
try
{
var proveedorAEliminar = almacen.Find(x => x.Cuit == t.Cuit);
@@ -62,5 +63,10 @@ namespace Modelo
return ret;
}
public bool ExistePorCuit(long cuit)
{
return almacen.Any(p => p.Cuit == cuit);
}
}
}