Hecho Irepositorio y borrado codigo viejo de repositorios. Además configuré entity framework
This commit is contained in:
@@ -3,72 +3,10 @@ using Entidades;
|
||||
|
||||
namespace Modelo
|
||||
{
|
||||
public sealed class RepositorioRemito : RepositorioBase<Remito, RepositorioRemito>
|
||||
public sealed class RepositorioRemito : IRepositorio<Remito>
|
||||
{
|
||||
|
||||
override public bool Add(Remito t)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
try
|
||||
{
|
||||
almacen.Add(t);
|
||||
ret = true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
override public bool Mod(Remito t)
|
||||
{
|
||||
|
||||
bool ret = false;
|
||||
|
||||
try
|
||||
{
|
||||
var remitoAModificar = almacen.FindIndex(x => x.Id == t.Id);
|
||||
if (remitoAModificar > -1)
|
||||
{
|
||||
|
||||
almacen[remitoAModificar] = t;
|
||||
ret = true;
|
||||
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
override public bool Del(Remito t)
|
||||
{
|
||||
|
||||
bool ret = false;
|
||||
|
||||
try
|
||||
{
|
||||
var RemitoAEliminar = almacen.Find(x => x.Id == t.Id);
|
||||
if (RemitoAEliminar != null)
|
||||
{
|
||||
almacen.Remove(RemitoAEliminar);
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user