Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FormBody formBody = request.getFormBody()
- .add("date", date.getText().toString())
- .add("fromTime", fromTime.getSelectedItem().toString())
- .add("toTime", toTime.getSelectedItem().toString())
- .add("patient", String.valueOf(selectedPatientId))
- .build();
- request.doPost("addAppointment", formBody, AddAppointmentActivity.this, new Request.ResponseCallback() {
- @Override
- public void onResponse(final JSONObject jsonObject) {
- runOnUiThread(new Runnable() {
- @Override
- public void run() {
- String[][] checking = new String[][] {
- {"taken_appointment", getString(R.string.taken_appointment)},
- {"done", getString(R.string.added_appointment)},
- {"errors", Validation.getErrors(jsonObject)}
- };
- Validation.checkErrorsAndShowToast(AddAppointmentActivity.this, jsonObject, checking);
- }
- });
- }
- @Override
- public void badUser() {
- runOnUiThread(new Runnable() {
- @Override
- public void run() {
- UserSession.swithOnLogin(AddAppointmentActivity.this);
- }
- });
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement