use of org.eyeseetea.malariacare.data.database.model.Survey in project pictureapp by EyeSeeTea.
the class DynamicTabAdapterStrategy method initSurveys.
@Override
public void initSurveys(boolean readOnly) {
if (readOnly) {
Survey malariaSurvey = Session.getMalariaSurvey();
Session.setStockSurvey(Survey.getStockSurveyWithEventDate(malariaSurvey.getEventDate()));
}
}
use of org.eyeseetea.malariacare.data.database.model.Survey in project pictureapp by EyeSeeTea.
the class DashboardActivityStrategy method beforeExit.
@Override
public boolean beforeExit(boolean isBackPressed) {
Survey malariaSurvey = Session.getMalariaSurvey();
boolean isMalariaBackPressed = beforeExitSurvey(isBackPressed, malariaSurvey);
Survey stockSurvey = Session.getStockSurvey();
boolean isStockBackPressed = beforeExitSurvey(isBackPressed, stockSurvey);
if (!isMalariaBackPressed || !isStockBackPressed) {
return false;
}
return isBackPressed;
}
use of org.eyeseetea.malariacare.data.database.model.Survey in project pictureapp by EyeSeeTea.
the class DashboardActivityStrategy method newSurvey.
@Override
public void newSurvey(Activity activity) {
Program myanmarProgram = Program.findByUID(activity.getString(R.string.malariaProgramUID));
Program stockProgram = Program.findByUID(activity.getString(R.string.stockProgramUID));
// Put new survey in session
Survey survey = new Survey(null, myanmarProgram, Session.getUser());
survey.save();
Session.setMalariaSurvey(survey);
Survey stockSurvey = new Survey(null, stockProgram, Session.getUser(), Constants.SURVEY_ISSUE);
stockSurvey.setEventDate(//asociate the malaria survey to the stock survey
survey.getEventDate());
stockSurvey.save();
Session.setStockSurvey(stockSurvey);
prepareLocationListener(activity, survey);
}
use of org.eyeseetea.malariacare.data.database.model.Survey in project pictureapp by EyeSeeTea.
the class HistoricReceiptBalanceAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
if (holder instanceof RowViewHolder) {
RowViewHolder rowViewHolder = (RowViewHolder) holder;
Survey survey = mSurveys.get(position - 1);
putValuesToRow(rowViewHolder, survey);
}
if (holder instanceof HeaderViewHolder) {
HeaderViewHolder headerViewHolder = (HeaderViewHolder) holder;
putValuesToHeader(headerViewHolder);
}
}
Aggregations