Пример #1
0
 public bool Insert(ArticleViews articleviews)
 {
     int autonumber = 0;
     ArticleViewsDAC articleviewsComponent = new ArticleViewsDAC();
     bool endedSuccessfuly = articleviewsComponent.InsertNewArticleViews( ref autonumber,  articleviews.ArticleID,  articleviews.IPString,  articleviews.DateViewed);
     if(endedSuccessfuly)
     {
         articleviews.ArticleViewID = autonumber;
     }
     return endedSuccessfuly;
 }
Пример #2
0
 public ArticleViews GetByID(int _articleViewID)
 {
     ArticleViewsDAC _articleViewsComponent = new ArticleViewsDAC();
      IDataReader reader = _articleViewsComponent.GetByIDArticleViews(_articleViewID);
      ArticleViews _articleViews = null;
      while(reader.Read())
      {
          _articleViews = new ArticleViews();
          if(reader["ArticleViewID"] != DBNull.Value)
              _articleViews.ArticleViewID = Convert.ToInt32(reader["ArticleViewID"]);
          if(reader["ArticleID"] != DBNull.Value)
              _articleViews.ArticleID = Convert.ToInt32(reader["ArticleID"]);
          if(reader["IPString"] != DBNull.Value)
              _articleViews.IPString = Convert.ToString(reader["IPString"]);
          if(reader["DateViewed"] != DBNull.Value)
              _articleViews.DateViewed = Convert.ToDateTime(reader["DateViewed"]);
      _articleViews.NewRecord = false;             }             reader.Close();
      return _articleViews;
 }
Пример #3
0
 public List<ArticleViews> GetAll()
 {
     ArticleViewsDAC _articleViewsComponent = new ArticleViewsDAC();
      IDataReader reader =  _articleViewsComponent.GetAllArticleViews().CreateDataReader();
      List<ArticleViews> _articleViewsList = new List<ArticleViews>();
      while(reader.Read())
      {
      if(_articleViewsList == null)
          _articleViewsList = new List<ArticleViews>();
          ArticleViews _articleViews = new ArticleViews();
          if(reader["ArticleViewID"] != DBNull.Value)
              _articleViews.ArticleViewID = Convert.ToInt32(reader["ArticleViewID"]);
          if(reader["ArticleID"] != DBNull.Value)
              _articleViews.ArticleID = Convert.ToInt32(reader["ArticleID"]);
          if(reader["IPString"] != DBNull.Value)
              _articleViews.IPString = Convert.ToString(reader["IPString"]);
          if(reader["DateViewed"] != DBNull.Value)
              _articleViews.DateViewed = Convert.ToDateTime(reader["DateViewed"]);
      _articleViews.NewRecord = false;
      _articleViewsList.Add(_articleViews);
      }             reader.Close();
      return _articleViewsList;
 }
Пример #4
0
        public bool Insert( int ArticleID,  string IPString,  DateTime DateViewed)
        {
            ArticleViewsDAC articleviewsComponent = new ArticleViewsDAC();
            int ArticleViewID = 0;

            return articleviewsComponent.InsertNewArticleViews( ref ArticleViewID,  ArticleID,  IPString,  DateViewed);
        }
Пример #5
0
 public void Delete(int Original_ArticleViewID)
 {
     ArticleViewsDAC articleviewsComponent = new ArticleViewsDAC();
     articleviewsComponent.DeleteArticleViews(Original_ArticleViewID);
 }
Пример #6
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     ArticleViewsDAC articleviewscomponent = new ArticleViewsDAC();
     return articleviewscomponent.UpdateDataset(dataset);
 }
Пример #7
0
 public bool Update( int ArticleID,  string IPString,  DateTime DateViewed,  int Original_ArticleViewID)
 {
     ArticleViewsDAC articleviewsComponent = new ArticleViewsDAC();
     return articleviewsComponent.UpdateArticleViews( ArticleID,  IPString,  DateViewed,  Original_ArticleViewID);
 }
Пример #8
0
 public bool Update(ArticleViews articleviews ,int old_articleViewID)
 {
     ArticleViewsDAC articleviewsComponent = new ArticleViewsDAC();
     return articleviewsComponent.UpdateArticleViews( articleviews.ArticleID,  articleviews.IPString,  articleviews.DateViewed,  old_articleViewID);
 }