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

import java.util.List;

import android.content.Context;
import cn.net.caoyao.cpzshandset.db.dal.commonfarmers.CommonFarmersFarmersDal;
import cn.net.caoyao.cpzshandset.db.presenter.FarmersDal;
import cn.net.cpzslibs.prot.handset.bean.res.FarmerBean;

public class FarmersBll {
	private FarmersDal dal;

	public FarmersBll(Context context) {
		dal = new CommonFarmersFarmersDal(context);
	}

	/**
	 * 插入产品列表到数据库
	 * 
	 * @param products
	 */
	public void insertFarmersList(List<FarmerBean> products) {
		if (dal == null || products == null)
			return;
		dal.insertFarmersList(products);
	}

	/**
	 * 删除所有的产品信息
	 */
	public void deleteAllFarmers() {
		if (dal == null)
			return;
		dal.deleteAllFarmers();
	};

	/**
	 * 获取所有的产品列表信息
	 * 
	 * @return
	 */
	public List<FarmerBean> queryAllFarmersInfo() {
		if (dal == null)
			return null;
		return dal.queryAllFarmersInfo();
	};

}
