int IArticle.Insert(ArticleInfo article)
{
//如果对象存在
if (article.ID != -1)
return -1;
else
article.ID = TableHelper.GetSequence(SQLHelper.ConnectionString, "Article", "ID");
//统计执行成功的数量
int successCount = 0;
string SQL_THIS = SQL_INSERT_ARTICLE;
SqlParameter[] paras = GetParas();
paras[0].Value = article.ID;
paras[1].Value = article.Title;
paras[2].Value = article.DateAdded;
paras[3].Value = article.Text;
paras[4].Value = article.SourceUrl;
paras[5].Value = article.PostType;
paras[6].Value = article.Author;
paras[7].Value = article.Email;
paras[8].Value = article.SourceName;
paras[9].Value = article.BlogID;
paras[10].Value = article.CategoryID;
paras[11].Value = article.Summary;
paras[12].Value = article.IsBySummary;
paras[13].Value = article.DateUpdated;
paras[14].Value = article.TitleUrl;
paras[15].Value = article.FeedBackCount;
paras[16].Value = article.PostConfig;
paras[17].Value = article.EntryName;
paras[18].Value = article.KeyWord;
SqlConnection conn = new SqlConnection(SQLHelper.ConnectionString);
successCount = SQLHelper.ExecuteNonQuery(conn, CommandType.Text, SQL_THIS, paras);
return successCount;
}