package cn.net.caoyao.cpzshandset.service.bll;

import java.util.List;

import android.content.Context;
import cn.net.caoyao.cpzshandset.common.config.ConfigCreateService;
import cn.net.caoyao.cpzshandset.common.util.CacheGet;
import cn.net.caoyao.cpzshandset.db.presenter.UserLoginDal;
import cn.net.cpzslibs.prot.handset.bean.res.ResponsibleUserInfoBean;

public class UserLoginBll {
	private UserLoginDal dal;
	public UserLoginBll(Context context) {
		ConfigCreateService service = new ConfigCreateService();
		dal = service.createLoginDal(new CacheGet(), context);
//		dal = new YthLoginUserInfoDal(context);
	}
	public List<ResponsibleUserInfoBean> queryAllUser() {
		if(dal == null) return null;
		return dal.queryAllUser();
	}

	public List<ResponsibleUserInfoBean> searchUserByCondition(String condition) {
		if(dal == null) return null;
		return dal.searchUserByCondition(condition);
	}

	/**
	 * 插入一个用户信息
	 * @param info
	 */
	public void insertUserInfo(ResponsibleUserInfoBean info){
		if(dal == null || info == null) return;
		dal.insertUserInfo(info);
	}
	
	/**
	 * 插入一组用户信息
	 * @param infos
	 */
	public void insertUserInfoList(List<ResponsibleUserInfoBean> infos){
		if(dal == null || infos == null) return;
		dal.insertUserInfoList(infos);
	}
	/**
	 * 删除所有的用户信息
	 */
	public void deleteAllUserInfo(){
		if(dal == null) return;
		dal.deleteAllUserInfo();
	}
	/**
	 * 根据账户名称查询用户信息
	 * @param account
	 * @return
	 */
	public ResponsibleUserInfoBean queryUserInfoByAccount(String account){
		if (dal == null) return null;
		return dal.queryUserInfoByAccount(account);
	}
	
	

}
