示例#1
0
文件: ItemDB.cs 项目: Reve/EVESharp
        public static List<ItemCategory> LoadItemCategories()
        {
            MySqlDataReader reader = null;

            if (Database.Query(ref reader, "SELECT categoryID, categoryName, description, graphicID, published FROM invCategories") == false)
            {
                return null;
            }

            if (reader == null)
            {
                return null;
            }

            List<ItemCategory> itemCategoryesList = new List<ItemCategory>();

            while (reader.Read())
            {
                ItemCategory itemCategory = new ItemCategory(reader.GetInt32(0),
                    reader.GetString(1),
                    reader.GetString(2),
                    reader.IsDBNull(3) ? 0 : reader.GetInt32(3),
                    reader.GetBoolean(4)
                    );

                itemCategoryesList.Add(itemCategory);
            }

            reader.Close();

            return itemCategoryesList;
        }