public JsonResult DeleteArticle(int id) { try { BLL_Article.Delete(id); return(Json(new { success = true, message = "Delete Successfully" })); } catch (Exception ex) { return(Json(new { success = false, message = ex.Message })); } }
public JsonResult AddArticle(Article article) { try { BLL_Article.Add(article); return(Json(new { success = true, message = "Add Successfully" })); } catch (Exception ex) { return(Json(new { success = false, message = ex.Message })); } }
public JsonResult UpdateArticle(int id, Article article) { try { BLL_Article.Update(id, article); return(Json(new { success = true, message = "Update Successfully" })); } catch (Exception ex) { return(Json(new { success = false, message = ex.Message })); } }
public Article GetArticle(int id) { return(BLL_Article.GetArticle(id)); }
public IActionResult Index() { ViewBag.ListArticle = BLL_Article.GetAll(); return(View()); }