80 lines
1.6 KiB
C#
80 lines
1.6 KiB
C#
using System.Collections.ObjectModel;
|
|
using Entidades;
|
|
|
|
namespace Modelo
|
|
{
|
|
public sealed class RepositorioRemito : RepositorioBase<Remito, RepositorioRemito>
|
|
{
|
|
|
|
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;
|
|
}
|
|
|
|
|
|
public ReadOnlyCollection<Lote> MostrarLotes(Remito remito)
|
|
{
|
|
return remito.MostrarLotes();
|
|
}
|
|
}
|
|
}
|