Advertisement
psi_mmobile

Untitled

Jun 18th, 2021
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. public void setSelectedVehicleId(int selectedVehicleId) {
  2. AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
  3. ViewObjectImpl vehicleVo = am.getEditVehicleView1();
  4. if (selectedVehicleId == this.selectedVehicleId) {
  5. Row currentVehicleRow = vehicleVo.getCurrentRow();
  6. if (null != currentVehicleRow)
  7. selectedVehicle = new Vehicle(currentVehicleRow);
  8. else
  9. return;
  10. }
  11. log.debug("Selected Vehicle : " + selectedVehicleId);
  12. this.selectedVehicleId = selectedVehicleId;
  13. if (this.selectedVehicleId != 0) {
  14. vehicleVo.setWhereClause("Vehicle.VEHICLE_ID = " + selectedVehicleId);
  15. vehicleVo.executeQuery();
  16.  
  17.  
  18. String sql =
  19. "SELECT FILE_PATH,MAX(ATTACH_DOC_ID) FROM ATTACH_DOC WHERE DOCUMENT_TYPE_ID=1007 AND VEHICLE_ID=" +
  20. selectedVehicleId + " GROUP BY FILE_PATH";
  21. ViewObject docVo = am.createViewObjectFromQueryStmt("IdImageObjectView", sql);
  22. docVo.executeQuery();
  23.  
  24. Row matchedImg = docVo.first();
  25. if (matchedImg != null) {
  26. selectedVehicle = new Vehicle(vehicleVo.first(), (String)matchedImg.getAttribute(0));
  27. } else {
  28. selectedVehicle = new Vehicle(vehicleVo.first());
  29. }
  30.  
  31. docVo.remove();
  32.  
  33. } else {
  34. selectedVehicle = null;
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement