super(DcModules._CONTACTPERSON);
}
@Override
public void delete(boolean validate) {
DcObject loan = DcModules.get(DcModules._LOAN).getItem();
loan.setValue(Loan._C_CONTACTPERSONID, getID());
DataFilter filter = new DataFilter(loan);
List<String> loans = DataManager.getKeyList(filter);
if (loans.size() == 0) {
try {
super.delete(false);
} catch (ValidationException e) {}
} else {
if (DcSwingUtilities.displayQuestion("msgDeletePersonLendItems")) {
try {
DatabaseManager.executeSQL("DELETE FROM " + loan.getModule().getTableName() + " WHERE " +
loan.getField(Loan._C_CONTACTPERSONID).getDatabaseFieldName() + " = '" + getID() + "'");
try {
super.delete(false);
} catch (ValidationException e) {}
} catch (SQLException se) {
logger.error(se, se);