Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. FormBody formBody = request.getFormBody()
  2. .add("date", date.getText().toString())
  3. .add("fromTime", fromTime.getSelectedItem().toString())
  4. .add("toTime", toTime.getSelectedItem().toString())
  5. .add("patient", String.valueOf(selectedPatientId))
  6. .build();
  7. request.doPost("addAppointment", formBody, AddAppointmentActivity.this, new Request.ResponseCallback() {
  8. @Override
  9. public void onResponse(final JSONObject jsonObject) {
  10. runOnUiThread(new Runnable() {
  11. @Override
  12. public void run() {
  13. String[][] checking = new String[][] {
  14. {"taken_appointment", getString(R.string.taken_appointment)},
  15. {"done", getString(R.string.added_appointment)},
  16. {"errors", Validation.getErrors(jsonObject)}
  17. };
  18. Validation.checkErrorsAndShowToast(AddAppointmentActivity.this, jsonObject, checking);
  19. }
  20. });
  21. }
  22.  
  23. @Override
  24. public void badUser() {
  25. runOnUiThread(new Runnable() {
  26. @Override
  27. public void run() {
  28. UserSession.swithOnLogin(AddAppointmentActivity.this);
  29. }
  30. });
  31. }
  32. });
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement