From 0c3071e57fa19bdd8c988e1636ef061f1c191282 Mon Sep 17 00:00:00 2001 From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674> Date: 星期一, 10 四月 2017 18:14:35 +0800 Subject: [PATCH] --- VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/RegisterFragment.java | 54 ++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 40 insertions(+), 14 deletions(-) diff --git a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/RegisterFragment.java b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/RegisterFragment.java index 4f349b0..80f08d6 100644 --- a/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/RegisterFragment.java +++ b/VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/RegisterFragment.java @@ -88,38 +88,53 @@ 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); @@ -128,15 +143,26 @@ 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() { -- Gitblit v1.8.0