Пример #1
0
 public List<ArticleComment> GetAll()
 {
     ArticleCommentDAC _articleCommentComponent = new ArticleCommentDAC();
      IDataReader reader =  _articleCommentComponent.GetAllArticleComment().CreateDataReader();
      List<ArticleComment> _articleCommentList = new List<ArticleComment>();
      while(reader.Read())
      {
      if(_articleCommentList == null)
          _articleCommentList = new List<ArticleComment>();
          ArticleComment _articleComment = new ArticleComment();
          if(reader["ArticleCommentId"] != DBNull.Value)
              _articleComment.ArticleCommentId = Convert.ToInt32(reader["ArticleCommentId"]);
          if(reader["ArticleId"] != DBNull.Value)
              _articleComment.ArticleId = Convert.ToInt32(reader["ArticleId"]);
          if(reader["ArticleComment"] != DBNull.Value)
              _articleComment.ArticleCommentContent = Convert.ToString(reader["ArticleComment"]);
          if(reader["ModifiedDate"] != DBNull.Value)
              _articleComment.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
          if(reader["PersonId"] != DBNull.Value)
              _articleComment.PersonId = Convert.ToInt32(reader["PersonId"]);
          if(reader["CommentStatusId"] != DBNull.Value)
              _articleComment.CommentStatusId = Convert.ToInt32(reader["CommentStatusId"]);
      _articleComment.NewRecord = false;
      _articleCommentList.Add(_articleComment);
      }             reader.Close();
      return _articleCommentList;
 }
Пример #2
0
 public ArticleComment GetByID(int _articleCommentId)
 {
     ArticleCommentDAC _articleCommentComponent = new ArticleCommentDAC();
      IDataReader reader = _articleCommentComponent.GetByIDArticleComment(_articleCommentId);
      ArticleComment _articleComment = null;
      while(reader.Read())
      {
          _articleComment = new ArticleComment();
          if(reader["ArticleCommentId"] != DBNull.Value)
              _articleComment.ArticleCommentId = Convert.ToInt32(reader["ArticleCommentId"]);
          if(reader["ArticleId"] != DBNull.Value)
              _articleComment.ArticleId = Convert.ToInt32(reader["ArticleId"]);
          if(reader["ArticleComment"] != DBNull.Value)
              _articleComment.ArticleCommentContent = Convert.ToString(reader["ArticleComment"]);
          if(reader["ModifiedDate"] != DBNull.Value)
              _articleComment.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]);
          if(reader["PersonId"] != DBNull.Value)
              _articleComment.PersonId = Convert.ToInt32(reader["PersonId"]);
          if(reader["CommentStatusId"] != DBNull.Value)
              _articleComment.CommentStatusId = Convert.ToInt32(reader["CommentStatusId"]);
      _articleComment.NewRecord = false;             }             reader.Close();
      return _articleComment;
 }
Пример #3
0
 public bool Insert(ArticleComment articlecomment)
 {
     int autonumber = 0;
     ArticleCommentDAC articlecommentComponent = new ArticleCommentDAC();
     bool endedSuccessfuly = articlecommentComponent.InsertNewArticleComment(ref autonumber, articlecomment.ArticleId, articlecomment.ArticleCommentContent, articlecomment.ModifiedDate, articlecomment.PersonId, articlecomment.CommentStatusId);
     if(endedSuccessfuly)
     {
         articlecomment.ArticleCommentId = autonumber;
     }
     return endedSuccessfuly;
 }
Пример #4
0
 public void Delete(int Original_ArticleCommentId)
 {
     ArticleCommentDAC articlecommentComponent = new ArticleCommentDAC();
     articlecommentComponent.DeleteArticleComment(Original_ArticleCommentId);
 }
Пример #5
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     ArticleCommentDAC articlecommentcomponent = new ArticleCommentDAC();
     return articlecommentcomponent.UpdateDataset(dataset);
 }
Пример #6
0
 public bool Update(int ArticleId, string ArticleCommentContent, DateTime ModifiedDate, int PersonId, int CommentStatusId, int Original_ArticleCommentId)
 {
     ArticleCommentDAC articlecommentComponent = new ArticleCommentDAC();
     return articlecommentComponent.UpdateArticleComment(ArticleId, ArticleCommentContent, ModifiedDate, PersonId, CommentStatusId, Original_ArticleCommentId);
 }
Пример #7
0
 public bool Update(ArticleComment articlecomment ,int old_articleCommentId)
 {
     ArticleCommentDAC articlecommentComponent = new ArticleCommentDAC();
     return articlecommentComponent.UpdateArticleComment( articlecomment.ArticleId,  articlecomment.ArticleCommentContent,  articlecomment.ModifiedDate,  articlecomment.PersonId,  articlecomment.CommentStatusId,  old_articleCommentId);
 }
Пример #8
0
        public bool Insert(int ArticleId, string ArticleCommentContent, DateTime ModifiedDate, int PersonId, int CommentStatusId)
        {
            ArticleCommentDAC articlecommentComponent = new ArticleCommentDAC();
            int ArticleCommentId = 0;

            return articlecommentComponent.InsertNewArticleComment(ref ArticleCommentId, ArticleId, ArticleCommentContent, ModifiedDate, PersonId, CommentStatusId);
        }