xuxiuxi
2017-04-10 0c3071e57fa19bdd8c988e1636ef061f1c191282


git-svn-id: http://192.168.1.226/svn/proxy@401 454eff88-639b-444f-9e54-f578c98de674
2个文件已修改
62 ■■■■ 已修改文件
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/fragment/RegisterFragment.java 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/RegisterMng.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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() {
VisitFace/DemoForBsk/app/src/main/java/cn/com/basic/face/service/RegisterMng.java
@@ -3,6 +3,7 @@
import android.widget.Toast;
import cn.com.basic.face.base.BaseApplication;
import cn.com.basic.face.fragment.RegisterFragment;
import cn.com.basic.face.util.AppApi;
import org.xutils.http.RequestParams;
@@ -42,14 +43,15 @@
            params.setUri(AppApi.BASE_URL +AppApi.REGISTER_ADD);
            params.addBodyParameter("file1", f1);
            params.addBodyParameter("file2", f2);
            x.http().post(params, new BaseCommonCallBack() {
        }catch(Exception e) {
            e.printStackTrace();            x.http().post(params, new BaseCommonCallBack() {
                @Override
                public void success() {
                    Toast.makeText(BaseApplication.getInstance(),"添加成功", Toast.LENGTH_SHORT).show();
                    RegisterFragment.getInstance().resetForm();
                }
            });
        }catch(Exception e) {
            e.printStackTrace();
        }
    }