Esempio n. 1
0
 public ActionResult Create(Article collection)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var model = new ArticleModel();
             int res   = model.Create(collection.Title, collection.IDChannel, collection.Image, collection.Content, collection.Author);
             if (res > 0)
             {
                 return(RedirectToAction("Index", "Article"));
             }
         }
         else
         {
             ModelState.AddModelError("", "Them bao khong thanh cong");
         }
         return(View(collection));
     }
     catch
     {
         return(View());
     }
 }