private void populateAppHistory(AppointmentHistoryForSummaryOverviewVoCollection apps) { if (apps == null) return; for (int i = 0 ; i<form.grdAppHistory().getRows().size() ; i++) { AppointmentHistoryForSummaryOverviewVo record = getRecordForId(i, apps); grdAppHistoryRow grdAppHistoryRow = form.grdAppHistory().getRows().get(i); grdAppHistoryRow.setColumnDate(record.getDateIsNotNull()?record.getDate().toString():null); grdAppHistoryRow.setColumnHcp(record.getHcpIsNotNull()?record.getHcp().toString():null); if (record.getDateIsNotNull()) { grdAppHistoryRow.setTooltipForColumnDate(record.getDate().toString()); } if (record.getHcpIsNotNull()) { grdAppHistoryRow.setTooltipForColumnHcp(record.getHcp().toString()); } } }
private AppointmentHistoryForSummaryOverviewVo getRecordForId(int id, AppointmentHistoryForSummaryOverviewVoCollection apps) { if (apps == null) { return getNewForId(id); } for (int i =0 ; i < apps.size() ; i++) { if (!apps.get(i).getTypeIsNotNull()) continue; if (id == apps.get(i).getType()) return apps.get(i); } return getNewForId(id); }
private AppointmentHistoryForSummaryOverviewVo getNewForId(int id) { AppointmentHistoryForSummaryOverviewVo result = new AppointmentHistoryForSummaryOverviewVo(); result.setType(id); return result; }