예제 #1
0
 public ActionResult Edit(News news)
 {
     if (ModelState.IsValid)
     {
         var service = new NewService();
         var result  = service.Update(news);
         if (result)
         {
             SetAlert("Cập nhật bài viết thành công!", "success");
             return(RedirectToAction("Index", "NewAdmin"));
         }
         else
         {
             ModelState.AddModelError("", "Cập nhật bài viết thất bại!");
         }
     }
     SetViewBagNew(news.NewCategoryID);
     return(View("Index"));
 }