| | |
| | | String headUrl = jsonObject.getString("head_url"); |
| | | String id = jsonObject.getString("ID"); |
| | | String name = jsonObject.getString("name"); |
| | | Student student =new Student(1001,name,id,2); |
| | | int sex = 2;//默认是女生 |
| | | if (id!=null&&id.length()>=18){ |
| | | sex = Integer.parseInt(id.substring(id.length()-2,id.length()-1)); |
| | | Log.i(TAG,"sex="+sex); |
| | | if ( sex%2==0){ |
| | | Log.i(TAG,"偶数是女生"); |
| | | sex =2; |
| | | }else{ |
| | | sex = 1; |
| | | } |
| | | } |
| | | Student student =new Student(1001,name,id,sex); |
| | | student.setHead_url(headUrl); |
| | | MyLog.i("更新签到人员信息:"+student.toString()); |
| | | WorkRoomDataBase.getWorkRoomDataBase(getApplicationContext()).getstudentDao().insert(student); |