public IActionResult Index()
        {
            ThucDonViewModel query_thucdon = new ThucDonViewModel(db);

            ViewBag.ListProduct = query_thucdon.GetDataByPage(1, 6);
            LoaiThucDonViewModel query_loaithucdon = new LoaiThucDonViewModel(db);

            ViewBag.ListCate     = query_loaithucdon.GetLoaiThucDon();
            ViewBag.ListDiscount = query_thucdon.GetAllData().Where(x => x.KhuyenMai != 0).Take(4);
            return(View());
        }
示例#2
0
        public IActionResult AddCategory(string tenLoai, string danhMuc)
        {
            LoaiThucDon newCate = new LoaiThucDon
            {
                TenLoai   = tenLoai,
                MaLoaiCha = int.Parse(danhMuc)
            };
            LoaiThucDonViewModel query = new LoaiThucDonViewModel(db);

            query.InsertLoaiThucDon(newCate);
            var response = query.GetLoaiThucDon();

            return(Json(response));
        }
示例#3
0
        public IActionResult Index()
        {
            ThucDonViewModel dsThucDon = new ThucDonViewModel(db);

            //var pageNumber = page ?? 1;
            //var allProduct = dsThucDon.GetAllData();
            //var onePageProduct = allProduct.ToPagedList(pageNumber, 5);
            ViewBag.List = dsThucDon.GetDataWithCateByPage("0", 1);
            LoaiThucDonViewModel dsLoai = new LoaiThucDonViewModel(db);
            var data = dsLoai.GetLoaiThucDon();

            ViewBag.ListCate = data;
            return(View());
        }
示例#4
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());
        }