62,046
社区成员
发帖
与我相关
我的任务
分享
protected void BtnSubmit_Click(object sender, EventArgs e)
{
try
{
if (!string.IsNullOrEmpty(this.TxtContent.Text))
{
myArticle.Insert_Article(this.Hetonghao.Text,this.ArticleTitle.Text,this.ArticleAuthor.Text,this.ArticleContent.Text,Datetime.Now,"");
}
else
{
Common.Msg("对不起,请重新添加!","Admin_AddArticle.aspx");
}
}
catch (Exception ex)
{
Response.Write(" <script>alert('" + ex.Message + "') </script>");
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using DBHelper;
namespace DAL
{
public class DAL_Article
{
public int Insert_Article(string hetonghao,string articleTitle,string articleAuthor,string articleContent,string articlePostTime,string magazineId)
{
string strSQL = "insert into Table_Article(Hetonghao,ArticleTitle,ArticleAuthor,ArticleContent,ArticlePostTime,MagazineId)values('"+
hetonghao+"','"+articleTitle+"','"+articleAuthor+"','"+articleContent+"','"+articlePostTime"','"+magazineId+"')";
return DBHelper.DBHelper.RunSQL(strSQL);
}
}
}
M_Article.Hetonghao = this.Hetonghao.Text;
M_Article.ArticleTitle = this.ArticleTitle.Text;
M_Article.ArticleAuthor = this.ArticleAuthor.Text;
M_Article.ArticleContent = this.ArticleContent.Text;