|
@@ -33,60 +33,62 @@ import okhttp3.Response;
|
|
|
|
|
|
public class StudentInfoActivity extends TitleBarActivity {
|
|
|
|
|
|
+
|
|
|
@Bind(R.id.tv_title)
|
|
|
TextView tvTitle;
|
|
|
@Bind(R.id.view_title)
|
|
|
RelativeLayout viewTitle;
|
|
|
- @Bind(R.id.tv_username)
|
|
|
- EditText tvUsername;
|
|
|
- @Bind(R.id.tv_birthday)
|
|
|
- EditText tvBirthday;
|
|
|
- @Bind(R.id.tv_sex)
|
|
|
- EditText tvSex;
|
|
|
- @Bind(R.id.tv_nation)
|
|
|
- EditText tvNation;
|
|
|
- @Bind(R.id.tv_native_place)
|
|
|
- EditText tvNativePlace;
|
|
|
- @Bind(R.id.tv_residenceType)
|
|
|
- EditText tvResidenceType;
|
|
|
- @Bind(R.id.tv_height)
|
|
|
- EditText tvHeight;
|
|
|
- @Bind(R.id.tv_weight)
|
|
|
- EditText tvWeight;
|
|
|
- @Bind(R.id.tv_bloodType)
|
|
|
- EditText tvBloodType;
|
|
|
- @Bind(R.id.tv_physicalExamination)
|
|
|
- EditText tvPhysicalExamination;
|
|
|
- @Bind(R.id.tv_idcode)
|
|
|
- EditText tvIdcode;
|
|
|
- @Bind(R.id.tv_livingAddress)
|
|
|
- EditText tvLivingAddress;
|
|
|
- @Bind(R.id.textView)
|
|
|
- TextView textView;
|
|
|
- @Bind(R.id.edit_contactAddress)
|
|
|
- EditText editContactAddress;
|
|
|
- @Bind(R.id.tv_zipCode)
|
|
|
- EditText tvZipCode;
|
|
|
- @Bind(R.id.tv_preSchoolEducation)
|
|
|
- EditText tvPreSchoolEducation;
|
|
|
- @Bind(R.id.tv_hobby)
|
|
|
- EditText tvHobby;
|
|
|
- @Bind(R.id.ll_member_family)
|
|
|
- LinearLayout llMemberFamily;
|
|
|
- @Bind(R.id.gv_images)
|
|
|
- ScrollViewWithGridView gvImages;
|
|
|
- @Bind(R.id.btn_save)
|
|
|
- Button btnSave;
|
|
|
+ @Bind(R.id.edit_username)
|
|
|
+ EditText editUsername;
|
|
|
+ @Bind(R.id.edit_birthday)
|
|
|
+ EditText editBirthday;
|
|
|
+ @Bind(R.id.edit_sex)
|
|
|
+ EditText editSex;
|
|
|
+ @Bind(R.id.edit_nation)
|
|
|
+ EditText editNation;
|
|
|
+ @Bind(R.id.edit_native_place)
|
|
|
+ EditText editNativePlace;
|
|
|
@Bind(R.id.tv_residenceCityId)
|
|
|
TextView tvResidenceCityId;
|
|
|
@Bind(R.id.tv_residenceRegionId)
|
|
|
TextView tvResidenceRegionId;
|
|
|
+ @Bind(R.id.edit_residenceType)
|
|
|
+ EditText editResidenceType;
|
|
|
+ @Bind(R.id.edit_height)
|
|
|
+ EditText editHeight;
|
|
|
+ @Bind(R.id.edit_weight)
|
|
|
+ EditText editWeight;
|
|
|
+ @Bind(R.id.edit_bloodType)
|
|
|
+ EditText editBloodType;
|
|
|
+ @Bind(R.id.edit_physicalExamination)
|
|
|
+ EditText editPhysicalExamination;
|
|
|
+ @Bind(R.id.edit_idcode)
|
|
|
+ EditText editIdcode;
|
|
|
@Bind(R.id.tv_livingProvinceId)
|
|
|
TextView tvLivingProvinceId;
|
|
|
@Bind(R.id.tv_livingCityId)
|
|
|
TextView tvLivingCityId;
|
|
|
@Bind(R.id.tv_livingRegionId)
|
|
|
TextView tvLivingRegionId;
|
|
|
+ @Bind(R.id.edit_livingAddress)
|
|
|
+ EditText editLivingAddress;
|
|
|
+ @Bind(R.id.textView)
|
|
|
+ TextView textView;
|
|
|
+ @Bind(R.id.edit_contactAddress)
|
|
|
+ EditText editContactAddress;
|
|
|
+ @Bind(R.id.edit_zipCode)
|
|
|
+ EditText editZipCode;
|
|
|
+ @Bind(R.id.edit_preSchoolEducation)
|
|
|
+ EditText editPreSchoolEducation;
|
|
|
+ @Bind(R.id.edit_hobby)
|
|
|
+ EditText editHobby;
|
|
|
+ @Bind(R.id.ll_member_family)
|
|
|
+ LinearLayout llMemberFamily;
|
|
|
+ @Bind(R.id.gv_images)
|
|
|
+ ScrollViewWithGridView gvImages;
|
|
|
+ @Bind(R.id.btn_save)
|
|
|
+ Button btnSave;
|
|
|
+
|
|
|
|
|
|
private String residenceProvinceId = "30";
|
|
|
private String residenceCityId;
|
|
@@ -175,6 +177,83 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
|
getLocalCityList("13", livingCityId);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存
|
|
|
+ */
|
|
|
+ btnSave.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View view) {
|
|
|
+ String studentName = editUsername.getText().toString().trim();
|
|
|
+ if(TextUtils.isEmpty(studentName)){
|
|
|
+ showToast("用户名不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String birthday = editBirthday.getText().toString().trim();
|
|
|
+ if(TextUtils.isEmpty(birthday)){
|
|
|
+ showToast("出生日期不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String ethnic = editNation.getText().toString().trim();
|
|
|
+ if(TextUtils.isEmpty(ethnic)){
|
|
|
+ showToast("民族不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String nativePlace = editNativePlace.getText().toString().trim();
|
|
|
+ if(TextUtils.isEmpty(nativePlace)){
|
|
|
+ showToast("籍贯不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String height = editHeight.getText().toString().trim();
|
|
|
+ if(TextUtils.isEmpty(height)){
|
|
|
+ showToast("升高不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String weight = editWeight.getText().toString().trim();
|
|
|
+ if(TextUtils.isEmpty(weight)){
|
|
|
+ showToast("体重不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String bloodType = editBloodType.getText().toString().trim();
|
|
|
+ if(TextUtils.isEmpty(bloodType)){
|
|
|
+ showToast("血型不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String physicalExamination = editPhysicalExamination.getText().toString().trim();
|
|
|
+ if(TextUtils.isEmpty(physicalExamination)){
|
|
|
+ showToast("体检不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String idCardNum = editIdcode.getText().toString().trim();
|
|
|
+ if(TextUtils.isEmpty(idCardNum)){
|
|
|
+ showToast("体检不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String contactAddress = editContactAddress.getText().toString().trim();
|
|
|
+ if(TextUtils.isEmpty(contactAddress)){
|
|
|
+ showToast("居住地详细地址不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String zipCode = editZipCode.getText().toString().trim();
|
|
|
+ if(TextUtils.isEmpty(zipCode)){
|
|
|
+ showToast("邮政编码不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String preSchoolEducation = editPreSchoolEducation.getText().toString();
|
|
|
+ if(TextUtils.isEmpty(preSchoolEducation)){
|
|
|
+ showToast("学前教育不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ String hobby = editHobby.getText().toString().trim();
|
|
|
+ if(TextUtils.isEmpty(hobby)){
|
|
|
+ showToast("兴趣爱好不能为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ saveApplyStudentInfo(studentName, birthday, "", ethnic, nativePlace, residenceProvinceId, residenceCityId, residenceRegionId, "",
|
|
|
+ height, weight, bloodType, physicalExamination, idCardNum, livingProvinceId, livingCityId, livingRegionId, contactAddress, zipCode,
|
|
|
+ preSchoolEducation, hobby);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -220,13 +299,13 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
|
} else if ("03".equals(type)) {
|
|
|
residenceRegionId = dataBean.get(i).getRegionId() + "";
|
|
|
tvResidenceRegionId.setText(dataBean.get(i).getRegionName());
|
|
|
- } else if ("11".equals(type)){
|
|
|
+ } else if ("11".equals(type)) {
|
|
|
livingProvinceId = dataBean.get(i).getRegionId() + "";
|
|
|
tvLivingProvinceId.setText(dataBean.get(i).getRegionName());
|
|
|
- } else if ("12".equals(type)){
|
|
|
+ } else if ("12".equals(type)) {
|
|
|
livingCityId = dataBean.get(i).getRegionId() + "";
|
|
|
tvLivingCityId.setText(dataBean.get(i).getRegionName());
|
|
|
- } else if ("13".equals(type)){
|
|
|
+ } else if ("13".equals(type)) {
|
|
|
livingRegionId = dataBean.get(i).getRegionId() + "";
|
|
|
tvLivingRegionId.setText(dataBean.get(i).getRegionName());
|
|
|
}
|
|
@@ -242,4 +321,30 @@ public class StudentInfoActivity extends TitleBarActivity {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ private void saveApplyStudentInfo(String studentName, String birthday, String sex, String ethnic, String nativePlace, String residenceProvinceId,
|
|
|
+ String residenceCityId, String residenceRegionId, String residenceType, String height, String weight,
|
|
|
+ String bloodType, String physicalExamination, String idCardNum, String livingProvinceId, String livingCityId,
|
|
|
+ String livingRegionId, String contactAddress,String zipCode, String preSchoolEducation, String hobby){
|
|
|
+
|
|
|
+ RequestGroup.saveApplyStudentInfo(studentName, birthday, sex, ethnic, nativePlace, residenceProvinceId, residenceCityId, residenceRegionId, residenceType,
|
|
|
+ height, weight, bloodType, physicalExamination, idCardNum, livingProvinceId, livingCityId, livingRegionId, contactAddress, zipCode, preSchoolEducation,
|
|
|
+ hobby, new Callback() {
|
|
|
+ @Override
|
|
|
+ public Object parseNetworkResponse(Response response, int id) throws Exception {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onError(Call call, Exception e, int id) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onResponse(Object response, int id) {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
}
|