Merge branch 'logicamerga' into LogicaContratos
This commit is contained in:
@@ -146,7 +146,7 @@ public class AdminController: ControllerBase
|
||||
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 10);
|
||||
if (validacion1 == false) return Unauthorized();
|
||||
|
||||
int ret = RepositorioPropiedades.Singleton.CuantasPaginasBusqueda(cantidadHabitaciones, servicios, tipoPropiedad);
|
||||
int ret = RepositorioPropiedades.Singleton.CuantasPaginasBusqueda(cantidadHabitaciones, servicios, tipoPropiedad, 0);
|
||||
return Ok(new { message = ret});
|
||||
}
|
||||
}
|
||||
@@ -24,4 +24,15 @@ public class BusquedaController: ControllerBase {
|
||||
|
||||
return Ok(props);
|
||||
}
|
||||
|
||||
[HttpGet("api/busqueda/cantPag")]
|
||||
public IActionResult GetCantPag([FromHeader(Name = "Auth")]string Auth, int cantidadHabitaciones = 0, int tipoPropiedad = 0, [FromQuery]string servicios = "") {
|
||||
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
||||
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 3);
|
||||
if (validacion1 == false) return Unauthorized();
|
||||
|
||||
int ret = RepositorioPropiedades.Singleton.CuantasPaginasBusqueda(cantidadHabitaciones, servicios, tipoPropiedad, 1);
|
||||
return Ok(new { message = ret});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
import BusquedaPropiedades from "./paginas/BusquedaPropiedades.svelte";
|
||||
import ControlUsuarios from "./paginas/AdminUsuarios.svelte";
|
||||
import ControlPropiedades from "./paginas/AdminPropiedades.svelte";
|
||||
import Notificaciones from "./paginas/Notificaciones.svelte";
|
||||
</script>
|
||||
|
||||
<Router>
|
||||
@@ -90,6 +91,10 @@
|
||||
<ProteRoute componente={FrontInformes}/>
|
||||
</Route>
|
||||
|
||||
<!--Notificaciones-->
|
||||
<Route path="/notificaciones">
|
||||
<ProteRoute componente={Notificaciones}/>
|
||||
</Route>
|
||||
|
||||
|
||||
</Router>
|
||||
|
||||
@@ -63,13 +63,16 @@
|
||||
<img src="/home.svg" alt="Volver al Menú"/>
|
||||
</a>
|
||||
</div>
|
||||
<button class="badge btn btn-outline-primary" onclick={toggleTheme} style="background-color: cadetblue;">
|
||||
<button class="badge btn" onclick={toggleTheme} style="background-color: cadetblue;">
|
||||
{#if theme === "light" }
|
||||
<img src="/toggle-left.svg" alt=""/>
|
||||
{:else}
|
||||
<img src="/toggle-right.svg" alt=""/>
|
||||
{/if}
|
||||
</button>
|
||||
<button class="badge btn btn-info" onclick={()=>navigate("/notificaciones")}>
|
||||
<img src="/bell.svg" alt="">
|
||||
</button>
|
||||
</div>
|
||||
<NavbarToggler on:click={() => (isOpen = !isOpen)} />
|
||||
<Collapse isOpen={isOpen} navbar expand="md">
|
||||
|
||||
7
Front/src/paginas/Notificaciones.svelte
Normal file
7
Front/src/paginas/Notificaciones.svelte
Normal file
@@ -0,0 +1,7 @@
|
||||
<script lang="ts">
|
||||
import NavBarAutocompletable from "../Componentes/NavBarAutocompletable.svelte";
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<NavBarAutocompletable/>
|
||||
@@ -565,7 +565,7 @@ public class RepositorioPropiedades: RepositorioBase<RepositorioPropiedades> {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public int CuantasPaginasBusqueda(int habitaciones, string servicios, int tipoPropiedad) {
|
||||
public int CuantasPaginasBusqueda(int habitaciones, string servicios, int tipoPropiedad, int estado) {
|
||||
int registrosPorPagina = 10;
|
||||
|
||||
var query = Context.Propiedades
|
||||
@@ -578,6 +578,10 @@ public class RepositorioPropiedades: RepositorioBase<RepositorioPropiedades> {
|
||||
query = query.Where(p => p.Canthabitaciones == habitaciones);
|
||||
}
|
||||
|
||||
if (estado > 0){
|
||||
query = query.Where(x=>x.Idestado == estado);
|
||||
}
|
||||
|
||||
if (tipoPropiedad > 0) {
|
||||
query = query.Where(p => p.Idtipropiedad == tipoPropiedad);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user