package nc.ui.pu.m25.editor.card.beforeedit.body;

import nc.ui.bd.ref.model.StorDocReportRefModel;
import nc.ui.pu.pub.editor.card.listener.ICardBodyBeforeEditEventListener;
import nc.ui.pub.beans.UIRefPane;
import nc.ui.pubapp.uif2app.event.card.CardBodyBeforeEditEvent;
import nc.ui.pub.bill.BillCardPanel;
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
public class Vbdef20 implements ICardBodyBeforeEditEventListener{

	@Override 
	public void beforeEdit(CardBodyBeforeEditEvent arg0) {
		BillCardPanel cpanel=arg0.getBillCardPanel();
		String objvdef17=(String) cpanel.getHeadItem("vdef17").getValueObject();//附件id
		UIRefPane ref=(UIRefPane) cpanel.getBodyItem("vbdef20").getComponent();
		ref.setMultiSelectedEnabled(true);
		ref.setNotLeafSelectedEnabled(false);
		StorDocReportRefModel storef=(StorDocReportRefModel) ref.getRefModel();
		if(objvdef17 == null || "".equals(objvdef17)){
			ExceptionUtils.wrappBusinessException("请添加发票！");
		}
		storef.addWherePart(" and name6='"+objvdef17.toString()+"' "); //附件主键过滤
	}

}
