/// <summary>
 /// 插入文章明细
 /// </summary>
 /// <param name="artdetail"></param>
 /// <returns></returns>
 public int InsertArticleDetail(ArticleDetail artdetail)
 {
     int rowcount = 0;
     string sqltxt = @"INSERT  INTO qds157425440_db.dbo.ArticleDetail
     ( AID ,
       CategoryID ,
       CategoryName ,
       AContent ,
       Summary ,
       Authorname ,
       ADetailtext
     )
     VALUES  ( @AID ,
       @CategoryID ,
       @CategoryName ,
       @AContent ,
       @Summary ,
       @Authorname ,
       @ADetailtext
     )";
     SqlParameter[] paramter = {
                               new SqlParameter("@AID",artdetail.AID),
                               new SqlParameter("@CategoryID",artdetail.CategoryID),
                               new SqlParameter("@CategoryName",artdetail.CategoryName),
                               new SqlParameter("@AContent",artdetail.AContent),
                               new SqlParameter("@Summary",artdetail.Summary),
                               new SqlParameter("@Authorname",artdetail.Authorname),
                               new SqlParameter("@ADetailtext",artdetail.ADetailtext)
                               };
     rowcount = helper.ExecuteSql(sqltxt, paramter);
     return rowcount;
 }
 /// <summary>
 /// 根据ID查找文章
 /// </summary>
 /// <param name="artid"></param>
 /// <returns></returns>
 public ArticleInfo GetArticleinfoByID(int artid)
 {
     ArticleInfo model = new ArticleInfo();
     string sqltxt = @"SELECT  AID ,
     TitleName ,
     ViceTitleName ,
     AuthorID ,
     AuthorName ,
     PublishTime ,
     Astatus ,
     MainPicURL ,
     PicWidth ,
     PicHeight ,
     Addtime ,
     Updatetime ,
     CategoryID ,
     CategoryName ,
     Tags ,
     Summary ,
     DSummary ,
     ClickCount ,
     IsTop ,
     SourceUrl ,
     AFrom
     FROM    qds157425440_db.dbo.ArticleInfo WITH(NOLOCK)
     WHERE AID=@id AND Astatus=30";
     SqlParameter[] paramter = { new SqlParameter("@id", artid) };
     DataSet ds = helper.Query(sqltxt, paramter);
     if (ds != null && ds.Tables.Count > 0)
     {
         if (ds.Tables[0].Rows.Count > 0)
         {
             model.AID = int.Parse(ds.Tables[0].Rows[0]["AID"].ToString());
             model.TitleName = ds.Tables[0].Rows[0]["TitleName"].ToString();
             model.ViceTitleName = ds.Tables[0].Rows[0]["ViceTitleName"].ToString();
             model.AuthorID = int.Parse(ds.Tables[0].Rows[0]["AuthorID"].ToString());
             model.AuthorName = ds.Tables[0].Rows[0]["AuthorName"].ToString();
             model.PublishTime = DateTime.Parse(ds.Tables[0].Rows[0]["PublishTime"].ToString());
             model.Astatus = int.Parse(ds.Tables[0].Rows[0]["Astatus"].ToString());
             model.MainPicURL = ds.Tables[0].Rows[0]["MainPicURL"].ToString();
             model.PicWidth = int.Parse(ds.Tables[0].Rows[0]["PicWidth"].ToString());
             model.PicHeight = int.Parse(ds.Tables[0].Rows[0]["PicHeight"].ToString());
             model.Addtime = DateTime.Parse(ds.Tables[0].Rows[0]["Addtime"].ToString());
             model.Updatetime = DateTime.Parse(ds.Tables[0].Rows[0]["Updatetime"].ToString());
             model.CategoryID = int.Parse(ds.Tables[0].Rows[0]["CategoryID"].ToString());
             model.CategoryName = ds.Tables[0].Rows[0]["CategoryName"].ToString();
             model.Tags = ds.Tables[0].Rows[0]["Tags"].ToString();
             model.Summary = ds.Tables[0].Rows[0]["Summary"].ToString();
             model.DSummary = ds.Tables[0].Rows[0]["DSummary"].ToString();
             model.ClickCount = int.Parse(ds.Tables[0].Rows[0]["ClickCount"].ToString());
             model.IsTop = int.Parse(ds.Tables[0].Rows[0]["IsTop"].ToString());
             model.SourceUrl = ds.Tables[0].Rows[0]["SourceUrl"].ToString();
             model.AFrom = ds.Tables[0].Rows[0]["AFrom"].ToString();
         }
         else
         { return null; }
     }
     sqltxt = @"SELECT  AID ,
     CategoryID ,
     CategoryName ,
     AContent ,
     Summary ,
     Authorname ,
     ADetailtext
     FROM    qds157425440_db.dbo.ArticleDetail WITH(NOLOCK)
     WHERE AID=@id";
     ds = helper.Query(sqltxt, paramter);
     if (ds != null && ds.Tables.Count > 0)
     {
         if (ds.Tables[0].Rows.Count > 0)
         {
             ArticleDetail details = new ArticleDetail();
             details.AID = int.Parse(ds.Tables[0].Rows[0]["AID"].ToString());
             details.AContent = ds.Tables[0].Rows[0]["AContent"].ToString();
             details.Authorname = ds.Tables[0].Rows[0]["Authorname"].ToString();
             details.CategoryID = int.Parse(ds.Tables[0].Rows[0]["CategoryID"].ToString());
             details.CategoryName = ds.Tables[0].Rows[0]["CategoryName"].ToString();
             details.Summary = ds.Tables[0].Rows[0]["Summary"].ToString();
             details.ADetailtext = ds.Tables[0].Rows[0]["ADetailtext"].ToString();
             model.Details = details;
         }
     }
     return model;
 }