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.liqueurSFY.LiqueurSFYUserInfoDal;
import cn.net.caoyao.cpzshandset.db.dal.ythLogin.YthLoginUserInfoDal;
import cn.net.caoyao.cpzshandset.db.dal.ythPunit.YthPunitUserInfoDal;
import cn.net.caoyao.cpzshandset.db.dal.ythScaner.YthScannerUserInfoDal;
import cn.net.caoyao.cpzshandset.db.presenter.UserLoginDal;
import cn.net.caoyao.cpzshandset.service.presenter.LoginConstact;
import cn.net.caoyao.cpzshandset.service.presenter.impl.login.liqueurSFY.LiqueurSFYLoginPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.login.ythLogin.YthLoginLoginPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.login.ythPunit.YthPunitLoginPresenter;
import cn.net.caoyao.cpzshandset.service.presenter.impl.login.ythScanner.YthScannerLoginPresenter;

public class LoginConfigCreateTools {
	/**
	 * 获取首页的presenter
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public LoginConstact.Presenter createLoginPresenter(int handsetVersionMode, Context context,
			LoginConstact.View loginView, Intent intent) {
		LoginConstact.Presenter presenter = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_UNIVERSAL_VERSION_MODE:
			// 通用版
			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:
			//云天化图片版
			break;
		case HandsetVersionConstant.HANDSET_CHINATEX_VERSION_MODE:
			//中纺
			break;
		case HandsetVersionConstant.HANDSET_YTH_LOGIN_SHIPMENT_VERSION_MODE:
			//云天化登录版发货
			presenter = new YthLoginLoginPresenter(loginView, context);
			break;
		case HandsetVersionConstant.HANDSET_YTH_SCANNER_SHIPMENT_VERSION_MODE:
			presenter = new YthScannerLoginPresenter(loginView, context);
			break;
		case HandsetVersionConstant.HANDSET_YTH_SCANNER_SHIPMENT_PUNIT_VERSION_MODE:
			presenter = new YthPunitLoginPresenter(loginView, context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_SFY_VERSION_MODE:
			presenter = new LiqueurSFYLoginPresenter(loginView, context);
			break;
		}
		return presenter;
	}
	
	/**
	 * 获取首页的presenter
	 * @param cacheG
	 * @param context
	 * @param hisView
	 * @param intent
	 * @return
	 */
	public UserLoginDal createLoginDal(int handsetVersionMode, Context context) {
		UserLoginDal dal = null;

		switch (handsetVersionMode) {
		case HandsetVersionConstant.HANDSET_YTH_LOGIN_SHIPMENT_VERSION_MODE:
			//云天化登录版发货
			dal = new YthLoginUserInfoDal(context);
			break;
		case HandsetVersionConstant.HANDSET_YTH_SCANNER_SHIPMENT_VERSION_MODE:
			dal = new YthScannerUserInfoDal(context);
			break;
		case HandsetVersionConstant.HANDSET_YTH_SCANNER_SHIPMENT_PUNIT_VERSION_MODE:
			dal = new YthPunitUserInfoDal(context);
			break;
		case HandsetVersionConstant.HANDSET_LIQUEUR_SFY_VERSION_MODE:
			//世方御
			dal = new LiqueurSFYUserInfoDal(context);
			break;
		}
		return dal;
	}
}
