using System.Collections.ObjectModel; using Entidades; namespace Modelo { public sealed class RepositorioPresupuesto : RepositorioBase { override public bool Add(Presupuesto t) { bool ret = false; try { almacen.Add(t); ret = true; } catch (Exception) { throw; } return ret; } override public bool Mod(Presupuesto t) { bool ret = false; try { var presupuestoAModificar = almacen.Find(x => x.Id == t.Id); if (presupuestoAModificar != null) { presupuestoAModificar = t; ret = true; } } catch (Exception) { throw; } return ret; } override public bool Del(Presupuesto t) { bool ret = false; try { var presupuestoAEliminar = almacen.Find(x => x.Id == t.Id); if (presupuestoAEliminar != null) { almacen.Remove(presupuestoAEliminar); ret = true; } } catch (Exception) { throw; } return ret; } public ReadOnlyCollection MostrarDetalles(Presupuesto presupuesto) { return presupuesto.MostrarDetalles(); } } }