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.service.presenter.OptionHisListStyleConstact;
import cn.net.caoyao.cpzshandset.service.presenter.SingleLabelScannerConstact;
import cn.net.caoyao.cpzshandset.service.presenter.WarehouseConfigConstact;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.in.common.CommonInWarehouseConfigPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.in.common.CommonInWarehouseListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.in.common.CommonInWarehouseSingleLSPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.in.commonEgg.CommonEggInWarehouseConfigPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.in.commonEgg.CommonEggInWarehouseListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.in.commonEgg.CommonEggInWarehouseSingleLSPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.in.commonfarmers.CommonFarmersInWarehouseConfigPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.in.commonfarmers.CommonFarmersInWarehouseListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.in.commonfarmers.CommonFarmersInWarehouseSingleLSPresenter;

public class InWarehouseConfigCreateTools {
	/**
	 * 获取入库列表的presenter
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public OptionHisListStyleConstact.Presenter createInWarehouseListPresenter(int handsetVersionMode, Context context,
			OptionHisListStyleConstact.View hisView, Intent intent) {
		OptionHisListStyleConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			presenter = new CommonInWarehouseListPresenter(hisView, context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			presenter = new CommonEggInWarehouseListPresenter(hisView, context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版养殖户
			presenter = new CommonFarmersInWarehouseListPresenter(hisView, context);
			break;	
		}
		return presenter;
	}
	
	/**
	 * 获取入库列表的presenter
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public WarehouseConfigConstact.Presenter createInWarehouseConfigPresenter(int handsetVersionMode, Context context,
			WarehouseConfigConstact.View wView, Intent intent) {
		WarehouseConfigConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			presenter = new CommonInWarehouseConfigPresenter(wView, context,intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			presenter = new CommonEggInWarehouseConfigPresenter(wView, context,intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版
			presenter = new CommonFarmersInWarehouseConfigPresenter(wView, context,intent);
			break;	
		}
		return presenter;
	}
	
	/**
	 * 获取入库列表的presenter
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public SingleLabelScannerConstact.Presenter createInWarehouseSingleLabelScannerPresenter(int handsetVersionMode, Context context,
			SingleLabelScannerConstact.View sView, Intent intent) {
		SingleLabelScannerConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			presenter = new CommonInWarehouseSingleLSPresenter(sView, context,intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			presenter = new CommonEggInWarehouseSingleLSPresenter(sView, context,intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版
			presenter = new CommonFarmersInWarehouseSingleLSPresenter(sView, context,intent);
			break;	
		}
		return presenter;
	}
}
