27 lines
755 B
C#
27 lines
755 B
C#
using Entidades;
|
|
|
|
namespace Modelo;
|
|
|
|
public class RepositorioDefectos: RepositorioBase<RepositorioDefectos> {
|
|
public bool AltaDefecto(Defecto defecto){
|
|
var con = Context;
|
|
defecto.Id = con.Defectos.Any()? con.Defectos.Count()+1 : 1;
|
|
con.Defectos.Add(defecto);
|
|
return Guardar(con);
|
|
}
|
|
|
|
public bool MarcarPago(long iddefecto){
|
|
var con = Context;
|
|
var d = con.Defectos.FirstOrDefault(x=>x.Id == iddefecto);
|
|
if (d == null)return false;
|
|
d.Idestado = 2;
|
|
return Guardar(con);
|
|
}
|
|
|
|
public IQueryable<Defecto> ObtenerDefectosPorIdContrato(long idcontrato){
|
|
var con = Context;
|
|
|
|
var l = con.Defectos.Where(x=>x.Idcontrato == idcontrato);
|
|
return l;
|
|
}
|
|
} |