public bool Insert(ArticleStatus articlestatus) { int autonumber = 0; ArticleStatusDAC articlestatusComponent = new ArticleStatusDAC(); bool endedSuccessfuly = articlestatusComponent.InsertNewArticleStatus( ref autonumber, articlestatus.Name, articlestatus.RowGuid, articlestatus.ModifiedDate); if(endedSuccessfuly) { articlestatus.ArticleStatusId = autonumber; } return endedSuccessfuly; }
public ArticleStatus GetByID(int _articleStatusId) { ArticleStatusDAC _articleStatusComponent = new ArticleStatusDAC(); IDataReader reader = _articleStatusComponent.GetByIDArticleStatus(_articleStatusId); ArticleStatus _articleStatus = null; while(reader.Read()) { _articleStatus = new ArticleStatus(); if(reader["ArticleStatusId"] != DBNull.Value) _articleStatus.ArticleStatusId = Convert.ToInt32(reader["ArticleStatusId"]); if(reader["Name"] != DBNull.Value) _articleStatus.Name = Convert.ToString(reader["Name"]); if(reader["RowGuid"] != DBNull.Value) _articleStatus.RowGuid = new Guid(reader["RowGuid"].ToString()); if(reader["ModifiedDate"] != DBNull.Value) _articleStatus.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]); _articleStatus.NewRecord = false; } reader.Close(); return _articleStatus; }
public List<ArticleStatus> GetAll() { ArticleStatusDAC _articleStatusComponent = new ArticleStatusDAC(); IDataReader reader = _articleStatusComponent.GetAllArticleStatus().CreateDataReader(); List<ArticleStatus> _articleStatusList = new List<ArticleStatus>(); while(reader.Read()) { if(_articleStatusList == null) _articleStatusList = new List<ArticleStatus>(); ArticleStatus _articleStatus = new ArticleStatus(); if(reader["ArticleStatusId"] != DBNull.Value) _articleStatus.ArticleStatusId = Convert.ToInt32(reader["ArticleStatusId"]); if(reader["Name"] != DBNull.Value) _articleStatus.Name = Convert.ToString(reader["Name"]); if(reader["RowGuid"] != DBNull.Value) _articleStatus.RowGuid = new Guid(reader["RowGuid"].ToString()); if(reader["ModifiedDate"] != DBNull.Value) _articleStatus.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]); _articleStatus.NewRecord = false; _articleStatusList.Add(_articleStatus); } reader.Close(); return _articleStatusList; }
public bool Update(ArticleStatus articlestatus ,int old_articleStatusId) { ArticleStatusDAC articlestatusComponent = new ArticleStatusDAC(); return articlestatusComponent.UpdateArticleStatus( articlestatus.Name, articlestatus.RowGuid, articlestatus.ModifiedDate, old_articleStatusId); }