Exemplo n.º 1
0
        //
        // GET: /Home/
        public ActionResult Index()
        {
            ProductsDAO dao   = new ProductsDAO();
            var         lstSP = dao.GetAllSP();

            this.ViewBag.lstSP = lstSP;
            return(View());
        }
Exemplo n.º 2
0
        //
        // GET: /Home/
        public ActionResult Index(int?page)
        {
            ProductsDAO dao        = new ProductsDAO();
            int         pageSize   = 8;
            int         pageNumber = (page ?? 1);
            var         lstSP      = dao.GetAllSP();

            this.ViewBag.lstSP = lstSP;
            return(View(lstSP.Where(p => p.Sales == 1).ToPagedList(pageNumber, pageSize)));
        }
        //
        // GET: /Admin/Product/
        public ActionResult Index()
        {
            ProductsDAO dao   = new ProductsDAO();
            var         lstSP = dao.GetAllSP();

            this.ViewBag.lstSP = lstSP;
            if (Session["User"] != null)
            {
                Account ac = (Account)Session["User"];
                if (ac.UserName == "admin")
                {
                    return(View());
                }
            }
            return(RedirectToAction("../../Home/LogIn"));
        }