Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void deleteBadgeByUser() {
- AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
- DCIteratorBinding vehicleTrackingIterator = ADFUtils.findIterator("VVehicleTrackingView1Iterator");
- if (null != vehicleTrackingIterator) {
- Row currentTrackingRow = vehicleTrackingIterator.getCurrentRow();
- if (null != currentTrackingRow) {
- Integer eventTypeId = (Integer)currentTrackingRow.getAttribute("EventTypeId");
- if (null != eventTypeId) {
- if (eventTypeId == 115 || eventTypeId == 206) {
- Integer vehicleDataId = (Integer)currentTrackingRow.getAttribute("EventId");
- if (null != vehicleDataId) {
- String procedure = "OF_OWNER.P_PERSON_DATA.delete_user_event(?)";
- String statement = "BEGIN " + procedure + "; END;";
- CallableStatement callableStatement =
- am.getDBTransaction().createCallableStatement(statement, 0);
- try {
- callableStatement.setInt(1, vehicleDataId);
- callableStatement.executeUpdate();
- am.getDBTransaction().postChanges();
- } catch (SQLException e) {
- log.error(e.getMessage(), e);
- } finally {
- try {
- callableStatement.close();
- } catch (SQLException se) {
- log.error(se.getMessage(), se);
- }
- }
- vehicleTrackingIterator.executeQuery();
- UIComponent tdata = JSFUtils.findComponentInRoot("tdata");
- if (null != tdata) {
- AdfFacesContext.getCurrentInstance().addPartialTarget(tdata);
- }
- }
- } else {
- BuildixxUtils.addErrorMessage("Please select a BADGE event!");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement