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; }
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; }
public void DeleteByArticleId(int Original_ArticleId) { ArticleCategoryDAC articlecategoryComponent = new ArticleCategoryDAC(); articlecategoryComponent.DeleteArticleCategoryByArticleId(Original_ArticleId); }
public int UpdateDataset(System.Data.DataSet dataset) { ArticleCategoryDAC articlecategorycomponent = new ArticleCategoryDAC(); return articlecategorycomponent.UpdateDataset(dataset); }
public bool Update( int SiteCategoryId, int ArticleId, DateTime PostDate, int Original_ArticleCategoryId) { ArticleCategoryDAC articlecategoryComponent = new ArticleCategoryDAC(); return articlecategoryComponent.UpdateArticleCategory( SiteCategoryId, ArticleId, PostDate, Original_ArticleCategoryId); }
public bool Update(ArticleCategory articlecategory ,int old_articleCategoryId) { ArticleCategoryDAC articlecategoryComponent = new ArticleCategoryDAC(); return articlecategoryComponent.UpdateArticleCategory( articlecategory.SiteCategoryId, articlecategory.ArticleId, articlecategory.PostDate, old_articleCategoryId); }
public bool Insert( int SiteCategoryId, int ArticleId, DateTime PostDate) { ArticleCategoryDAC articlecategoryComponent = new ArticleCategoryDAC(); int ArticleCategoryId = 0; return articlecategoryComponent.InsertNewArticleCategory( ref ArticleCategoryId, SiteCategoryId, ArticleId, PostDate); }
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; }