예제 #1
0
        public ActionResult Edit(TrinhDo trinhDo)
        {
            try
            {
                // TODO: Add update logic here
                if (ModelState.IsValid)
                {
                    var _trinhDoDao = new TrinhDoDao();

                    var res = _trinhDoDao.Update(trinhDo);
                    if (res)
                    {
                        return(RedirectToAction("Index", "TrinhDo"));
                    }
                    else
                    {
                        ModelState.AddModelError("", "Cập nhật lỗi");
                    }
                }

                return(View(trinhDo));
            }
            catch
            {
                return(RedirectToAction("Index", "TrinhDo"));
            }
        }
예제 #2
0
        public ActionResult EditLevel(TrinhDo trinhDo)
        {
            var _daoTrinhDo = new TrinhDoDao();

            var res = _daoTrinhDo.Update(trinhDo);

            return(View());
        }