una cosa más hecha
This commit is contained in:
@@ -11,6 +11,33 @@ public class RepositorioVentas: RepositorioBase<RepositorioVentas> {
|
||||
return c;
|
||||
}
|
||||
|
||||
public Venta? ObtenerVentaPorId(long idventa) {
|
||||
var con = Context;
|
||||
var vent = con.Ventas
|
||||
.Include(x=>x.IddivisaNavigation)
|
||||
.Include(x=>x.IdestadoNavigation)
|
||||
.Include(x=>x.IdVendedorNavigation)
|
||||
.Include(x=>x.IdCompradorNavigation)
|
||||
.Include(x=>x.IdpropiedadNavigation)
|
||||
.Where(x=>x.Idestado != 1)
|
||||
.FirstOrDefault(x=>x.Id == idventa);
|
||||
if (vent == null) return null;
|
||||
return vent;
|
||||
}
|
||||
|
||||
public IQueryable<Venta>? ObtenerVentasPorDni(long dni) {
|
||||
var con = Context;
|
||||
var venta = con.Ventas
|
||||
.Include(x=>x.IddivisaNavigation)
|
||||
.Include(x=>x.IdestadoNavigation)
|
||||
.Include(x=>x.IdVendedorNavigation)
|
||||
.Include(x=>x.IdCompradorNavigation)
|
||||
.Include(x=>x.IdpropiedadNavigation)
|
||||
.Where(x=>(x.IdComprador == dni || x.IdVendedor == dni) && x.Idestado!=1 )
|
||||
.Distinct();
|
||||
return venta;
|
||||
}
|
||||
|
||||
public bool PatchVenta(Venta venta) {
|
||||
var con = Context;
|
||||
var a = con.Ventas.FirstOrDefault(x=>x.Id == venta.Id);
|
||||
|
||||
Reference in New Issue
Block a user