public ActionResult Edit(long id)
        {
            var dao            = new DanhMucSPDAO();
            var danhmucsanpham = dao.viewDetail(id);

            return(View(danhmucsanpham));
        }
        public ActionResult Index(string SearchDanhMuc, int page = 1, int pagesize = 10)
        {
            var dao   = new DanhMucSPDAO();
            var model = dao.ListAllPaging(SearchDanhMuc, page, pagesize);

            ViewBag.SearchDanhMuc = SearchDanhMuc;
            return(View(model));
        }
        public JsonResult ChangeStatus(long id)
        {
            var result = new DanhMucSPDAO().ChangeStatusDanhMuc(id);

            return(Json(new
            {
                status = result
            }));
        }
Example #4
0
        // GET: CustomOrder
        public ActionResult Index()
        {
            //var customCAT = new CustomDAO();

            //ViewBag.customCAT = customCAT.listAllCustomCategories();
            var danhmucspdao = new DanhMucSPDAO();

            ViewBag.productcategories = danhmucspdao.ListAll();
            return(View());
        }
Example #5
0
        // GET: Home
        public ActionResult Index()
        {
            var sanphamdao   = new SanPhamDAO();
            var danhmucspdao = new DanhMucSPDAO();
            var baivietdao   = new BaiVietDAO();

            ViewBag.newarrivals       = sanphamdao.ListProductNewArrivals(10);
            ViewBag.bestseller        = sanphamdao.ListProductBestSeller(10);
            ViewBag.productcategories = danhmucspdao.ListAll();
            ViewBag.baiviethome       = baivietdao.listHomeContent(3);
            return(View());
        }
Example #6
0
        public ActionResult Custom(int id)
        {
            //var category = new CustomDAO().viewByDanhMuc(id);
            //ViewBag.Category = category;
            //var model = new CustomDAO().ListProductByCategoryID(id);
            //return View(model);
            var category = new DanhMucSPDAO().viewByDanhMuc(id);

            ViewBag.Category = category;
            var model = new SanPhamDAO().ViewOptionByIDdanhmuc(id);

            var product = new SanPhamDAO().ListByCustomActive(id);

            ViewBag.product = product;

            var TenDanhMuc = new SanPhamDAO().getNameoptionByID(id);

            ViewBag.TenDanhMuc = TenDanhMuc;
            return(View(model));
        }
        public ActionResult Category(int id, int page = 1, int pageSize = 9)
        {
            var category = new DanhMucSPDAO().viewByDanhMuc(id);

            ViewBag.Category = category;
            int totalRecord = 0;
            var model       = new SanPhamDAO().ListProductByCategoryID(id, ref totalRecord, page, pageSize);

            ViewBag.Total = totalRecord;
            ViewBag.Page  = page;

            int maxPage   = 10;
            int totalPage = 0;

            totalPage         = (int)Math.Ceiling((double)(totalRecord / pageSize)) + 1;
            ViewBag.TotalPage = totalPage;
            ViewBag.MaxPage   = maxPage;
            ViewBag.First     = 1;
            ViewBag.Last      = totalPage;
            ViewBag.Next      = page + 1;
            ViewBag.Prev      = page - 1;

            return(View(model));
        }
Example #8
0
        public void setViewBag(long?selectedID = null)
        {
            var dao = new DanhMucSPDAO();

            ViewBag.IDdanhmuc = new SelectList(dao.ListAll(), "IDDanhMuc", "sTenDanhMuc", selectedID);
        }
        public PartialViewResult NewArriveMenu()
        {
            var model = new DanhMucSPDAO().ListAll();

            return(PartialView(model));
        }