コード例 #1
0
        public ActionResult _getListProduct(string Stat02 = "", string Famille = "", int page = 1)
        {
            string arref = Stat02.Replace('_', '/');
            var    sys   = new GestionSys(mb);

            IPagedList <Produit> liste_perso =
                sys.TousAllProductByCat(arref, Famille, page)
                .Where(x => x.QteEnCommande + x.StockDisponible > 0 && x.Prix > 0)
                .ToPagedList(page, 25);
            var user = Security.DeSerialize <Utilisateur>(Session["user"].ToString() != null ? Session["user"].ToString() : null);

            if (user == null)
            {
                return(RedirectToAction("Index", "Home"));
            }
            sys.RemiseToListProduit(liste_perso.ToList(), user);
            ViewBag.Category = arref;

            ViewBag.famille = Famille;
            ViewBag.liste   = liste_perso;

            //ViewBag.count = sys.CountGetAllProductByCat(Stat02, Famille);
            //ViewBag.current = page > 0 ? page : 1;
            return(PartialView());
        }
コード例 #2
0
        public ActionResult Search(string Search, int page = 1)
        {
            String search_propre             = Sanitizer.GetSafeHtmlFragment(Search);
            var    sys                       = new GestionSys(mb);
            IPagedList <Produit> list_search = sys.SearchProduitsByUser(search_propre).Where(x => x.QteEnCommande + x.StockDisponible > 0 && x.Prix > 0)
                                               .ToPagedList(page, 25);
            var user = Security.DeSerialize <Utilisateur>(Session["user"].ToString());

            sys.RemiseToListProduit(list_search.ToList(), user);
            ViewBag.search = search_propre;
            ViewBag.liste  = list_search;

            return(View());
        }