license comprobation on student selection

parent 41f52e8f
......@@ -102,7 +102,7 @@ public class CustomList extends ArrayAdapter<String>{
newStudentView.setTextSize(64);
newStudentView.setText(fa_user_plus);
}
// Background
ImageView fondo = (ImageView) rowView.findViewById(R.id.fondo);
fondo.setBackgroundResource(R.drawable.round_design_photo_white);
......
......@@ -99,6 +99,23 @@ public class StudentFragmentGrid extends Fragment {
if (this.nameStudents[i].equals(getString(R.string.addStudent)))
register_student(getActivity().getIntent().getIntExtra("sup_id", 0));
else {
// checks if license is valid for this user
if(licenseStudents[i].equals("expired")){
AlertDialog.Builder builder1 = new AlertDialog.Builder(getActivity());
builder1.setMessage(R.string.loginNoLicenseMsg);
builder1.setPositiveButton(
R.string.accept,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert11 = builder1.create();
alert11.show();
return;
}
new_user(i);
download_supervisors(PCBcontext.getPcbdb().getCurrentUser().get_id_stu());
}
......@@ -117,7 +134,7 @@ public class StudentFragmentGrid extends Fragment {
alert.setView(edittext);
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
alert.setPositiveButton(R.string.accept, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
//What ever you want to do with the value
String license = edittext.getText().toString().replaceAll("[^a-zA-Z0-9]", "").toUpperCase();
......@@ -150,7 +167,7 @@ public class StudentFragmentGrid extends Fragment {
}
});
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
alert.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
// what ever you want to do with No option.
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment