コード例 #1
0
 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 }));
     }
 }
コード例 #2
0
 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 }));
     }
 }
コード例 #3
0
 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 }));
     }
 }
コード例 #4
0
 public Article GetArticle(int id)
 {
     return(BLL_Article.GetArticle(id));
 }
コード例 #5
0
 public IActionResult Index()
 {
     ViewBag.ListArticle = BLL_Article.GetAll();
     return(View());
 }