Search in sources :

Example 6 with Partner

use of org.eyeseetea.malariacare.data.database.model.Partner in project pictureapp by EyeSeeTea.

the class PopulateDBStrategy method createDummyOrganisationInDB.

@Override
public void createDummyOrganisationInDB() {
    Partner testOrganisation = new Partner();
    testOrganisation.setName(PreferencesState.getInstance().getContext().getString(R.string.test_partner_name));
    testOrganisation.setUid(PreferencesState.getInstance().getContext().getString(R.string.test_partner_uid));
    testOrganisation.insert();
}
Also used : Partner(org.eyeseetea.malariacare.data.database.model.Partner)

Example 7 with Partner

use of org.eyeseetea.malariacare.data.database.model.Partner in project pictureapp by EyeSeeTea.

the class PopulateRow method populateOrganisations.

/**
 * Method to populate each row of Partner.csv.
 *
 * @param line The row of the csv to populate.
 */
static Partner populateOrganisations(String[] line, @Nullable Partner partner) {
    if (partner == null) {
        partner = new Partner();
    }
    partner.setUid(line[1]);
    partner.setName(line[2]);
    return partner;
}
Also used : Partner(org.eyeseetea.malariacare.data.database.model.Partner)

Aggregations

Partner (org.eyeseetea.malariacare.data.database.model.Partner)7 CSVReader (com.opencsv.CSVReader)4 InputStreamReader (java.io.InputStreamReader)4 StringKey (org.eyeseetea.malariacare.data.database.model.StringKey)2 Treatment (org.eyeseetea.malariacare.data.database.model.Treatment)2 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Answer (org.eyeseetea.malariacare.data.database.model.Answer)1 Drug (org.eyeseetea.malariacare.data.database.model.Drug)1 Header (org.eyeseetea.malariacare.data.database.model.Header)1 Match (org.eyeseetea.malariacare.data.database.model.Match)1 Option (org.eyeseetea.malariacare.data.database.model.Option)1 OptionAttribute (org.eyeseetea.malariacare.data.database.model.OptionAttribute)1 Program (org.eyeseetea.malariacare.data.database.model.Program)1 Question (org.eyeseetea.malariacare.data.database.model.Question)1 QuestionOption (org.eyeseetea.malariacare.data.database.model.QuestionOption)1 QuestionRelation (org.eyeseetea.malariacare.data.database.model.QuestionRelation)1 QuestionThreshold (org.eyeseetea.malariacare.data.database.model.QuestionThreshold)1