Example #1
0
 private void MsgUserBook(String UserBook) throws JSONException, DbException {
   JSONArray array = new JSONArray(UserBook);
   DbManager.DaoConfig daoConfig = MsgDb.getDaoConfig();
   DbManager db = x.getDb(daoConfig);
   db.delete(UserBook.class);
   for (int i = 0; i < array.length(); i++) {
     JSONObject object = (JSONObject) array.get(i);
     UserBook userbook = new UserBook();
     userbook.setId(i);
     userbook.setF_POSITIONNAME(object.getString("F_POSITIONNAME"));
     userbook.setF_CALLPHONETYPE(object.getInt("F_CALLPHONETYPE"));
     userbook.setF_USERID(object.getString("F_USERID"));
     userbook.setF_CALLPHONE(object.getString("F_CALLPHONE"));
     userbook.setF_USERNAME(object.getString("F_USERNAME"));
     userbook.setF_DEPARTMENTNAME(object.getString("F_DEPARTMENTNAME"));
     db.save(userbook);
     listuserbook.add(userbook);
   }
 }