public ActionResult Create(string trangthai, string showOnTop, News news) { if (ModelState.IsValid) { if (trangthai == "Kích Hoạt") { news.Status = true; } else { news.Status = false; } if (showOnTop == "Có") { news.ShowOnHome = true; } else { news.ShowOnHome = false; } news.CreateDate = DateTime.Now; news.CreateBy = BaseController.NguoiDungHienTai.UserAccount; NewsDAO newsDAO = new NewsDAO(); int thanhcong = newsDAO.AddNews(news); if (thanhcong == 1) { TempData["msg"] = MessageBox.Show("Thêm News Thành Công"); return(RedirectToAction("Create", "News")); } else { ModelState.AddModelError("", NewsDAO.msgerror); } } return(RedirectToAction("Create", "News")); }