funcionalidad terminada

This commit is contained in:
2025-02-02 20:14:39 -03:00
parent 2a8ba5a9f4
commit e7747455ec
11 changed files with 352 additions and 15 deletions

View File

@@ -46,4 +46,10 @@ public class RepositorioNotificaciones : RepositorioBase<RepositorioNotificacion
bool hay = con.Notificaciones.Where(x=>x.Leido == false && x.Dnicliente == dni).Any();
return hay;
}
public Notificacione? ObtenerNotificacionPorKeys(long dni, DateTime? fecha) {
var con = Context;
var n = con.Notificaciones.FirstOrDefault(x => x.Dnicliente ==dni && x.Fecha == fecha);
return n;
}
}

View File

@@ -617,9 +617,16 @@ public class RepositorioPropiedades: RepositorioBase<RepositorioPropiedades> {
var props = con.Propiedades.Include(x=>x.IdServicios).Include(x=>x.IddivisaNavigation)
.Include(c=>c.IdtipropiedadNavigation)
.Where(x=>x.Idestado ==4).Skip(pag*10).Take(10);
.Where(x=>x.Idestado ==4 && !x.Venta.Any(x=>x.Idestado ==2))
.Skip(pag*10).Take(10);
return props;
}
public int ObtenerPaginasDePropiedadesEnVenta(){
var con = Context;
var props = con.Propiedades.Where(x=>x.Idestado ==4 && !x.Venta.Any(x=>x.Idestado ==2)).Count();
return (int)Math.Ceiling((double)props / 10);
}
public IQueryable<Propiedade> ObtenerPropiedadesAVentaPorDni(long dni) {
var con = Context;

View File

@@ -16,6 +16,15 @@ public class RepositorioVentas: RepositorioBase<RepositorioVentas> {
return Guardar(con);
}
public bool IniciarVenta(Venta v, long dni) {
var con = Context;
v.Id = (con.Ventas.Any()?con.Ventas.Count():0)+1;
con.Ventas.Add(v);
GenerarLog(con, dni, "Alta Venta espera recibo");
return Guardar(con);
}
public Contrato? ObtenerVentaPorContrato(long idcontrato) {
var con = Context;
var c = con.Contratos.Include(x=>x.Idcanons).Include(x=>x.IdventaNavigation).ThenInclude(x=>x.IddivisaNavigation)
@@ -93,7 +102,7 @@ public class RepositorioVentas: RepositorioBase<RepositorioVentas> {
if (cont==null) return false;
if (cont.Idestado != 4) return false;
if (cont.Contratos.Any(x=>x.Habilitado == 1 && x.Cancelado == 0)) return false;
if (cont.Venta.Any(x=>x.Idestado != 3)) return false;
if (cont.Venta.Any(x=>x.Idestado == 2)) return false;
cont.Monto = monto;
cont.Iddivisa = iddivisa;