2018-06-03 22:26:41 +08:00

35 lines
1017 B
Java

package com.tenwa.customer.handler.finance;
import jbo.app.tenwa.customer.CUSTOMER_FINANCE;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.awe.dw.handler.impl.CommonHandler;
public class CustomerFinance extends CommonHandler{
@Override
protected boolean validityCheck(BizObject bo, boolean isInsert) {
try {
if(isInsert){
BizObject bx=JBOFactory.createBizObjectQuery(CUSTOMER_FINANCE.CLASS_NAME,"customercode='"+bo.getAttribute("customercode")+"'").getSingleResult(false);
if(bx!=null){
this.errors="客户财务编码重复";
return false;
}
}else{
BizObject bx=JBOFactory.createBizObjectQuery(CUSTOMER_FINANCE.CLASS_NAME,"customercode='"+bo.getAttribute("customercode")+"' and id<>'"+bo.getAttribute("id")+"'").getSingleResult(false);
if(bx!=null){
this.errors="客户财务编码重复";
return false;
}
}
} catch (Exception e) {
// TODO: handle exception
}
return super.validityCheck(bo, isInsert);
}
}