Search in sources :

Example 1 with SurveyWSResponseAction

use of org.eyeseetea.malariacare.data.sync.exporter.model.SurveyWSResponseAction in project pictureapp by EyeSeeTea.

the class WSPushController method checkPushResult.

private void checkPushResult(SurveyWSResult surveyWSResult) {
    for (SurveyWSResponseAction responseAction : surveyWSResult.getActions()) {
        if (!responseAction.isSuccess()) {
            String message = String.format(PreferencesState.getInstance().getContext().getString(R.string.survey_error), responseAction.getActionId(), responseAction.getMessage(), responseAction.getResponse().getMsg());
            mCallback.onInformativeError(new PushValueException(message));
        }
    }
    for (Survey survey : mSurveys) {
        survey.setStatus(Constants.SURVEY_SENT);
        survey.save();
    }
    mCallback.onComplete();
}
Also used : Survey(org.eyeseetea.malariacare.data.database.model.Survey) PushValueException(org.eyeseetea.malariacare.domain.exception.push.PushValueException) SurveyWSResponseAction(org.eyeseetea.malariacare.data.sync.exporter.model.SurveyWSResponseAction)

Aggregations

Survey (org.eyeseetea.malariacare.data.database.model.Survey)1 SurveyWSResponseAction (org.eyeseetea.malariacare.data.sync.exporter.model.SurveyWSResponseAction)1 PushValueException (org.eyeseetea.malariacare.domain.exception.push.PushValueException)1