|
|
@@ -51,15 +51,17 @@ public class PlatContactAddPeopleActivity extends BaseActivity implements View.
|
|
|
@ViewInject(R.id.btn_save)
|
|
|
private Button btn_save;
|
|
|
private int mSex = 1;
|
|
|
- private String[] mDepartment = {"总经办", "采购部","销售部","财务部", "人事行政部", "研发部"};
|
|
|
- private String [][] mJobs = {
|
|
|
- {"总经理","副总经理","秘书"},
|
|
|
- {"经理","采购员"},
|
|
|
- {"经理","业务员"},
|
|
|
- {"经理","会计","出纳"},
|
|
|
- {"经理","人事专员","行政专员"},
|
|
|
- {"经理","工程师"}
|
|
|
- };
|
|
|
+ private String[] mDepartment;
|
|
|
+ private String[] mJobs;
|
|
|
+// private String [][] mJobs;
|
|
|
+// {
|
|
|
+// {"总经理","副总经理","秘书"},
|
|
|
+// {"经理","采购员"},
|
|
|
+// {"经理","业务员"},
|
|
|
+// {"经理","会计","出纳"},
|
|
|
+// {"经理","人事专员","行政专员"},
|
|
|
+// {"经理","工程师"}
|
|
|
+// };
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
@@ -82,6 +84,7 @@ public class PlatContactAddPeopleActivity extends BaseActivity implements View.
|
|
|
user_job_tv.setOnClickListener(this);
|
|
|
btn_save.setOnClickListener(this);
|
|
|
|
|
|
+ mDepartment = getResources().getStringArray(R.array.plat_department_list);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -98,7 +101,7 @@ public class PlatContactAddPeopleActivity extends BaseActivity implements View.
|
|
|
break;
|
|
|
case R.id.user_job_tv:
|
|
|
if (StringUtils.isEmpty(user_department_tv.getText().toString())){
|
|
|
- ToastMessage("请先选择部门");
|
|
|
+ ToastMessage(getString(R.string.select_department_first));
|
|
|
}else {
|
|
|
doSelectJob();
|
|
|
}
|
|
|
@@ -110,8 +113,21 @@ public class PlatContactAddPeopleActivity extends BaseActivity implements View.
|
|
|
private void doSelectJob() {
|
|
|
ArrayList<SelectBean> formBeaan = new ArrayList<>();
|
|
|
SelectBean selectBean;
|
|
|
- int item = -1;
|
|
|
- switch (user_department_tv.getText().toString()){
|
|
|
+// int item = -1;
|
|
|
+ String choice_department = user_department_tv.getText().toString();
|
|
|
+ if (getString(R.string.plat_department1).equals(choice_department))
|
|
|
+ mJobs = getResources().getStringArray(R.array.plat_job1);
|
|
|
+ if (getString(R.string.plat_department2).equals(choice_department))
|
|
|
+ mJobs = getResources().getStringArray(R.array.plat_job2);
|
|
|
+ if (getString(R.string.plat_department3).equals(choice_department))
|
|
|
+ mJobs = getResources().getStringArray(R.array.plat_job3);
|
|
|
+ if (getString(R.string.plat_department4).equals(choice_department))
|
|
|
+ mJobs = getResources().getStringArray(R.array.plat_job4);
|
|
|
+ if (getString(R.string.plat_department5).equals(choice_department))
|
|
|
+ mJobs = getResources().getStringArray(R.array.plat_job5);
|
|
|
+ if (getString(R.string.plat_department6).equals(choice_department))
|
|
|
+ mJobs = getResources().getStringArray(R.array.plat_job6);
|
|
|
+ /*switch (user_department_tv.getText().toString()){
|
|
|
case "总经办":
|
|
|
item = 0;
|
|
|
break;
|
|
|
@@ -131,17 +147,17 @@ public class PlatContactAddPeopleActivity extends BaseActivity implements View.
|
|
|
item = 5;
|
|
|
break;
|
|
|
default:
|
|
|
- }
|
|
|
- for (int i = 0; i < mJobs[item].length; i++) {
|
|
|
+ }*/
|
|
|
+ for (int i = 0; i < mJobs.length; i++) {
|
|
|
selectBean = new SelectBean();
|
|
|
- selectBean.setName(mJobs[item][i]);
|
|
|
+ selectBean.setName(mJobs[i]);
|
|
|
formBeaan.add(selectBean);
|
|
|
}
|
|
|
|
|
|
Intent intent = new Intent();
|
|
|
intent.setClass(this, SelectActivity.class);
|
|
|
intent.putExtra("type", 2);
|
|
|
- intent.putExtra("title", "选择岗位");
|
|
|
+ intent.putExtra("title", getString(R.string.select_jobs));
|
|
|
intent.putParcelableArrayListExtra("data", formBeaan);
|
|
|
startActivityForResult(intent, 0x12);
|
|
|
}
|
|
|
@@ -157,7 +173,7 @@ public class PlatContactAddPeopleActivity extends BaseActivity implements View.
|
|
|
Intent intent = new Intent();
|
|
|
intent.setClass(this, SelectActivity.class);
|
|
|
intent.putExtra("type", 2);
|
|
|
- intent.putExtra("title", "选择部门");
|
|
|
+ intent.putExtra("title", getString(R.string.select_department));
|
|
|
intent.putParcelableArrayListExtra("data", formBeaan);
|
|
|
startActivityForResult(intent, 0x11);
|
|
|
}
|
|
|
@@ -191,7 +207,7 @@ public class PlatContactAddPeopleActivity extends BaseActivity implements View.
|
|
|
if (user_email_tv.getText().toString().contains("@")){
|
|
|
saveRequest();
|
|
|
}else {
|
|
|
- ToastMessage("请输入正确的邮箱格式");
|
|
|
+ ToastMessage(getString(R.string.Please_imput_the_correct_email_format));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -202,7 +218,7 @@ public class PlatContactAddPeopleActivity extends BaseActivity implements View.
|
|
|
btn_save.setEnabled(false);
|
|
|
Map<String,Object> formStoreMap = new HashMap<>();
|
|
|
formStoreMap.put("userName",user_name_tv.getText().toString());
|
|
|
- formStoreMap.put("userSex","男".equals(user_sex_tv.getText().toString()) ? "M" : "F");
|
|
|
+ formStoreMap.put("userSex",getString(R.string.user_body).equals(user_sex_tv.getText().toString()) ? "M" : "F");
|
|
|
formStoreMap.put("userTel",user_tel_tv.getText().toString());
|
|
|
formStoreMap.put("userEmail",user_email_tv.getText().toString());
|
|
|
|
|
|
@@ -230,7 +246,7 @@ public class PlatContactAddPeopleActivity extends BaseActivity implements View.
|
|
|
if (!StringUtils.isEmpty(save_result)){
|
|
|
if (JSON.parseObject(save_result).containsKey("success") &&
|
|
|
"人员添加成功".equals(JSON.parseObject(save_result).getString("success"))){
|
|
|
- Toast.makeText(getApplicationContext(), "新增成功", Toast.LENGTH_LONG);
|
|
|
+ Toast.makeText(getApplicationContext(), getString(R.string.add_success), Toast.LENGTH_LONG);
|
|
|
new Handler().postDelayed(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
@@ -257,16 +273,16 @@ public class PlatContactAddPeopleActivity extends BaseActivity implements View.
|
|
|
};
|
|
|
private void showSelectSexDialog() {
|
|
|
// 1是男,0是女,2是全部
|
|
|
- String[] sexs = new String[]{ getString(R.string.sex_man), getString(R.string.sex_woman)};
|
|
|
+ String[] sexs = new String[]{ getString(R.string.user_body), getString(R.string.user_girl)};
|
|
|
int checkItem = 0;
|
|
|
- new AlertDialog.Builder(this).setTitle(getString(R.string.select_sex))
|
|
|
+ new AlertDialog.Builder(this).setTitle(getString(R.string.select_sex_title))
|
|
|
.setSingleChoiceItems(sexs, checkItem, new DialogInterface.OnClickListener() {
|
|
|
@Override
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
if (which == 0) {
|
|
|
- user_sex_tv.setText(R.string.sex_man);
|
|
|
+ user_sex_tv.setText(R.string.user_body);
|
|
|
} else {
|
|
|
- user_sex_tv.setText(R.string.sex_woman);
|
|
|
+ user_sex_tv.setText(R.string.user_girl);
|
|
|
}
|
|
|
dialog.dismiss();
|
|
|
}
|