| | |
| | |
|
| | | import cn.com.basic.face.base.BaseApplication;
|
| | | import cn.com.basic.face.base.Config;
|
| | | import cn.com.basic.face.base.MainActivity;
|
| | | import cn.com.basic.face.discern.entity.Dictionary;
|
| | | import cn.com.basic.face.discern.query.item.AttendanceQueryItem;
|
| | |
|
| | |
| | | */
|
| | | public List<Dictionary> loadPostDictionary() {
|
| | | List<Dictionary> list = new ArrayList<Dictionary>();
|
| | | SQLiteDatabase db = Config.sqlMap.getDb();
|
| | | db.beginTransaction();
|
| | |
|
| | | try {
|
| | |
|
| | | String sql = "select a.post_id,a.post_name from post a";
|
| | |
|
| | |
|
| | | Dictionary aqi = null;
|
| | | Cursor c = db.rawQuery(sql, new String[]{});
|
| | |
|
| | | Cursor c = MainActivity.getInstance().db.rawQuery(sql, new String[]{});
|
| | | while (c.moveToNext()) {
|
| | | aqi = new Dictionary();
|
| | | aqi.setDictId(c.getString(c.getColumnIndex("post_id")));
|
| | | aqi.setName(c.getString((c.getColumnIndex("post_name"))));
|
| | | list.add(aqi);
|
| | | }
|
| | | c.close();
|
| | | db.setTransactionSuccessful();
|
| | | }catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }finally {
|
| | | db.endTransaction();
|
| | | }
|
| | | return list;
|
| | | }
|