package nc.ui.hr.baod_orders.view;

import nc.ui.pub.beans.UIRefPane;
import nc.ui.pubapp.uif2app.view.ShowUpableBillForm;
import nc.vo.th.baod.entity.AggBaodVO;

public class ShowBillForm extends ShowUpableBillForm{

	@Override
	public Object getValue() {
		AggBaodVO value = (AggBaodVO) super.getValue();
		if (null != getBlankChildrenFilter()) {
			getBlankChildrenFilter().filter(getBillCardPanel(),value);
		}
		UIRefPane ref = (UIRefPane)getBillCardPanel().getHeadItem("def6").getComponent();
		String[] refPKs = ref.getRefPKs() ;
		String pk ="";
		if(refPKs != null && refPKs.length > 0){
			for (int i = 0;i < refPKs.length; i++) {
				if(i == refPKs.length-1) {
					pk = pk + refPKs[i]+"";
				}else {
					pk = pk + refPKs[i]+",";
				}
			}
		value.getParentVO().setDef6(pk);
		}
		return value;
	}

	@Override
	public void setValue(Object object) {
 		super.setValue(object);
		AggBaodVO vo = (AggBaodVO) object;
		if(vo != null) {
			String pks = vo.getParentVO().getDef6();
			if(null != pks&& pks.contains(",")){
				String[] pkstr = pks.split(",");
				UIRefPane refPene =(UIRefPane) getBillCardPanel().getHeadItem("def6").getComponent();
				refPene.setPKs(pkstr);
			}
		}
	}
}
