package cn.net.caoyao.cpzshandset.service.presenter.tools;

import android.content.Context;
import android.content.Intent;
import cn.net.caoyao.cpzshandset.common.config.HandsetVersionConstant;
import cn.net.caoyao.cpzshandset.db.dal.common.CommonProductDal;
import cn.net.caoyao.cpzshandset.db.dal.commonEgg.CommonEggProductDal;
import cn.net.caoyao.cpzshandset.db.dal.commonfarmers.CommonFarmersProductDal;
import cn.net.caoyao.cpzshandset.db.dal.liqueur.LiqueurProductDal;
import cn.net.caoyao.cpzshandset.db.dal.liqueurSFY.LiqueurSFYProductDal;
import cn.net.caoyao.cpzshandset.db.dal.ythImage.YthImageProductDal;
import cn.net.caoyao.cpzshandset.db.presenter.ProductDal;
import cn.net.caoyao.cpzshandset.service.presenter.ProductDetailListConstact;
import cn.net.caoyao.cpzshandset.service.presenter.impl.activate.common.CommonProductListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.activate.commonEgg.CommonEggProductListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.activate.commonfarmers.CommonFarmersProductListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.activate.liqueur.LiqueurProductListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.activate.ythImage.YthImageProductListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.activateWithRelation.liqueurSFY.LiqueurSFYProductListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.packRelation.bottleBox.JinLineProductListPresenter;

public class ProductConfigCreateTools {
	/**
	 * 创建产品列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param pLView
	 * @param intent
	 * @return
	 */
	public ProductDetailListConstact.Presenter createProductListPresenter(int handsetVersionMode, Context context,
			ProductDetailListConstact.View pLView, Intent intent) {
		ProductDetailListConstact.Presenter presenter = null;
		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版 
			presenter = new CommonProductListPresenter(pLView, context);
			break;
		case HandsetVersionConstant.HANDSET_RICE_VERSION_MODE:
			// 大米
			break;
		case HandsetVersionConstant.HANDSET_HOLOTHURIAN_VERSION_MODE:
			// 海参
			break;
		case HandsetVersionConstant.HANDSET_WINE_TERMINAL_VERSION_MODE:
			// 酒终端
			break;
		case HandsetVersionConstant.HANDSET_WINE_DEALER_VERSION_MODE:
			// 酒经销商
			break;
		case HandsetVersionConstant.HANDSET_FIRE_EXTINGUISHER_VERSION_MODE:
			// 灭火器
			break;
		case HandsetVersionConstant.HANDSET_AGRICULTURAL_PRODUCTS_VERSION_MODE:
			// 农产品
			break;
		case HandsetVersionConstant.HANDSET_SEED_VERSION_MODE:
			// 种子
			break;
		case HandsetVersionConstant.HANDSET_YTH_VERSION_MODE:
			// 云天化
			break;
		case HandsetVersionConstant.HANDSET_YTH_IMAGE_VERSION_MODE:
			presenter = new YthImageProductListPresenter(pLView, context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			presenter = new LiqueurProductListPresenter(pLView, context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版 
			presenter = new CommonEggProductListPresenter(pLView, context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版养殖户
			presenter = new CommonFarmersProductListPresenter(pLView, context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_SFY_VERSION_MODE:
			//世方御
			presenter = new LiqueurSFYProductListPresenter(pLView, context);
			break;
		case HandsetVersionConstant.HANDSET_JIN_LIQUOR_PRODUCT_LINE_VERSION_MODE:
			presenter = new JinLineProductListPresenter(pLView, context);
			break;
		}
		return presenter;
	}
	
	/**
	 * 创建产品列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param pLView
	 * @param intent
	 * @return
	 */
	public ProductDal createProductDal(int handsetVersionMode, Context context) {
		ProductDal dal = null;
		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版 
			dal = new CommonProductDal(context);
			break;
		case HandsetVersionConstant.HANDSET_RICE_VERSION_MODE:
			// 大米
			break;
		case HandsetVersionConstant.HANDSET_HOLOTHURIAN_VERSION_MODE:
			// 海参
			break;
		case HandsetVersionConstant.HANDSET_WINE_TERMINAL_VERSION_MODE:
			// 酒终端
			break;
		case HandsetVersionConstant.HANDSET_WINE_DEALER_VERSION_MODE:
			// 酒经销商
			break;
		case HandsetVersionConstant.HANDSET_FIRE_EXTINGUISHER_VERSION_MODE:
			// 灭火器
			break;
		case HandsetVersionConstant.HANDSET_AGRICULTURAL_PRODUCTS_VERSION_MODE:
			// 农产品
			break;
		case HandsetVersionConstant.HANDSET_SEED_VERSION_MODE:
			// 种子
			break;
		case HandsetVersionConstant.HANDSET_YTH_VERSION_MODE:
			// 云天化
			break;
			//云天化图片版
		case HandsetVersionConstant.HANDSET_YTH_IMAGE_VERSION_MODE:
			dal = new YthImageProductDal(context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			dal = new LiqueurProductDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版 
			dal = new CommonEggProductDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版 养殖户
			dal = new CommonFarmersProductDal(context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_SFY_VERSION_MODE:
			//世方御
			dal = new LiqueurSFYProductDal(context);
			break;
		}
		return dal;
	}
}
