Ejemplo n.º 1
0
        public ActionResult Update(UpdateModel model)
        {
            if (ModelState.IsValid)
            {
                var dao    = new UpdateStatus();
                int result = dao.Update(model.IDSanPham);
                if (result > 0)
                {
                    return(RedirectToAction("Index", "Home"));
                }
                else
                {
                    ModelState.AddModelError("", "Cập nhật thất bại");
                }
            }

            return(View("Index"));
        }