public IActionResult PaginarVistaDeptRegistro(int?posicion) { //si no existe posicion mostramos el primer registro if (posicion == null) { posicion = 1; } int ultimaposicion = this.repository.GetNumeroRegistrosVistaDepartamentos(); int siguiente = posicion.Value + 1; //DEBEMOS COMPROBAR QUE NO NOS PASAMOS if (siguiente > ultimaposicion) { siguiente = ultimaposicion; } int anterior = posicion.Value - 1; if (anterior < 1) { anterior = 1; } ViewData["ULTIMO"] = ultimaposicion; ViewData["SIQUIENTE"] = siguiente; ViewData["ANTERIOR"] = anterior; ViewData["POSICION"] = posicion; VistaDept dept = this.repository.GetRegistroDepartamento(posicion.Value); return(View(dept)); }
public IActionResult PaginarVistaDeptRegistro(int?posicion) { //Si no existe posicion, Mostramos el primer registro if (posicion == null) { posicion = 1; } int ultimo = this.repo.GetNumeroRegistrosVistaDepartamentos(); int siguiente = posicion.Value + 1; if (siguiente > ultimo) { siguiente = 1; } int anterior = posicion.Value - 1; if (anterior < 1) { anterior = ultimo; } VistaDept dept = this.repo.GetRegistroDepartamento(posicion.Value); ViewData["ultimo"] = ultimo; ViewData["Siguiente"] = siguiente; ViewData["Anterior"] = anterior; ViewData["Posicion"] = posicion.Value; return(View(dept)); }
public IActionResult PaginarVistaDeptRegistro(int?posicion) { if (posicion == null) { posicion = 1; } int ultimo = this.repo.GetNumRegVistaDepartamentos(); int siguiente = posicion.Value + 1; if (siguiente > ultimo) { siguiente = ultimo; } int anterior = posicion.Value - 1; if (anterior < 1) { anterior = 1; } VistaDept dept = this.repo.GetRegistroDepartamento(posicion.Value); ViewBag.Ultimo = ultimo; ViewBag.Siguiente = siguiente; ViewBag.Anterior = anterior; return(View(dept)); }
public IActionResult PaginarVistaDeptRegistro(int?posicion) { //SI NO EXISTE POSICION, MOSTRAMOS EL PRIMER REGISTRO if (posicion == null) { posicion = 1; } int ultimo = this.repo.GetNumeroRegistrosVistaDepartamento(); int siguiente = posicion.Value + 1; //DEBEMOS COMPROBAR QUE NO NOS PASAMOS... if (siguiente > ultimo) { siguiente = ultimo; } int anterior = posicion.Value - 1; if (anterior < 1) { anterior = 1; } VistaDept dept = this.repo.GetRegistroDepartamento(posicion.Value); ViewData["ULTIMO"] = ultimo; ViewData["SIGUIENTE"] = siguiente; ViewData["ANTERIOR"] = anterior; ViewData["POSICION"] = posicion.Value; return(View(dept)); }
public VistaDept GetRegistroDepartamento(int posicion) { VistaDept vista = this.context.VistaDepartamentos .Where(x => x.Posicion == posicion) .FirstOrDefault(); return(vista); }