Esempio n. 1
0
 public List<ArticleCategory> GetAllByArticleId(int ArticleId)
 {
     ArticleCategoryDAC _articleCategoryComponent = new ArticleCategoryDAC();
     IDataReader reader = _articleCategoryComponent.GetAllArticleCategory("ArticleId = " + ArticleId).CreateDataReader();
     List<ArticleCategory> _articleCategoryList = new List<ArticleCategory>();
     while (reader.Read())
     {
         if (_articleCategoryList == null)
             _articleCategoryList = new List<ArticleCategory>();
         ArticleCategory _articleCategory = new ArticleCategory();
         if (reader["ArticleCategoryId"] != DBNull.Value)
             _articleCategory.ArticleCategoryId = Convert.ToInt32(reader["ArticleCategoryId"]);
         if (reader["SiteCategoryId"] != DBNull.Value)
             _articleCategory.SiteCategoryId = Convert.ToInt32(reader["SiteCategoryId"]);
         if (reader["ArticleId"] != DBNull.Value)
             _articleCategory.ArticleId = Convert.ToInt32(reader["ArticleId"]);
         if (reader["PostDate"] != DBNull.Value)
             _articleCategory.PostDate = Convert.ToDateTime(reader["PostDate"]);
         _articleCategory.NewRecord = false;
         _articleCategoryList.Add(_articleCategory);
     } reader.Close();
     return _articleCategoryList;
 }
Esempio n. 2
0
 public ArticleCategory GetByID(int _articleCategoryId)
 {
     ArticleCategoryDAC _articleCategoryComponent = new ArticleCategoryDAC();
      IDataReader reader = _articleCategoryComponent.GetByIDArticleCategory(_articleCategoryId);
      ArticleCategory _articleCategory = null;
      while(reader.Read())
      {
          _articleCategory = new ArticleCategory();
          if(reader["ArticleCategoryId"] != DBNull.Value)
              _articleCategory.ArticleCategoryId = Convert.ToInt32(reader["ArticleCategoryId"]);
          if(reader["SiteCategoryId"] != DBNull.Value)
              _articleCategory.SiteCategoryId = Convert.ToInt32(reader["SiteCategoryId"]);
          if(reader["ArticleId"] != DBNull.Value)
              _articleCategory.ArticleId = Convert.ToInt32(reader["ArticleId"]);
          if(reader["PostDate"] != DBNull.Value)
              _articleCategory.PostDate = Convert.ToDateTime(reader["PostDate"]);
      _articleCategory.NewRecord = false;             }             reader.Close();
      return _articleCategory;
 }
Esempio n. 3
0
 public void DeleteByArticleId(int Original_ArticleId)
 {
     ArticleCategoryDAC articlecategoryComponent = new ArticleCategoryDAC();
     articlecategoryComponent.DeleteArticleCategoryByArticleId(Original_ArticleId);
 }
Esempio n. 4
0
 public int UpdateDataset(System.Data.DataSet dataset)
 {
     ArticleCategoryDAC articlecategorycomponent = new ArticleCategoryDAC();
     return articlecategorycomponent.UpdateDataset(dataset);
 }
Esempio n. 5
0
 public bool Update( int SiteCategoryId,  int ArticleId,  DateTime PostDate,  int Original_ArticleCategoryId)
 {
     ArticleCategoryDAC articlecategoryComponent = new ArticleCategoryDAC();
     return articlecategoryComponent.UpdateArticleCategory( SiteCategoryId,  ArticleId,  PostDate,  Original_ArticleCategoryId);
 }
Esempio n. 6
0
 public bool Update(ArticleCategory articlecategory ,int old_articleCategoryId)
 {
     ArticleCategoryDAC articlecategoryComponent = new ArticleCategoryDAC();
     return articlecategoryComponent.UpdateArticleCategory( articlecategory.SiteCategoryId,  articlecategory.ArticleId,  articlecategory.PostDate,  old_articleCategoryId);
 }
Esempio n. 7
0
        public bool Insert( int SiteCategoryId,  int ArticleId,  DateTime PostDate)
        {
            ArticleCategoryDAC articlecategoryComponent = new ArticleCategoryDAC();
            int ArticleCategoryId = 0;

            return articlecategoryComponent.InsertNewArticleCategory( ref ArticleCategoryId,  SiteCategoryId,  ArticleId,  PostDate);
        }
Esempio n. 8
0
 public bool Insert(ArticleCategory articlecategory)
 {
     int autonumber = 0;
     ArticleCategoryDAC articlecategoryComponent = new ArticleCategoryDAC();
     bool endedSuccessfuly = articlecategoryComponent.InsertNewArticleCategory( ref autonumber,  articlecategory.SiteCategoryId,  articlecategory.ArticleId,  articlecategory.PostDate);
     if(endedSuccessfuly)
     {
         articlecategory.ArticleCategoryId = autonumber;
     }
     return endedSuccessfuly;
 }