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 }));
     }
 }
Example #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     //日志添加
     art.Author  = "个人";
     art.Subject = this.TextBox1.Text;
     art.Content = this.TextBox2.Text;
     art.Count   = 0;
     art.TypeId  = Convert.ToInt32(this.DropDownList1.SelectedValue);
     arcbll.Add(art);
     this.TextBox1.Text = null;
     this.TextBox2.Text = null;
     Response.Write("<script>alert('添加成功!')</script>");
 }