package cn.net.caoyao.cpzshandset.service.bll;

import java.util.List;

import android.content.Context;
import cn.net.caoyao.cpzshandset.bean.ExchangeCargoBean;
import cn.net.caoyao.cpzshandset.db.dal.sheepEx.SheepExchangeCargoDal;
import cn.net.caoyao.cpzshandset.db.presenter.ExchangeCargoDal;

public class ExchangeCargoBll {
	private ExchangeCargoDal dal;
	public ExchangeCargoBll(Context context) {
		dal = new SheepExchangeCargoDal(context);
	}
	
	/**
	 * 插入调货信息
	 * @param b
	 * @return
	 */
	public int insertExchangeCargo(ExchangeCargoBean b){
		if(dal == null || b == null) return -1;
		return dal.insertExchangeCargo(b);
	}
	/**
	 * 通过id更新调货信息
	 * @param b
	 */
	public void updateExchangeCargoById(ExchangeCargoBean b){
		if(dal == null || b == null) return;
		dal.updateExchangeCargoById(b);
	}
	/**
	 * 根据调货id，更新调货的状态信息
	 * @param status
	 * @param error_code
	 * @param id
	 */
	public void updateExchangeCargoStatusById(int status,int error_code,int id){
		if(dal == null) return;
		dal.updateExchangeCargoStatusById(status, error_code, id);
	}
	/**
	 * 通过id删除调货信息
	 * @param id
	 * @param option_mode
	 */
	public void deleteExchangeCargoById(ExchangeCargoBean b){
		if(dal == null || b == null) return;
		dal.deleteExchangeCargoById(b);
	}
	/**
	 * 查询所有的调货信息
	 * @return
	 */
	public List<ExchangeCargoBean> queryAllExchangeCargoDesc(){
		if(dal == null) return null;
		return dal.queryAllExchangeCargoDesc();
	}
	/**
	 * 查询所有的调货信息
	 * @return
	 */
	public List<ExchangeCargoBean> queryAllExchangeCargoAsc(){
		if(dal == null) return null;
		return dal.queryAllExchangeCargoAsc();
	}
	/**
	 * 通过调货id查询调货信息
	 * @param id
	 * @return
	 */
	public ExchangeCargoBean queryExchangeCargoById(int id){
		if(dal == null) return null;
		return dal.queryExchangeCargoById(id);
	}

}
