Reposfix: correjido gitignore
This commit is contained in:
75
Modelo/RepositorioPresupuesto.cs
Normal file
75
Modelo/RepositorioPresupuesto.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime;
|
||||
using Entidades;
|
||||
|
||||
namespace Modelo
|
||||
{
|
||||
public sealed class RepositorioPresupuesto : RepositorioSingleton<Presupuesto, RepositorioPresupuesto>
|
||||
{
|
||||
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<DetallePresupuesto> MostrarDetalles(Presupuesto presupuesto)
|
||||
{
|
||||
return presupuesto.MostrarDetalles();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user