예제 #1
0
 public List<ArticleSources> GetAllByArticleID(int ArticleID)
 {
     ArticleSourcesDAC _articleSourcesComponent = new ArticleSourcesDAC();
     IDataReader reader = _articleSourcesComponent.GetAllArticleSources("ArticleID = " + ArticleID).CreateDataReader();
     List<ArticleSources> _articleSourcesList = new List<ArticleSources>();
     while (reader.Read())
     {
         if (_articleSourcesList == null)
             _articleSourcesList = new List<ArticleSources>();
         ArticleSources _articleSources = new ArticleSources();
         if (reader["ArticleSourceID"] != DBNull.Value)
             _articleSources.ArticleSourceID = Convert.ToInt32(reader["ArticleSourceID"]);
         if (reader["SourceID"] != DBNull.Value)
             _articleSources.SourceID = Convert.ToInt32(reader["SourceID"]);
         if (reader["ArticleID"] != DBNull.Value)
             _articleSources.ArticleID = Convert.ToInt32(reader["ArticleID"]);
         _articleSources.NewRecord = false;
         _articleSourcesList.Add(_articleSources);
     } reader.Close();
     return _articleSourcesList;
 }
예제 #2
0
 public ArticleSources GetByID(int _articleSourceID)
 {
     ArticleSourcesDAC _articleSourcesComponent = new ArticleSourcesDAC();
      IDataReader reader = _articleSourcesComponent.GetByIDArticleSources(_articleSourceID);
      ArticleSources _articleSources = null;
      while(reader.Read())
      {
          _articleSources = new ArticleSources();
          if(reader["ArticleSourceID"] != DBNull.Value)
              _articleSources.ArticleSourceID = Convert.ToInt32(reader["ArticleSourceID"]);
          if(reader["SourceID"] != DBNull.Value)
              _articleSources.SourceID = Convert.ToInt32(reader["SourceID"]);
          if(reader["ArticleID"] != DBNull.Value)
              _articleSources.ArticleID = Convert.ToInt32(reader["ArticleID"]);
      _articleSources.NewRecord = false;             }             reader.Close();
      return _articleSources;
 }
예제 #3
0
 public void Delete(int Original_ArticleSourceID)
 {
     ArticleSourcesDAC articlesourcesComponent = new ArticleSourcesDAC();
     articlesourcesComponent.DeleteArticleSources(Original_ArticleSourceID);
 }
예제 #4
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     ArticleSourcesDAC articlesourcescomponent = new ArticleSourcesDAC();
     return articlesourcescomponent.UpdateDataset(dataset);
 }
예제 #5
0
 public bool Update( int SourceID,  int ArticleID,  int Original_ArticleSourceID)
 {
     ArticleSourcesDAC articlesourcesComponent = new ArticleSourcesDAC();
     return articlesourcesComponent.UpdateArticleSources( SourceID,  ArticleID,  Original_ArticleSourceID);
 }
예제 #6
0
 public bool Update(ArticleSources articlesources ,int old_articleSourceID)
 {
     ArticleSourcesDAC articlesourcesComponent = new ArticleSourcesDAC();
     return articlesourcesComponent.UpdateArticleSources( articlesources.SourceID,  articlesources.ArticleID,  old_articleSourceID);
 }
예제 #7
0
        public bool Insert( int SourceID,  int ArticleID)
        {
            ArticleSourcesDAC articlesourcesComponent = new ArticleSourcesDAC();
            int ArticleSourceID = 0;

            return articlesourcesComponent.InsertNewArticleSources( ref ArticleSourceID,  SourceID,  ArticleID);
        }
예제 #8
0
 public bool Insert(ArticleSources articlesources)
 {
     int autonumber = 0;
     ArticleSourcesDAC articlesourcesComponent = new ArticleSourcesDAC();
     bool endedSuccessfuly = articlesourcesComponent.InsertNewArticleSources( ref autonumber,  articlesources.SourceID,  articlesources.ArticleID);
     if(endedSuccessfuly)
     {
         articlesources.ArticleSourceID = autonumber;
     }
     return endedSuccessfuly;
 }