package com.kingdee.eas.gyt.app;

import org.apache.log4j.Logger;

import com.kingdee.bos.BOSException;
import com.kingdee.bos.Context;
import com.kingdee.bos.dao.IObjectPK;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.gyt.BizHelpFacadeFactory;
import com.kingdee.eas.gyt.TestFactory;
import com.kingdee.util.NumericExceptionSubItem;

public class TestControllerBean extends AbstractTestControllerBean {
   
	/**
	 * 
	 */
	private static final long serialVersionUID = -6773008477937921984L;
	
	private static Logger logger = Logger.getLogger("com.kingdee.eas.gyt.app.TestControllerBean");
   
    protected IObjectPK _save(Context ctx, IObjectValue model) throws BOSException, EASBizException {
    	
    	try {
    		
    		logger.info("-----"+model);
    		
			BizHelpFacadeFactory.getLocalInstance(ctx).writeBack(model.getString("number").trim());
			
			return super._save(ctx, model);
			
		} catch (Exception e) {
			
			setRollbackOnly();
			
			e.printStackTrace();
			
			throw new EASBizException(new NumericExceptionSubItem("",e.getMessage()));
		}
    }
}