public List<ContentEntity> GetAllView(string ContentEntityType) { ContentEntityDAC _contentEntityComponent = new ContentEntityDAC(); if (string.IsNullOrEmpty(ContentEntityType)) return new List<ContentEntity>(); IDataReader reader = _contentEntityComponent.GetAllContentEntityByType(ContentEntityType).CreateDataReader(); List<ContentEntity> _contentEntityList = new List<ContentEntity>(); while (reader.Read()) { if (_contentEntityList == null) _contentEntityList = new List<ContentEntity>(); ContentEntity _contentEntity = new ContentEntity(); if (reader["ContentEntityId"] != DBNull.Value) _contentEntity.ContentEntityId = Convert.ToInt32(reader["ContentEntityId"]); if (reader["ContentEntityType"] != DBNull.Value) _contentEntity.ContentEntityType = Convert.ToString(reader["ContentEntityType"]); if (reader["RowGuid"] != DBNull.Value) _contentEntity.RowGuid = new Guid(reader["RowGuid"].ToString()); if (reader["ModifiedDate"] != DBNull.Value) _contentEntity.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]); if (reader["Name"] != DBNull.Value) _contentEntity.ContentEntityName = Convert.ToString(reader["Name"]); _contentEntity.NewRecord = false; _contentEntityList.Add(_contentEntity); } reader.Close(); return _contentEntityList; }
public ContentEntity GetByID(int _contentEntityId) { ContentEntityDAC _contentEntityComponent = new ContentEntityDAC(); IDataReader reader = _contentEntityComponent.GetByIDContentEntity(_contentEntityId); ContentEntity _contentEntity = null; while(reader.Read()) { _contentEntity = new ContentEntity(); if(reader["ContentEntityId"] != DBNull.Value) _contentEntity.ContentEntityId = Convert.ToInt32(reader["ContentEntityId"]); if(reader["ContentEntityType"] != DBNull.Value) _contentEntity.ContentEntityType = Convert.ToString(reader["ContentEntityType"]); if(reader["RowGuid"] != DBNull.Value) _contentEntity.RowGuid = new Guid(reader["RowGuid"].ToString()); if(reader["ModifiedDate"] != DBNull.Value) _contentEntity.ModifiedDate = Convert.ToDateTime(reader["ModifiedDate"]); _contentEntity.NewRecord = false; } reader.Close(); return _contentEntity; }
public bool Update(ContentEntity contententity ,int old_contentEntityId) { ContentEntityDAC contententityComponent = new ContentEntityDAC(); return contententityComponent.UpdateContentEntity( contententity.ContentEntityType, contententity.RowGuid, contententity.ModifiedDate, old_contentEntityId); }
public bool Insert(ContentEntity contententity) { int autonumber = 0; ContentEntityDAC contententityComponent = new ContentEntityDAC(); bool endedSuccessfuly = contententityComponent.InsertNewContentEntity( ref autonumber, contententity.ContentEntityType, contententity.RowGuid, contententity.ModifiedDate); if(endedSuccessfuly) { contententity.ContentEntityId = autonumber; } return endedSuccessfuly; }