String sessionID = session.getId();
saveData(session, "despatchNo", despNo, true);
if (despNo.length() > 0)
{
JDBDespatch desp = new JDBDespatch(Common.sd.getData(sessionID, "selectedHost"), sessionID);
if (desp.getDespatchProperties(Common.sd.getData(sessionID, "despatchNo")))
{
logger.debug("Despatch data for " + Common.sd.getData(sessionID, "despatchNo") + " retrieved.");
saveData(session, "despatchFromLocation", desp.getLocationIDFrom(), true);
saveData(session, "despatchToLocation", desp.getLocationIDTo(), true);
saveData(session, "despatchTrailer", desp.getTrailer(), true);
saveData(session, "despatchHaulier", desp.getHaulier(), true);
saveData(session, "despatchLoadNo", desp.getLoadNo(), true);
saveData(session, "despatchPalletCount", String.valueOf(desp.getDespatchPalletCount()), true);
saveData(session, "despatchFromLocationCombo", locationDBComboBox("despatchFromLocation", desp.getLocationIDFrom(), session), true);
saveData(session, "despatchToLocationCombo", locationDBComboBox("despatchToLocation", desp.getLocationIDTo(), session), true);
result = true;
} else
{
saveData(session, "despatchFromLocation", "", true);
saveData(session, "despatchToLocation", "", true);
saveData(session, "despatchTrailer", "", true);
saveData(session, "despatchHaulier", "", true);
saveData(session, "despatchLoadNo", "", true);
saveData(session, "despatchPalletCount", "0", true);
saveData(session, "despatchFromLocationCombo", locationDBComboBox("despatchFromLocation", "", session), true);
saveData(session, "despatchToLocationCombo", locationDBComboBox("despatchToLocation", "", session), true);
session.setAttribute("_ErrorMessage", desp.getErrorMessage());
result = false;
}
}
return result;