public void setTestCategoryData() { Category category01 = new Category(1, "레포츠"); Category category02 = new Category(2, "물놀이"); Category category03 = new Category(3, "패키지"); mCategoryList.Add(category01); mCategoryList.Add(category02); mCategoryList.Add(category03); }
private void updateCategoryList() { mCategoryList.Clear(); string query = @"SELECT * FROM category WHERE enable=1"; SQLiteCommand cmd = new SQLiteCommand(query, mConnection); SQLiteDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { Category category = new Category(); category.setId((uint)(dr["id"])); category.setName((string)(dr["name"])); mCategoryList.Add(category); } }