using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using JuSNS.Model;
using System.Data;
using System.Data.SqlClient;

namespace JuSNS.Factory
{
    public interface IDict
    {
        /// <summary>
        /// 获取省市列表
        /// </summary>
        /// <returns></returns>
        List<DictAreaInfo> GetArea();

        /// <summary>
        /// 取得城市列表
        /// </summary>
        /// <param name="ParertID"></param>
        /// <returns></returns>
        List<DictAreaInfo> CityList(int ParertID);

        int GetParentCity(int Cid);

        DictAreaInfo Info(int ID);
         /// <summary>
        /// 取得地区的名字
        /// </summary>
        /// <param name="areaId"></param>
        /// <returns></returns>
        string GetAreaName(int areaId);
        /// <summary>
        /// 根据名称取得地区ID
        /// </summary>
        /// <param name="areaname">地域名称</param>
        /// <returns></returns>
        int GetAreaID(string areaname);
    }
    public sealed partial class DataAccess
    {
        public static IDict CreateDict()
        {
            string className = path + ".Dict";
            return (IDict)Assembly.Load(path).CreateInstance(className);
        }
    }
}
