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.CommonDealerDal;
import cn.net.caoyao.cpzshandset.db.dal.common.CommonDealerOutDal;
import cn.net.caoyao.cpzshandset.db.dal.common.CommonSalesDal;
import cn.net.caoyao.cpzshandset.db.dal.commonEgg.CommonEggSalesDal;
import cn.net.caoyao.cpzshandset.db.dal.commonfarmers.CommonFarmersSalesDal;
import cn.net.caoyao.cpzshandset.db.dal.liqueur.LiqueurDealerDal;
import cn.net.caoyao.cpzshandset.db.dal.liqueur.LiqueurSalesDal;
import cn.net.caoyao.cpzshandset.db.dal.liqueurSFY.LiqueurSFYDealerDal;
import cn.net.caoyao.cpzshandset.db.dal.liqueurSFY.LiqueurSFYSalesDal;
import cn.net.caoyao.cpzshandset.db.dal.sheepEx.SheepExDealerDal;
import cn.net.caoyao.cpzshandset.db.presenter.DealerDal;
import cn.net.caoyao.cpzshandset.db.presenter.DealerOutDal;
import cn.net.caoyao.cpzshandset.db.presenter.SalesDal;
import cn.net.caoyao.cpzshandset.db.presenter.SheepDealerDal;
import cn.net.caoyao.cpzshandset.service.presenter.BatchLabelScannerConstact;
import cn.net.caoyao.cpzshandset.service.presenter.OptionHisListStyleConstact;
import cn.net.caoyao.cpzshandset.service.presenter.SaleConfigConstact;
import cn.net.caoyao.cpzshandset.service.presenter.SearchInputStyleConstact;
import cn.net.caoyao.cpzshandset.service.presenter.SingleLabelScannerConstact;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.common.CommonSaleConfigPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.common.CommonSaleListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.common.CommonSalesSingleLSPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.commonEgg.CommonEggSaleConfigPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.commonEgg.CommonEggSaleListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.commonEgg.CommonEggSalesSingleLSPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.commonfarmers.CommonFarmersSaleConfigPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.commonfarmers.CommonFarmersSaleListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.commonfarmers.CommonFarmersSalesSingleLSPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.liqueur.LiqueurChoiceDealerPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.liqueur.LiqueurSaleConfigPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.liqueur.LiqueurSaleListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.liqueur.LiqueurSalesSingleLSPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.liqueurSFY.LiqueurSFYSaleConfigPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.liqueurSFY.LiqueurSFYSaleListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.sale.liqueurSFY.LiqueurSFYSalesSingleLSPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.dealerOut.common.CommonDealerOutBatchLSPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.dealerOut.common.CommonDealerOutChoiceDealerPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.dealerOut.common.CommonDealerOutListPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.warehouse.dealerOut.common.CommonDealerOutSingleLSPresenter;

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

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			 presenter = new CommonSaleListPresenter(hisView, context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			// 云天化
			presenter = new LiqueurSaleListPresenter(hisView, context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			 presenter = new CommonEggSaleListPresenter(hisView, context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版
			 presenter = new CommonFarmersSaleListPresenter(hisView, context);
			break;	
		case HandsetVersionConstant.HANDSET_LIQUEUR_SFY_VERSION_MODE:
			presenter = new LiqueurSFYSaleListPresenter(hisView, context);
			break;
	
			
		}
		return presenter;
	}
	/**
	 * 获取销售列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public OptionHisListStyleConstact.Presenter createDealerOutListPresenter(int handsetVersionMode, Context context,
			OptionHisListStyleConstact.View hisView, Intent intent) {
		OptionHisListStyleConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			 presenter = new CommonDealerOutListPresenter(hisView, context);
			break;
			
		}
		return presenter;
	}
	/**
	 * 获取销售列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public SearchInputStyleConstact.Presenter createDealerChoicePresenter(int handsetVersionMode, Context context,
			SearchInputStyleConstact.View sView, Intent intent) {
		SearchInputStyleConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			// 白酒
			presenter = new LiqueurChoiceDealerPresenter(sView, context, intent);
			break;
		}
		return presenter;
	}
	
	/**
	 * 获取销售列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public SearchInputStyleConstact.Presenter createDealerOutChoicePresenter(int handsetVersionMode, Context context,
			SearchInputStyleConstact.View sView, Intent intent) {
		SearchInputStyleConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			presenter = new CommonDealerOutChoiceDealerPresenter(sView, context, intent);
			break;
		}
		return presenter;
	}
	
	/**
	 * 获取销售列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public SaleConfigConstact.Presenter createSaleConfigPresenter(int handsetVersionMode, Context context,
			SaleConfigConstact.View sView, Intent intent) {
		SaleConfigConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			 presenter = new CommonSaleConfigPresenter(sView, context,intent);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			// 白酒
			presenter = new LiqueurSaleConfigPresenter(sView, context, intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			 presenter = new CommonEggSaleConfigPresenter(sView, context,intent);
			break;
			
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版
			 presenter = new CommonFarmersSaleConfigPresenter(sView, context,intent);
			break;	
		case HandsetVersionConstant.HANDSET_LIQUEUR_SFY_VERSION_MODE:
			presenter = new LiqueurSFYSaleConfigPresenter(sView, context, intent);
			break;
		}
		return presenter;
	}
	
	/**
	 * 获取销售列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public SingleLabelScannerConstact.Presenter createSaleSingleLabelScannerPresenter(int handsetVersionMode, Context context,
			SingleLabelScannerConstact.View sView, Intent intent) {
		SingleLabelScannerConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			 presenter = new CommonSalesSingleLSPresenter(sView, context, intent);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			// 白酒
			presenter = new LiqueurSalesSingleLSPresenter(sView, context, intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			 presenter = new CommonEggSalesSingleLSPresenter(sView, context, intent);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版养殖户
			 presenter = new CommonFarmersSalesSingleLSPresenter(sView, context, intent);
			break;	
		case HandsetVersionConstant.HANDSET_LIQUEUR_SFY_VERSION_MODE:
			presenter = new LiqueurSFYSalesSingleLSPresenter(sView, context, intent);
			break;
		}
		return presenter;
	}
	
	/**
	 * 获取销售列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public SingleLabelScannerConstact.Presenter createDealerOutSingleLabelScannerPresenter(int handsetVersionMode, Context context,
			SingleLabelScannerConstact.View sView, Intent intent) {
		SingleLabelScannerConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			 presenter = new CommonDealerOutSingleLSPresenter(sView, context, intent);
			break;
		}
		return presenter;
	}
	
	/**
	 * 获取销售列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public BatchLabelScannerConstact.Presenter createDealerOutBatchLabelScannerPresenter(int handsetVersionMode, Context context,
			BatchLabelScannerConstact.View sView, Intent intent) {
		BatchLabelScannerConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			 presenter = new CommonDealerOutBatchLSPresenter(sView, context, intent);
			break;
		}
		return presenter;
	}
	
	/**
	 * 获取销售列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public SalesDal createSalesDal(int handsetVersionMode, Context context) {
		SalesDal dal = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			 dal = new CommonSalesDal(context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			// 白酒
			dal = new LiqueurSalesDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_EGG_VERSION_MODE:
			// 通用鸡蛋版
			 dal = new CommonEggSalesDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE_FARMERS:
			// 通用版养殖户
			 dal = new CommonFarmersSalesDal(context);
			break;	
		case HandsetVersionConstant.HANDSET_LIQUEUR_SFY_VERSION_MODE:
			dal = new LiqueurSFYSalesDal(context);
			break;
			
		}
		return dal;
	}
	
	/**
	 * 获取销售列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public DealerOutDal createDealerOutDal(int handsetVersionMode, Context context) {
		DealerOutDal dal = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			 dal = new CommonDealerOutDal(context);
			break;
			
		}
		return dal;
	}
	/**
	 * 获取销售列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public DealerDal createDealerDal(int handsetVersionMode, Context context) {
		DealerDal dal = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_LIQUEUR_VERSION_MODE:
			// 云天化
			dal = new LiqueurDealerDal(context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_SFY_VERSION_MODE:
			//世方御
			 dal = new LiqueurSFYDealerDal(context);
			break;	
			
		}
		return dal;
	}
	
	/**
	 * 获取销售列表的presenter
	 * 
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public SheepDealerDal createSheepDealerDal(int handsetVersionMode, Context context) {
		SheepDealerDal dal = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_SHEEP_EXCHANGE_CARGO:
			// 羊老大
			dal = new SheepExDealerDal(context);
			break;
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			//通用版
			 dal = new CommonDealerDal(context);
			break;	
			
		}
		return dal;
	}
}
