Exemple #1
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here
                MonThiDao dao = new MonThiDao();

                var ketqua = dao.XoaMOnThi(id);
                if (ketqua)
                {
                    return(RedirectToAction("Index"));
                }
                else
                {
                    ModelState.AddModelError("", "Loi error");
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex);
            }
            return(View("Index"));
        }