tuki testeaduki y andanduki
This commit is contained in:
@@ -111,7 +111,7 @@ public class RepositorioContratos: RepositorioBase<RepositorioContratos> {
|
||||
var con = Context;
|
||||
Contrato? cont = con.Contratos
|
||||
.Include(x=>x.Idcanons)
|
||||
.Include(x=>x.Idpropiedad)
|
||||
.Include(x=>x.IdpropiedadNavigation)
|
||||
.FirstOrDefault(x=>x.Id ==idcontrato &&
|
||||
x.Habilitado ==0 &&
|
||||
x.Cancelado == 0);
|
||||
@@ -125,10 +125,12 @@ public class RepositorioContratos: RepositorioBase<RepositorioContratos> {
|
||||
Canon can = new Canon{
|
||||
Fecha = fecha.AddMonths(i),
|
||||
Monto = cont.IdpropiedadNavigation.Monto,
|
||||
Pagado = 0
|
||||
Pagado = 0,
|
||||
};
|
||||
can.Id = (con.Canons.Any()? con.Canons.Max(x=>x.Id) :0)+1;
|
||||
can.Idcontratos.Add(cont);
|
||||
|
||||
con.Canons.Add(can);
|
||||
cont.Idcanons.Add(can);
|
||||
}
|
||||
return Guardar(con);
|
||||
@@ -136,7 +138,7 @@ public class RepositorioContratos: RepositorioBase<RepositorioContratos> {
|
||||
|
||||
public bool CancelarPrecontrato(long idcontrato) {
|
||||
var con = Context;
|
||||
Contrato? cont = con.Contratos.Include(x=>x.Idpropiedad).FirstOrDefault(x=>x.Id ==idcontrato && x.Habilitado ==0);
|
||||
Contrato? cont = con.Contratos.Include(x=>x.IdpropiedadNavigation).FirstOrDefault(x=>x.Id ==idcontrato && x.Habilitado ==0);
|
||||
if (cont == null|| cont.IdpropiedadNavigation==null) return false;
|
||||
cont.Cancelado = 1;
|
||||
cont.IdpropiedadNavigation.Idestado = 1;
|
||||
|
||||
Reference in New Issue
Block a user