예제 #1
0
 public List<ContentModuleArticle> GetAllByHomePageID(int HomePageID)
 {
     ContentModuleArticleDAC _contentModuleArticleComponent = new ContentModuleArticleDAC();
     IDataReader reader = _contentModuleArticleComponent.GetAllContentModuleArticle("HomePageID = " + HomePageID).CreateDataReader();
     List<ContentModuleArticle> _contentModuleArticleList = new List<ContentModuleArticle>();
     while (reader.Read())
     {
         if (_contentModuleArticleList == null)
             _contentModuleArticleList = new List<ContentModuleArticle>();
         ContentModuleArticle _contentModuleArticle = new ContentModuleArticle();
         if (reader["ContentModuleArticleID"] != DBNull.Value)
             _contentModuleArticle.ContentModuleArticleID = Convert.ToInt32(reader["ContentModuleArticleID"]);
         if (reader["HomePageID"] != DBNull.Value)
             _contentModuleArticle.HomePageID = Convert.ToInt32(reader["HomePageID"]);
         if (reader["ArticleID"] != DBNull.Value)
             _contentModuleArticle.ArticleID = Convert.ToInt32(reader["ArticleID"]);
         if (reader["ArticleOrder"] != DBNull.Value)
             _contentModuleArticle.ArticleOrder = Convert.ToInt32(reader["ArticleOrder"]);
         if (reader["ArticleName"] != DBNull.Value)
             _contentModuleArticle.ArticleName = Convert.ToString(reader["ArticleName"]);
         _contentModuleArticle.NewRecord = false;
         _contentModuleArticleList.Add(_contentModuleArticle);
     } reader.Close();
     return _contentModuleArticleList;
 }
예제 #2
0
 public bool Insert(ContentModuleArticle contentmodulearticle)
 {
     int autonumber = 0;
     ContentModuleArticleDAC contentmodulearticleComponent = new ContentModuleArticleDAC();
     bool endedSuccessfuly = contentmodulearticleComponent.InsertNewContentModuleArticle( ref autonumber,  contentmodulearticle.HomePageID,  contentmodulearticle.ArticleID,  contentmodulearticle.ArticleOrder);
     if(endedSuccessfuly)
     {
         contentmodulearticle.ContentModuleArticleID = autonumber;
     }
     return endedSuccessfuly;
 }
예제 #3
0
 public bool Update(ContentModuleArticle contentmodulearticle ,int old_contentModuleArticleID)
 {
     ContentModuleArticleDAC contentmodulearticleComponent = new ContentModuleArticleDAC();
     return contentmodulearticleComponent.UpdateContentModuleArticle( contentmodulearticle.HomePageID,  contentmodulearticle.ArticleID,  contentmodulearticle.ArticleOrder,  old_contentModuleArticleID);
 }
예제 #4
0
 public ContentModuleArticle GetByID(int _contentModuleArticleID)
 {
     ContentModuleArticleDAC _contentModuleArticleComponent = new ContentModuleArticleDAC();
      IDataReader reader = _contentModuleArticleComponent.GetByIDContentModuleArticle(_contentModuleArticleID);
      ContentModuleArticle _contentModuleArticle = null;
      while(reader.Read())
      {
          _contentModuleArticle = new ContentModuleArticle();
          if(reader["ContentModuleArticleID"] != DBNull.Value)
              _contentModuleArticle.ContentModuleArticleID = Convert.ToInt32(reader["ContentModuleArticleID"]);
          if(reader["HomePageID"] != DBNull.Value)
              _contentModuleArticle.HomePageID = Convert.ToInt32(reader["HomePageID"]);
          if(reader["ArticleID"] != DBNull.Value)
              _contentModuleArticle.ArticleID = Convert.ToInt32(reader["ArticleID"]);
          if(reader["ArticleOrder"] != DBNull.Value)
              _contentModuleArticle.ArticleOrder = Convert.ToInt32(reader["ArticleOrder"]);
      _contentModuleArticle.NewRecord = false;             }             reader.Close();
      return _contentModuleArticle;
 }