Exemple #1
0
        public IActionResult Index()
        {
            BannerViewModal bnQuangCao = new BannerViewModal(db);

            ViewBag.ListBanner = bnQuangCao.GetAllData().Take(3);


            ThucDonViewModel dsThucDon = new ThucDonViewModel(db);

            ViewBag.ListProduct      = dsThucDon.GetAllData().Where(x => x.KhuyenMai == 0).Take(4);
            ViewBag.ListDiscount     = dsThucDon.GetAllData().Where(x => x.KhuyenMai != 0).Take(4);
            ViewBag.ListProductHot   = dsThucDon.GetAllData().OrderByDescending(p => p.LuotMua).Take(4);
            ViewBag.ListProductViews = dsThucDon.GetAllData().OrderByDescending(p => p.LuotXem).Take(4);
            ViewBag.ListProductFULL  = dsThucDon.GetAllData();

            ThuongHieuViewModal dsThuongHieu = new ThuongHieuViewModal(db);

            ViewBag.ThuongHieu = dsThuongHieu.GetThuongHieuThucDon();
            return(View());
        }
Exemple #2
0
        public IActionResult Index()
        {
            ThucDonViewModel query_thucdon = new ThucDonViewModel(db);

            ViewBag.ListProduct = query_thucdon.GetAllData().Take(8);
            LoaiThucDonViewModel query_loaithucdon = new LoaiThucDonViewModel(db);

            ViewBag.ListCate = query_loaithucdon.GetLoaiThucDon();

            ThuongHieuViewModal query_thuonghieuthucdon = new ThuongHieuViewModal(db);

            ViewBag.ListBrand = query_thuonghieuthucdon.GetThuongHieuThucDon();

            NongDoViewModal query_nongdo = new NongDoViewModal(db);

            ViewBag.ListND = query_nongdo.GetNongDoThucDon();

            DungTichViewModal query_dungtich = new DungTichViewModal(db);

            ViewBag.ListDT = query_dungtich.GetDungTichThucDon();

            return(View());
        }