示例#1
0
  public static void addCarnet(Carnet carnet) {
    carnetDao = new CarnetDAO(currentActivity);

    carnetDao.open();
    carnetDao.createCarnet(carnet);
    carnetDao.close();
  }
示例#2
0
  public static void refreshListCarnets() {
    liste_carnets.clear();

    carnetDao = new CarnetDAO(currentActivity);

    carnetDao.open();
    liste_carnets = carnetDao.getAllCarnets();
    carnetDao.close();
  }
示例#3
0
  public static void initData() {

    // CARNETS
    carnetDao = new CarnetDAO(currentActivity);

    carnetDao.open();

    carnetDao.deleteAllCarnets();

    Carnet c1 = new Carnet("Work");
    Carnet c2 = new Carnet("Trololo");
    Carnet c3 = new Carnet("ArtWork");

    carnetDao.createCarnet(c1);
    carnetDao.createCarnet(c2);
    carnetDao.createCarnet(c3);

    carnetDao.close();

    refreshListCarnets();

    /*        //ITEMS
    itemDao = new ItemDAO(currentActivity);

    itemDao.open();

    itemDao.deleteAllItems();

    Item i1 = new Item(5,"item1",false);
    Item i2 = new Item(4,"item2",false);
    Item i3 = new Item(3,"item3",false);
    Item i4 = new Item(2,"item4",false);
    Item i5 = new Item(1,"item5",false);

    itemDao.createItem(i1);
    itemDao.createItem(i2);
    itemDao.createItem(i3);
    itemDao.createItem(i4);
    itemDao.createItem(i5);


    itemDao.close();

    refreshListItems();*/
  }