apzl_leasing/src_tenwa/com/tenwa/flow/comm/handler/LBProjectHandler.java
2018-06-03 22:26:41 +08:00

26 lines
1.1 KiB
Java

package com.tenwa.flow.comm.handler;
import com.amarsoft.are.jbo.BizObject;
import com.amarsoft.are.jbo.BizObjectManager;
import com.amarsoft.are.jbo.JBOFactory;
import com.amarsoft.are.jbo.JBOTransaction;
import com.amarsoft.awe.dw.handler.impl.CommonHandler;
public class LBProjectHandler extends CommonHandler{
@Override
protected void beforeUpdate(JBOTransaction tx, BizObject bo)
throws Exception {
String FlowUnid=this.asPage.getParameter("FlowUnid");
BizObjectManager bom=JBOFactory.getBizObjectManager(jbo.com.tenwa.entity.comm.flow.FLOW_BUSSINESS_OBJECT.CLASS_NAME);
BizObject fbo=bom.createQuery("flow_unid=:flow_unid").setParameter("flow_unid", FlowUnid).getSingleResult(false);
String proj_name=fbo.getAttribute("proj_name").toString();
String project_name=bo.getAttribute("project_name").toString();
if(!proj_name.equals(project_name)){
bom.createQuery("update O set proj_name=:proj_name where flow_unid=:flow_unid").setParameter("proj_name", project_name).setParameter("flow_unid",FlowUnid).executeUpdate();
}
super.beforeUpdate(tx, bo);
}
}