falta interfaz venta

This commit is contained in:
2025-01-24 21:31:37 -03:00
parent f8692ccdf0
commit 2b481e2ae2
13 changed files with 457 additions and 15 deletions

View File

@@ -0,0 +1,26 @@
using Entidades;
using Microsoft.EntityFrameworkCore;
namespace Modelo;
public class RepositorioVentas: RepositorioBase<RepositorioVentas> {
public Contrato? ObtenerVentaPorContrato(long idcontrato) {
var con = Context;
var c = con.Contratos.Include(x=>x.Idcanons).Include(x=>x.IdventaNavigation).ThenInclude(x=>x.IddivisaNavigation)
.FirstOrDefault(x=>x.Id == idcontrato);
if (c == null || c.IdventaNavigation == null) return null;
return c;
}
public bool PatchVenta(Venta venta) {
var con = Context;
var a = con.Ventas.FirstOrDefault(x=>x.Id == venta.Id);
a.IdVendedor = venta.IdVendedor;
a.IdComprador = venta.IdComprador;
a.Idpropiedad = venta.Idpropiedad;
a.Fechainicio = venta.Fechainicio;
a.Idestado=2;
return Guardar(con);
}
}