| | |
| | | RequestParams params = new RequestParams();
|
| | |
|
| | | String name = register_name.getValue();
|
| | | if (name.trim().length() < 0) {
|
| | | if (name.trim().length() <= 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "姓名不能为空", Toast.LENGTH_SHORT).show();
|
| | | return;
|
| | | }
|
| | | String phone = register_phone.getValue();
|
| | | if (phone.trim().length() < 0) {
|
| | | if (phone.trim().length() <= 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "电话不能为空", Toast.LENGTH_SHORT).show();
|
| | | return;
|
| | | }
|
| | | String gender = register_gender.getValue();
|
| | | if (gender.trim().length() < 0) {
|
| | | if (gender.trim().length() <= 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "性别不能为空", Toast.LENGTH_SHORT).show();
|
| | | return;
|
| | | }
|
| | | String id_class = register_id_class.getValue();
|
| | | if (id_class.trim().length() < 0) {
|
| | | if (id_class.trim().length() <= 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "证件类型不能为空", Toast.LENGTH_SHORT).show();
|
| | | return;
|
| | | }
|
| | | String country = register_country.getValue();
|
| | | if (country.trim().length() < 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "证件类型不能为空", Toast.LENGTH_SHORT).show();
|
| | | if (country.trim().length() <= 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "国籍不能为空", Toast.LENGTH_SHORT).show();
|
| | | return;
|
| | | }
|
| | | String id_num = register_id_num.getValue();
|
| | | if (id_num.trim().length() < 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "证件类型不能为空", Toast.LENGTH_SHORT).show();
|
| | | if (id_num.trim().length() <= 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "证件编号不能为空", Toast.LENGTH_SHORT).show();
|
| | | return;
|
| | | }
|
| | | String birthday = register_birthday.getValue();
|
| | | if (birthday.trim().length() <= 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "出生日期不能为空", Toast.LENGTH_SHORT).show();
|
| | | return;
|
| | | }
|
| | | String company = register_company.getValue();
|
| | | if (company.trim().length() < 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "证件类型不能为空", Toast.LENGTH_SHORT).show();
|
| | | if (company.trim().length() <= 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "公司名称不能为空", Toast.LENGTH_SHORT).show();
|
| | | return;
|
| | | }
|
| | | String remark = register_remark.getValue();
|
| | | if (remark.trim().length() <= 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "备注不能为空", Toast.LENGTH_SHORT).show();
|
| | | return;
|
| | | }
|
| | | String visitor_class = register_visitor_class.getValue();
|
| | | if (visitor_class.trim().length() <= 0) {
|
| | | Toast.makeText(MainActivity.getInstance(), "访客类型不能为空", Toast.LENGTH_SHORT).show();
|
| | | return;
|
| | | }
|
| | | params.addBodyParameter(Register.FieldNames.username, name);
|
| | |
| | | params.addBodyParameter(Register.FieldNames.identityTypeId, DictionaryMng.getInstance().getId(id_class));
|
| | | params.addBodyParameter(Register.FieldNames.countryId, DictionaryMng.getInstance().getId(country));
|
| | | params.addBodyParameter(Register.FieldNames.identifyNum, id_num);
|
| | | params.addBodyParameter(Register.FieldNames.birthday, company);
|
| | | // params.addBodyParameter(Person.FieldNames.Re);
|
| | | params.addBodyParameter(Register.FieldNames.companyId, company);
|
| | | params.addBodyParameter(Register.FieldNames.birthday, birthday);
|
| | | params.addBodyParameter("companyName", register_company.getValue());
|
| | |
|
| | | //params.addBodyParameter(VisitPersonType.FieldNames.registerCompanyId, "0");
|
| | |
|
| | | RegisterMng.getInstance().add(params);
|
| | | }
|
| | |
|
| | | public void resetForm() {
|
| | | register_name.setValue("");
|
| | | register_phone.setValue("");
|
| | | register_gender.setValue("");
|
| | | register_id_class.setValue("");
|
| | | register_country.setValue("");
|
| | | register_id_num.setValue("");
|
| | | register_birthday.setValue("");
|
| | | register_company.setValue("");
|
| | | register_remark.setValue("");
|
| | | register_visitor_class.setValue("");
|
| | | }
|
| | |
|
| | | @OnClick(R.id.register_country)
|
| | | public void register_country_click(View view) {
|
| | | new CountryDialog(fragment_register_linear_layout, new OkClickedListener() {
|