Repositorios
This commit is contained in:
@@ -1,73 +0,0 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime;
|
||||
using Entidades;
|
||||
|
||||
namespace Modelo
|
||||
{
|
||||
public sealed class RepositorioPedidoDePresupuesto : RepositorioSingleton<PedidoDePresupuesto, RepositorioPedidoDePresupuesto>
|
||||
{
|
||||
override public bool Add(PedidoDePresupuesto t)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
try
|
||||
{
|
||||
almacen.Add(t);
|
||||
ret = true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
override public bool Mod(PedidoDePresupuesto t)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
try
|
||||
{
|
||||
var pedidoAModificar = almacen.Find(x => x.Id == t.Id);
|
||||
if (pedidoAModificar != null)
|
||||
{
|
||||
pedidoAModificar = t;
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
override public bool Del(PedidoDePresupuesto t)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
try
|
||||
{
|
||||
var pedidoAEliminar = almacen.Find(x => x.Id == t.Id);
|
||||
if (pedidoAEliminar != null)
|
||||
{
|
||||
almacen.Remove(pedidoAEliminar);
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<DetallePedido> MostrarDetalles(PedidoDePresupuesto pedido)
|
||||
{
|
||||
return pedido.MostrarDetalles();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user