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