Example #1
0
 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;
 }