Esempio n. 1
0
        public ActionResult Trier(string tri, string ordre, int pageActuel, string titre, string isbn, string auteur, string sigle, int typeArticle)
        {
            string recherche     = construireRecherche(titre, isbn, auteur, sigle);
            var    totalRows     = OffreBean.GetTotalRows(recherche);
            var    count         = totalRows / 8.0;
            var    pageCount     = (int)Math.Ceiling((decimal)count);
            var    newPageActuel = GererPage("", pageActuel, pageCount);
            int    start         = ((newPageActuel - 1) * 8) + 1;
            int    last          = start + 7;

            ViewBag.PageActuel = newPageActuel;
            ViewBag.ReqRech    = recherche;
            if (typeArticle == 2)
            {
                tri = tri.Replace("l.", "n.");
                return(View("Index", ObtenirListeNotesDeCours(start, last, recherche, tri, ordre)));
            }
            else if (typeArticle == 3)
            {
                tri = tri.Replace("l.Nom", "c.Modele");
                return(View("Index", ObtenirListeCalculatrice(start, last, recherche, tri, ordre)));
            }
            else
            {
                return(View("Index", ObtenirListeLivres(start, last, recherche, tri, ordre)));
            }
        }
Esempio n. 2
0
        public ActionResult Rechercher(string titre, string isbn, string auteur, string sigle, int pageActuel, string tri, string ordre)
        {
            string recherche     = construireRecherche(titre, isbn, auteur, sigle);
            var    totalRows     = OffreBean.GetTotalRows(recherche);
            var    count         = totalRows / 8.0;
            var    pageCount     = (int)Math.Ceiling((decimal)count);
            var    newPageActuel = GererPage("", pageActuel, pageCount);
            int    start         = ((newPageActuel - 1) * 8) + 1;
            int    last          = start + 7;

            ViewBag.PageActuel = 1;
            ViewBag.ReqRech    = recherche;
            return(View("Index", ObtenirListeLivres(start, last, recherche, tri, ordre)));
        }