This repository has been archived on 2024-08-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Final_OOP/Modelo/RepositorioLote.cs

67 lines
1.3 KiB
C#

using Entidades;
namespace Modelo
{
public sealed class RepositorioLote : RepositorioBase<Lote, RepositorioLote>
{
override public bool Add(Lote t)
{
bool ret = false;
try
{
almacen.Add(t);
ret = true;
}
catch (Exception)
{
throw;
}
return ret;
}
override public bool Mod(Lote t)
{
bool ret = false;
try
{
var loteAModificar = almacen.Find(x => x.Id == t.Id);
if (loteAModificar != null)
{
loteAModificar = t;
ret = true;
}
}
catch (Exception)
{
throw;
}
return ret;
}
override public bool Del(Lote t)
{
bool ret = false;
try
{
var loteAEliminar = almacen.Find(x => x.Id == t.Id);
if (loteAEliminar != null)
{
almacen.Remove(loteAEliminar);
ret = true;
}
}
catch (Exception)
{
throw;
}
return ret;
}
}
}