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

import java.util.List;

import android.content.Context;

import cn.net.caoyao.cpzshandset.db.dal.yth.YthTrainStationDal;
import cn.net.caoyao.cpzshandset.db.presenter.TrainStationDal;
import cn.net.cpzslibs.prot.handset.bean.res.TrainStationBean;

public class TrainStationBll {
	private TrainStationDal dal;
	public TrainStationBll(Context context) {
		dal = new YthTrainStationDal(context);
	}
	
	/**
	 * 插入所有的火车站台信息
	 * @param stationBean
	 */
	public void insertAllTrainStaion(List<TrainStationBean> stationBeans){
		if (dal == null || stationBeans == null) {
			return;
		}
		dal.insertAllTrainStaion(stationBeans);
	}
	/**
	 * 插入火车站台的信息
	 * @param stationBean
	 */
	public void insertTrainStaion(TrainStationBean stationBean){
		if (dal == null) {
			return;
		}
		dal.insertTrainStaion(stationBean);
	}
	/**
	 * 查询所有的火车车站信息
	 * @return
	 */
	public List<TrainStationBean>  queryAllStationInfo(){
		if (dal == null) {
			return null;
		}
		return dal.queryAllStationInfo();
	}
	/**
	 * 通过省份简称查询火车车站信息
	 * @param provinceCode
	 * @return
	 */
	public List<TrainStationBean> queryStationByProvinceCode(String provinceCode){
		if (dal == null) {
			return null;
		}
		return dal.queryStationByProvinceCode(provinceCode);
	}
	
	public List<TrainStationBean> searchTrainStationByCondition(String provinceCode,String condition){
		if (dal == null) {
			return null;
		}
		return dal.searchTrainStationByCondition(provinceCode, condition);
	}
	/**
	 * 通过车站id查询车站信息
	 * @param id
	 * @return
	 */
	public TrainStationBean queryStationById(int id){
		if (dal == null) {
			return null;
		}
		return dal.queryStationById(id);
	}
	/**
	 * 查询所有的省份简称
	 * @return
	 */
	public List<String> queryAllProvinceCode(){
		if (dal == null) {
			return null;
		}
		return dal.queryAllProvinceCode();
	}
	/**
	 * 删除所有的车站信息
	 */
	public void deleteAllStation(){
		if (dal == null) {
			return;
		}
		dal.deleteAllStation();
	}


}
