package nc.ui.wa.ruleex.model;

import nc.bs.framework.common.NCLocator;
import nc.itf.hr.wa.IItemQueryService;
import nc.itf.hr.wa.IWaGradeQueryService;
import nc.ui.uif2.model.IAppModelService;
import nc.ui.wa.ctymgt.CtymgtDelegator;
import nc.vo.hrwa.waruleex.AggWageformExVO;
import nc.vo.pub.BusinessException;
import nc.vo.uif2.LoginContext;
import nc.vo.wa.rule.AggWageformVO;

/**
 * WaRuleModelService<BR>
 * <BR>
 * 
 * @author: xuhw
 * @date: 2009-11-10
 * @since: eHR V6.0
 * @走查人:
 * @走查日期:
 * @修改人:
 * @修改日期:
 */
public class WaRuleModelService implements IAppModelService
{
	private IItemQueryService service = null;
	private IWaGradeQueryService gradeQueryservice = null;
	
	/**
	 * 删除
	 * 
	 * @author xuhw on 2009-11-11
	 */
	@Override
	public void delete(Object object) throws BusinessException
	{
		CtymgtDelegator.getWaRuleExService().deleteVO((AggWageformExVO) object);
	}

	/**
	 * 新增
	 * 
	 * @author xuhw on 2009-11-11
	 */
	@Override
	public Object insert(Object object) throws BusinessException
	{
		return CtymgtDelegator.getWaRuleExService().insertVO((AggWageformExVO) object);
	}

	/**
	 * 修改
	 * 
	 * @author xuhw on 2009-11-11
	 */
	@Override
	public Object update(Object object) throws BusinessException
	{
		return CtymgtDelegator.getWaRuleExService().updateVO((AggWageformExVO) object);
	}

	/**
	 * @author xuhw on 2009-11-11
	 */
	@Override
	public Object[] queryByDataVisibilitySetting(LoginContext context) throws BusinessException
	{
		return CtymgtDelegator.getWaRuleExQueryService().queryWageFormVO(context, null);
	}

	/**
	 * 复制表
	 * 
	 * @author xuhw on 2009-11-11
	 * @param object
	 * @return Object
	 * @throws Exception
	 */
	public Object copyTable(Object object) throws Exception
	{
		return CtymgtDelegator.getWaRuleExService().copyTable((AggWageformExVO) object);
	}
	
	/**
	 * 薪资项目查询服务
	 * @author xuhw on 2010-4-14 
	 * @return
	 */
	public IItemQueryService getItemQueryService()
	{
		if (service == null)
		{
			service = (IItemQueryService) NCLocator.getInstance().lookup(IItemQueryService.class);
		}
		return service;
	}
	
	/**
	 * 薪资项目查询服务
	 * @author xuhw on 2010-4-14 
	 * @return
	 */
	public IWaGradeQueryService getGradeQueryService()
	{
		if (gradeQueryservice == null)
		{
			gradeQueryservice =(IWaGradeQueryService) NCLocator.getInstance().lookup(IWaGradeQueryService.class);
		}
		return gradeQueryservice;
	}

}
