public static void CreateCategory(Context context, String categoryName) { CategoryDataSource categoryDataSource = new CategoryDataSource(context); categoryDataSource.open(); categoryDataSource.createCategory(categoryName); categoryDataSource.close(); }
public static ArrayList<CategoryInfo> GetCategories(Context context) { CategoryDataSource categoryDataSource = new CategoryDataSource(context); categoryDataSource.open(); ArrayList<CategoryInfo> categoryInfoList = null; categoryInfoList = categoryDataSource.getAllCategories(); categoryDataSource.close(); return categoryInfoList; }
public static void DeleteWholeCategory(Context context, int categoryID) { MyListDataSource myListDataSource = new MyListDataSource(context); myListDataSource.open(); myListDataSource.deleteCategory(categoryID); myListDataSource.close(); CategoryDataSource categoryDataSource = new CategoryDataSource(context); categoryDataSource.open(); categoryDataSource.deleteCategory(categoryID); categoryDataSource.close(); }
public static void clearDatabase(Context context) { CategoryDataSource categoryDataSource = new CategoryDataSource(context); categoryDataSource.open(); categoryDataSource.clearCategory(); categoryDataSource.close(); MyListDataSource myListDataSource = new MyListDataSource(context); myListDataSource.open(); myListDataSource.clearMyList(); myListDataSource.close(); BookDataSource bookDataSource = new BookDataSource(context); bookDataSource.open(); bookDataSource.clearBook(); bookDataSource.close(); }