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

import java.util.List;
import java.util.Map;

import android.content.Context;
import cn.net.caoyao.cpzshandset.common.config.ConfigDBCreateService;
import cn.net.caoyao.cpzshandset.common.util.CacheGet;
import cn.net.caoyao.cpzshandset.db.presenter.CertificateDal;
import cn.net.cpzslibs.prot.handset.bean.Prot10064ZhengShuBean;

/**
 * @author 作者 李扬:
 * @date 创建时间：2017-3-28 上午10:17:29
 * @version 1.0
 * @parameter
 * @since
 * @return
 */
public class CertificateBll {
	private CertificateDal dal;

	public CertificateBll(Context context) {
		ConfigDBCreateService service = new ConfigDBCreateService();
		dal = service.createCertificateDal(new CacheGet(), context);
	}

	/**
	 * 插入证书列表
	 * 
	 * @param products
	 */
	public void insertCertificateList(List<Prot10064ZhengShuBean> products) {
		if (dal == null) {
			return;
		}
		dal.insertCertificateList(products);
	}

	/**
	 * 删除基地列表
	 */
	public void deleteAllProduct() {
		if (dal == null) {
			return;
		}
		dal.deleteAllProduct();
	}

	/**
	 * 查找证书
	 * 
	 * @return
	 */
	public List<Map<String, String>> findCertificate() {
		if (dal == null) {
			return null;
		}
		return dal.findCertificate();
	}

}
