Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void setSelectedVehicleId(int selectedVehicleId) {
- AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
- ViewObjectImpl vehicleVo = am.getEditVehicleView1();
- if (selectedVehicleId == this.selectedVehicleId) {
- Row currentVehicleRow = vehicleVo.getCurrentRow();
- if (null != currentVehicleRow)
- selectedVehicle = new Vehicle(currentVehicleRow);
- else
- return;
- }
- log.debug("Selected Vehicle : " + selectedVehicleId);
- this.selectedVehicleId = selectedVehicleId;
- if (this.selectedVehicleId != 0) {
- vehicleVo.setWhereClause("Vehicle.VEHICLE_ID = " + selectedVehicleId);
- vehicleVo.executeQuery();
- String sql =
- "SELECT FILE_PATH,MAX(ATTACH_DOC_ID) FROM ATTACH_DOC WHERE DOCUMENT_TYPE_ID=1007 AND VEHICLE_ID=" +
- selectedVehicleId + " GROUP BY FILE_PATH";
- ViewObject docVo = am.createViewObjectFromQueryStmt("IdImageObjectView", sql);
- docVo.executeQuery();
- Row matchedImg = docVo.first();
- if (matchedImg != null) {
- selectedVehicle = new Vehicle(vehicleVo.first(), (String)matchedImg.getAttribute(0));
- } else {
- selectedVehicle = new Vehicle(vehicleVo.first());
- }
- docVo.remove();
- } else {
- selectedVehicle = null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement