コード例 #1
0
        public ActionResult Edit(int id)
        {
            SetProduct();
            var dao = new ProductImgDao().GetById(id);

            return(View(dao));
        }
コード例 #2
0
        // GET: Admin/ProductImg
        public ActionResult Index(int page = 1, int pageSize = 10)
        {
            var dao   = new ProductImgDao();
            var model = dao.ListAllPagding(page, pageSize);

            return(View(model));
        }
コード例 #3
0
        public ActionResult Edit(ProductImage proImg)
        {
            var  dao    = new ProductImgDao();
            bool result = dao.UpdateProductImg(proImg);

            if (result)
            {
                return(RedirectToAction("Index", "ProductImg"));
            }
            else
            {
                ModelState.AddModelError("", "Khong them duoc anh cua san pham");
            }
            return(View("Index", "Home"));
        }
コード例 #4
0
        public ActionResult Create(ProductImage proImg)
        {
            var dao = new ProductImgDao();
            int id  = dao.InsertProductImg(proImg);

            if (id > 0)
            {
                return(RedirectToAction("Index", "ProductImg"));
            }
            else
            {
                ModelState.AddModelError("", "Khong them anh san pham duoc");
            }
            return(View("Index", "Home"));
        }