public static void UpdateBookCategory(Context context, int categoryID, int bookID) { MyListDataSource myListDataSource = new MyListDataSource(context); myListDataSource.open(); myListDataSource.updateCategory(categoryID, bookID); myListDataSource.close(); }
public static void DeleteBook(Context context, int categoryID, int bookID) { MyListDataSource myListDataSource = new MyListDataSource(context); myListDataSource.open(); myListDataSource.deleteMyList(categoryID, bookID); myListDataSource.close(); }
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(); }
public static ArrayList<BookInfo> GetBooks(Context context, int categoryID) { MyListDataSource myListDataSource = new MyListDataSource(context); myListDataSource.open(); ArrayList<MyListInfo> myListInfoList = null; myListInfoList = myListDataSource.getMyList(categoryID); myListDataSource.close(); // for(MyListInfo mylist : myListInfoList) // Log.v("test", "list: " + mylist.getBookID()); BookDataSource bookDataSource = new BookDataSource(context); bookDataSource.open(); ArrayList<BookInfo> bookInfoList = null; bookInfoList = bookDataSource.getMyList(myListInfoList); bookDataSource.close(); return bookInfoList; }