| | |
| | | * 访客注册
|
| | | * @return
|
| | | */
|
| | | public List<CheckInQueryItem> add(Register item) {
|
| | | public long add(Register item) {
|
| | | ContentValues contentValues = new ContentValues();
|
| | | contentValues.put("register_id",item.getRegisterId());
|
| | | contentValues.put("username",item.getUsername());
|
| | |
| | | contentValues.put("gender_id", item.getGenderId());
|
| | | contentValues.put("country_id", item.getCountryId());
|
| | | contentValues.put("province", item.getProvince());
|
| | | contentValues.put("city", item.getCompanyId());
|
| | | contentValues.put("city", item.getCity());
|
| | | contentValues.put("company_id", item.getCompanyId());
|
| | | contentValues.put("company", item.getCompany());
|
| | | contentValues.put("birthday", item.getBirthday());
|
| | | contentValues.put("tel", item.getTel());
|
| | | contentValues.put("mobile_phone", item.getMobilePhone());
|
| | |
| | | contentValues.put("raw_surveillance_photo_height", item.getRawSurveillancePhotoHeight());
|
| | | contentValues.put("create_time", item.getCreateTime());
|
| | | long registerId = MainActivity.getInstance().db.insert("register", "", contentValues);
|
| | | List<CheckInQueryItem> checkInQueryItemList = (List<CheckInQueryItem>)CheckInDao.getInstance().findCheckInLeftListById(registerId).getData();
|
| | | return checkInQueryItemList;
|
| | | return registerId;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | |
|
| | | public boolean hasOfflineVisitorRegisterData() {
|
| | | Cursor c = Config.sqlMap.getDb().rawQuery("select count(*) from register", new String[]{});
|
| | | Cursor c = MainActivity.getInstance().db.rawQuery("select count(*) from register", new String[]{});
|
| | | c.moveToFirst();
|
| | | return c.getInt(0) > 0 ? true : false;
|
| | | }
|
| | |
|
| | | public boolean hasOfflineAttenderRegisterData() {
|
| | | Cursor c = Config.sqlMap.getDb().rawQuery("select count(*) from register", new String[]{});
|
| | | Cursor c = MainActivity.getInstance().db.rawQuery("select count(*) from register", new String[]{});
|
| | | c.moveToFirst();
|
| | | return c.getInt(0) > 0 ? true : false;
|
| | | }
|
| | |
| | | public void removeOfflineVisitorRegister(OfflineVisitorRegisterItem item) {
|
| | | try {
|
| | | String sql = "delete from register where visitor_id='"+item.getRegisterId()+"' AND a.is_synchron = 'N'";
|
| | | SQLiteDatabase db = Config.sqlMap.getDb();
|
| | | db.beginTransaction();
|
| | | SQLiteDatabase db = MainActivity.getInstance().db;
|
| | | db.execSQL(sql);
|
| | | db.endTransaction();
|
| | | item.deleteFiles();
|
| | | }
|
| | | catch (Exception e) {
|