public ActionResult Edit(SystemSlide systemSlide) { if (systemSlide == null) { SetFailedNotification("Có lỗi xảy ra. Vui lòng thử lại"); return(RedirectToAction("Index")); } if (!ModelState.IsValid) { foreach (var item in ModelState.Values) { foreach (var error in item.Errors) { SetFailedNotification(error.ErrorMessage); } } if (ItemId > 0) { SetPageTitle("Sửa slide"); } else { SetPageTitle("Tạo mới slide"); } return(View(systemSlide)); } if (_systemMenuRepository.SaveSlide(systemSlide)) { SetSuccessNotification("Cập nhật slide thành công"); } else { SetFailedNotification("Đã có lỗi xảy ra. Xin vui lòng thử lại"); } return(RedirectToAction("Index")); }