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.CommonPackDal;
import cn.net.caoyao.cpzshandset.db.dal.common.CommonPackPackageDal;
import cn.net.caoyao.cpzshandset.db.dal.common.CommonPackSubLabelDal;
import cn.net.caoyao.cpzshandset.db.dal.commonEgg.CommonEggPackDal;
import cn.net.caoyao.cpzshandset.db.dal.commonEgg.CommonEggPackPackageDal;
import cn.net.caoyao.cpzshandset.db.dal.commonEgg.CommonEggPackSubLabelDal;
import cn.net.caoyao.cpzshandset.db.dal.commonfarmers.CommonFarmersPackDal;
import cn.net.caoyao.cpzshandset.db.dal.commonfarmers.CommonFarmersPackPackageDal;
import cn.net.caoyao.cpzshandset.db.dal.commonfarmers.CommonFarmersPackSubLabelDal;
import cn.net.caoyao.cpzshandset.db.dal.liqueur.LiqueurPackDal;
import cn.net.caoyao.cpzshandset.db.dal.liqueur.LiqueurPackPackageDal;
import cn.net.caoyao.cpzshandset.db.dal.liqueur.LiqueurPackSubLabelDal;
import cn.net.caoyao.cpzshandset.db.presenter.PackDal;
import cn.net.caoyao.cpzshandset.db.presenter.PackPackageDal;
import cn.net.caoyao.cpzshandset.db.presenter.PackSubLabelDal;
import cn.net.caoyao.cpzshandset.service.presenter.OptionHisListStyleConstact;
import cn.net.caoyao.cpzshandset.service.presenter.PackConfigConstact;
import cn.net.caoyao.cpzshandset.service.presenter.SingleLabelScannerConstact;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.common.CommonPackConfigPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.common.CommonPackListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.common.CommonPackSingleLSPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.common.CommonPackSubListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.commonEgg.CommonEggPackConfigPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.commonEgg.CommonEggPackListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.commonEgg.CommonEggPackSingleLSPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.commonEgg.CommonEggPackSubListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.commonfarmers.CommonFarmersPackConfigPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.commonfarmers.CommonFarmersPackListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.commonfarmers.CommonFarmersPackSingleLSPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.commonfarmers.CommonFarmersPackSubListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.liqueur.LiqueurPackConfigPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.liqueur.LiqueurPackListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.liqueur.LiqueurPackSingleLSPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.pack.liqueur.LiqueurPackSubListPresenter;

public class PackConfigCreateTools {
	/**
	 * 获取打包列表的presenter
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public OptionHisListStyleConstact.Presenter createPackSubListPresenter(int handsetVersionMode, Context context,
			OptionHisListStyleConstact.View pView, Intent intent) {
		OptionHisListStyleConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			presenter = new CommonPackSubListPresenter( context,pView,intent);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			//白酒
			presenter = new LiqueurPackSubListPresenter(context,pView,intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			presenter = new CommonEggPackSubListPresenter( context,pView,intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版
			presenter = new CommonFarmersPackSubListPresenter( context,pView,intent);
			break;	
		}
		return presenter;
	}
	/**
	 * 获取打包列表的presenter
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public OptionHisListStyleConstact.Presenter createPackListPresenter(int handsetVersionMode, Context context,
			OptionHisListStyleConstact.View pView, Intent intent) {
		OptionHisListStyleConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			presenter = new CommonPackListPresenter(pView, 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_LIQUEUR_VERSION_MODE:
			//白酒
			presenter = new LiqueurPackListPresenter(pView, context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			presenter = new CommonEggPackListPresenter(pView, context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版
			presenter = new CommonFarmersPackListPresenter(pView, context);
			break;	
		}
		return presenter;
	}
	
	/**
	 * 获取打包配置的presenter
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public PackConfigConstact.Presenter createPackConfigPresenter(int handsetVersionMode, Context context,
			PackConfigConstact.View pView, Intent intent) {
		PackConfigConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			presenter = new CommonPackConfigPresenter(pView, context,intent);
			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_LIQUEUR_VERSION_MODE:
			//白酒
			presenter = new LiqueurPackConfigPresenter(pView, context, intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			presenter = new CommonEggPackConfigPresenter(pView, context,intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版
			presenter = new CommonFarmersPackConfigPresenter(pView, context,intent);
			break;	
		}
		return presenter;
	}
	
	/**
	 * 获取打包配置的presenter
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public SingleLabelScannerConstact.Presenter createPackSingleLabelScannerPresenter(int handsetVersionMode, Context context,
			SingleLabelScannerConstact.View pView, Intent intent) {
		SingleLabelScannerConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			presenter = new CommonPackSingleLSPresenter(pView, context, intent);
			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_LIQUEUR_VERSION_MODE:
			// 白酒
			presenter = new LiqueurPackSingleLSPresenter(pView, context, intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			presenter = new CommonEggPackSingleLSPresenter(pView, context, intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版养殖户
			presenter = new CommonFarmersPackSingleLSPresenter(pView, context, intent);
			break;	
		}
		return presenter;
	}
	
	/**
	 * 获取打包列表的 dal
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public PackDal createPackDal(int handsetVersionMode, Context context) {
		PackDal dal = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			dal = new CommonPackDal(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_LIQUEUR_VERSION_MODE:
			// 白酒
			dal = new LiqueurPackDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			dal = new CommonEggPackDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版
			dal = new CommonFarmersPackDal(context);
			break;	
		}
		return dal;
	}
	
	/**
	 * 获取打包列表的 dal
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public PackPackageDal createPackPackageDal(int handsetVersionMode, Context context) {
		PackPackageDal dal = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			dal = new CommonPackPackageDal(context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			// 白酒
			dal = new LiqueurPackPackageDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			dal = new CommonEggPackPackageDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版养殖户
			dal = new CommonFarmersPackPackageDal(context);
			break;	
			
		}
		return dal;
	}
	
	/**
	 * 获取打包列表的 dal
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public PackSubLabelDal createPackSubDal(int handsetVersionMode, Context context) {
		PackSubLabelDal dal = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			dal = new CommonPackSubLabelDal(context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			// 白酒
			dal = new LiqueurPackSubLabelDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			dal = new CommonEggPackSubLabelDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版
			dal = new CommonFarmersPackSubLabelDal(context);
			break;	
		}
		return dal;
	}
}
