using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain;

namespace Service.Implement
{
    public class SysProvinceManager : GenericManagerBase<SysProvince>, ISysProvinceManager
    {
        public Dao.ISysCityRepository SysCityRepository { get; set; }

        public Dao.ISysCountyRepository SysCountyRepository { get; set; }

        public IList<SysCity> LoadAllCity()
        {
            return SysCityRepository.LoadAll().ToList();
        }

        public IList<SysCity> GetCity(string provinceCoe)
        {
            return SysCityRepository.LoadAll().Where(r => r.ProvinceCode == provinceCoe).ToList();
        }

        public IList<SysCounty> LoadAllCounty()
        {
            return SysCountyRepository.LoadAll().ToList();
        }

        public IList<SysCounty> GetCounty(string cityCoe)
        {
            return SysCountyRepository.LoadAll().Where(r => r.CityCode == cityCoe).ToList();
        }
    }
}
