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

import java.util.List;

import android.content.Context;
import cn.net.caoyao.cpzshandset.bean.ShipmentOnlineOrderBean;
import cn.net.caoyao.cpzshandset.common.config.ConfigDBCreateService;
import cn.net.caoyao.cpzshandset.common.util.CacheGet;
import cn.net.caoyao.cpzshandset.db.presenter.OnlineTruckInvoiceDal;
import cn.net.cpzslibs.prot.handset.bean.res.LogisticsOrderInfoBean;
import cn.net.cpzslibs.prot.handset.bean.res.YthOrderBean;

public class OnlineTruckInvoiceBll {
	private OnlineTruckInvoiceDal dal;
	public OnlineTruckInvoiceBll(Context context) {
		ConfigDBCreateService service = new ConfigDBCreateService();
		dal = service.createOnlineOrderDal(new CacheGet(), context);
//		dal = new YthScannerOnlineTruckInvoiceDal(context);
	}
	public void insertLogisticsOrderInfoBean(LogisticsOrderInfoBean b) {
		if(dal == null) return;
		dal.insertLogisticsOrderInfoBean(b);
		
	}
	public void insertOnlineInvoiceList(List<YthOrderBean> orderBeans){
		if(dal == null || orderBeans == null) return;
		dal.insertOnlineInvoiceList(orderBeans);
	}
	
	public void insertOnlineInvoice(YthOrderBean orderBean){
		if(dal == null || orderBean == null) return;
		dal.insertOnlineInvoice(orderBean);
	}
	
	public void deleteOrderBeanById(long id){
		if(dal == null) return;
		dal.deleteOrderBeanById(id);
	}
	
	public void deleteAllOrderBean(){
		if(dal == null) return;
		dal.deleteAllOrderBean();
	}
	
	public ShipmentOnlineOrderBean queryYthOrderById(long id){
		if(dal == null) return null;
		return dal.queryYthOrderById(id);
	}
	
	public void updateOnlineInvoiceStatusById(int error_code,int native_status,long id){
		if(dal == null) return;
		dal.updateOnlineInvoiceStatusById(error_code, native_status, id);
	}
	
	public List<ShipmentOnlineOrderBean> queryAllYthOrderASC(){
		if(dal == null) return null;
		return dal.queryAllYthOrderASC();
	}
	
	public List<ShipmentOnlineOrderBean> queryAllYthOrderDESC(){
		if(dal == null) return null;
		return dal.queryAllYthOrderDESC();
	}
	
	public boolean insertHasExist(long id){
		if(dal == null) return false;
		return dal.insertHasExist(id);
	}
}
