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

    categoryDataSource.createCategory(categoryName);

    categoryDataSource.close();
  }
Esempio n. 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;
  }
Esempio n. 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();
  }
Esempio n. 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();
  }