cosas que faltaban

This commit is contained in:
2024-08-11 18:23:17 -03:00
parent 08cb7d769f
commit c6ed194e04
77 changed files with 2333 additions and 25531 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);
}
}
}