Reposfix: correjido gitignore
This commit is contained in:
73
Modelo/RepositorioOrdenDeCompra.cs
Normal file
73
Modelo/RepositorioOrdenDeCompra.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime;
|
||||
using Entidades;
|
||||
|
||||
namespace Modelo
|
||||
{
|
||||
public sealed class RepositorioOrdenDeCompra : RepositorioSingleton<OrdenDeCompra, RepositorioOrdenDeCompra>
|
||||
{
|
||||
override public bool Add(OrdenDeCompra t)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
try
|
||||
{
|
||||
almacen.Add(t);
|
||||
ret = true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
override public bool Mod(OrdenDeCompra t)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
try
|
||||
{
|
||||
var ordenAModificar = almacen.Find(x => x.Id == t.Id);
|
||||
if (ordenAModificar != null)
|
||||
{
|
||||
ordenAModificar = t;
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
override public bool Del(OrdenDeCompra t)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
try
|
||||
{
|
||||
var ordenAEliminar = almacen.Find(x => x.Id == t.Id);
|
||||
if (ordenAEliminar != null)
|
||||
{
|
||||
almacen.Remove(ordenAEliminar);
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public ReadOnlyCollection<DetalleOrdenDeCompra> MostrarDetalles(OrdenDeCompra orden)
|
||||
{
|
||||
return orden.MostrarDetalles();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user