Example #1
0
  public static void CreateCategory(Context context, String categoryName) {
    CategoryDataSource categoryDataSource = new CategoryDataSource(context);
    categoryDataSource.open();

    categoryDataSource.createCategory(categoryName);

    categoryDataSource.close();
  }
Example #2
0
  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;
  }
Example #3
0
  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();
  }
Example #4
0
  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();
  }