69 lines
1.4 KiB
C#
69 lines
1.4 KiB
C#
using Entidades;
|
|
|
|
namespace Modelo
|
|
{
|
|
public sealed class RepositorioClientes : RepositorioBase<Cliente, RepositorioClientes>
|
|
{
|
|
override public bool Add(Cliente t)
|
|
{
|
|
bool ret = false;
|
|
|
|
try
|
|
{
|
|
almacen.Add(t);
|
|
ret = true;
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
override public bool Mod(Cliente t)
|
|
{
|
|
bool ret = false;
|
|
|
|
|
|
try
|
|
{
|
|
var clienteAModificar = almacen.Find(x => x.Cuit == t.Cuit);
|
|
if (clienteAModificar != null)
|
|
{
|
|
clienteAModificar = t;
|
|
ret = true;
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
|
|
override public bool Del(Cliente t)
|
|
{
|
|
bool ret = false;
|
|
|
|
try
|
|
{
|
|
var clienteAEliminar = almacen.Find(x => x.Cuit == t.Cuit);
|
|
if (clienteAEliminar != null)
|
|
{
|
|
almacen.Remove(clienteAEliminar);
|
|
ret = true;
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
}
|
|
}
|
|
|