using System.Collections.ObjectModel; using System.Runtime; using Entidades; namespace Modelo { public sealed class RepositorioPedidoDePresupuesto : RepositorioBase { 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 MostrarDetalles(PedidoDePresupuesto pedido) { return pedido.MostrarDetalles(); } } }