示例#1
0
        public bool Insert(int ArticleId, string Name, int LanguageId, DateTime PostDate)
        {
            ArticleTagDAC articletagComponent = new ArticleTagDAC();
            int           ArticleTagId        = 0;

            return(articletagComponent.InsertNewArticleTag(ref ArticleTagId, ArticleId, Name, LanguageId, PostDate));
        }
示例#2
0
        public ArticleTag GetByID(int _articleTagId)
        {
            ArticleTagDAC _articleTagComponent = new ArticleTagDAC();
            IDataReader   reader      = _articleTagComponent.GetByIDArticleTag(_articleTagId);
            ArticleTag    _articleTag = null;

            while (reader.Read())
            {
                _articleTag = new ArticleTag();
                if (reader["ArticleTagId"] != DBNull.Value)
                {
                    _articleTag.ArticleTagId = Convert.ToInt32(reader["ArticleTagId"]);
                }
                if (reader["ArticleId"] != DBNull.Value)
                {
                    _articleTag.ArticleId = Convert.ToInt32(reader["ArticleId"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _articleTag.Name = Convert.ToString(reader["Name"]);
                }
                if (reader["LanguageId"] != DBNull.Value)
                {
                    _articleTag.LanguageId = Convert.ToInt32(reader["LanguageId"]);
                }
                if (reader["PostDate"] != DBNull.Value)
                {
                    _articleTag.PostDate = Convert.ToDateTime(reader["PostDate"]);
                }
                _articleTag.NewRecord = false;
            }
            reader.Close();
            return(_articleTag);
        }
示例#3
0
        public bool Insert(ArticleTag articletag)
        {
            int           autonumber          = 0;
            ArticleTagDAC articletagComponent = new ArticleTagDAC();
            bool          endedSuccessfuly    = articletagComponent.InsertNewArticleTag(ref autonumber, articletag.ArticleId, articletag.Name, articletag.LanguageId, articletag.PostDate);

            if (endedSuccessfuly)
            {
                articletag.ArticleTagId = autonumber;
            }
            return(endedSuccessfuly);
        }
示例#4
0
        public List <ArticleTag> GetAll()
        {
            ArticleTagDAC     _articleTagComponent = new ArticleTagDAC();
            IDataReader       reader          = _articleTagComponent.GetAllArticleTag().CreateDataReader();
            List <ArticleTag> _articleTagList = new List <ArticleTag>();

            while (reader.Read())
            {
                if (_articleTagList == null)
                {
                    _articleTagList = new List <ArticleTag>();
                }
                ArticleTag _articleTag = new ArticleTag();
                if (reader["ArticleTagId"] != DBNull.Value)
                {
                    _articleTag.ArticleTagId = Convert.ToInt32(reader["ArticleTagId"]);
                }
                if (reader["ArticleId"] != DBNull.Value)
                {
                    _articleTag.ArticleId = Convert.ToInt32(reader["ArticleId"]);
                }
                if (reader["Name"] != DBNull.Value)
                {
                    _articleTag.Name = Convert.ToString(reader["Name"]);
                }
                if (reader["LanguageId"] != DBNull.Value)
                {
                    _articleTag.LanguageId = Convert.ToInt32(reader["LanguageId"]);
                }
                if (reader["PostDate"] != DBNull.Value)
                {
                    _articleTag.PostDate = Convert.ToDateTime(reader["PostDate"]);
                }
                _articleTag.NewRecord = false;
                _articleTagList.Add(_articleTag);
            }
            reader.Close();
            return(_articleTagList);
        }
示例#5
0
        public bool Update(int ArticleId, string Name, int LanguageId, DateTime PostDate, int Original_ArticleTagId)
        {
            ArticleTagDAC articletagComponent = new ArticleTagDAC();

            return(articletagComponent.UpdateArticleTag(ArticleId, Name, LanguageId, PostDate, Original_ArticleTagId));
        }
示例#6
0
        public bool Update(ArticleTag articletag, int old_articleTagId)
        {
            ArticleTagDAC articletagComponent = new ArticleTagDAC();

            return(articletagComponent.UpdateArticleTag(articletag.ArticleId, articletag.Name, articletag.LanguageId, articletag.PostDate, old_articleTagId));
        }
示例#7
0
        public int UpdateDataset(System.Data.DataSet dataset)
        {
            ArticleTagDAC articletagcomponent = new ArticleTagDAC();

            return(articletagcomponent.UpdateDataset(dataset));
        }
示例#8
0
        public void Delete(int Original_ArticleTagId)
        {
            ArticleTagDAC articletagComponent = new ArticleTagDAC();

            articletagComponent.DeleteArticleTag(Original_ArticleTagId);
        }