HAY UN AVANCE

This commit is contained in:
fedpo
2024-08-27 04:36:00 +01:00
parent 670190c44b
commit 2428f615a6
76 changed files with 5786 additions and 496 deletions

View File

@@ -11,22 +11,11 @@ namespace Controladora
{
repositorioClientes = new(new Context());
}
private bool ClienteExiste(long cuit)
{
var cat = repositorioClientes.ObtenerPorId(cuit);
return (cat.Cuit == cuit);
}
public string Añadir(Cliente t)
{
if (t == null) return "El Cliente es nulo, fallo la carga";
// Verificar si el CUIT ya existe en el repositorio
if (ClienteExiste(t.Cuit))
{
return $"El Cliente con el CUIT {t.Cuit} ya existe";
}
try
{
repositorioClientes.Add(t);