bueno parece que termine lo de ventas bruh
This commit is contained in:
@@ -3,6 +3,19 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Modelo;
|
||||
public class RepositorioVentas: RepositorioBase<RepositorioVentas> {
|
||||
public bool EfectuarVenta(long idventa) {
|
||||
var con = Context;
|
||||
var vent = con.Ventas.Include(x=>x.IdpropiedadNavigation).FirstOrDefault(x => x.Id == idventa);
|
||||
if (vent == null||vent.Idestado != 2) return false;
|
||||
|
||||
vent.IdpropiedadNavigation.Dnipropietario = vent.IdComprador;
|
||||
|
||||
vent.IdpropiedadNavigation.Idestado=3;
|
||||
vent.Idestado=3;
|
||||
|
||||
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)
|
||||
@@ -50,4 +63,12 @@ public class RepositorioVentas: RepositorioBase<RepositorioVentas> {
|
||||
|
||||
return Guardar(con);
|
||||
}
|
||||
|
||||
public bool SetUrlRecibo(long id, string nuevoNombreArchivo) {
|
||||
var con = Context;
|
||||
var venta = con.Ventas.FirstOrDefault(x=>x.Id == id);
|
||||
if (venta==null) return false;
|
||||
venta.UrlRecibo = nuevoNombreArchivo;
|
||||
return Guardar(con);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user