using System.Collections.Generic; using System.Xml.Linq; namespace Kingo.Plugin.YJJK.ModelEntity { public class LandTypeDicHelper { /// /// 获取二级地类地类编码和地类名称对应字典 /// /// public static Dictionary GetLevel2LandTypeDic() { Dictionary dic = new Dictionary(); string ConfigPath = System.IO.Path.Combine(KGIS.Framework.Utils.SysAppPath.GetConfigPath(), "CommonlyDic.xml"); XDocument SystemConfigDocument = XDocument.Load(ConfigPath); var elements = SystemConfigDocument.Element("Root").Elements(); foreach (XElement item in elements) { dic.Add(item.Attribute("DLBM").Value, item.Element("DLMC").Value); } return dic; } /// /// 获取一级地类地类编码和地类名称对应字典 /// /// public static Dictionary GetLevel1LandTypeDic() { Dictionary dic = new Dictionary(); string ConfigPath = System.IO.Path.Combine(KGIS.Framework.Utils.SysAppPath.GetConfigPath(), "CommonlyDic.xml"); XDocument SystemConfigDocument = XDocument.Load(ConfigPath); var elements = SystemConfigDocument.Element("Root").Elements(); foreach (XElement item in elements) { if (dic.ContainsKey(item.Element("YJDLBM").Value)) continue; dic.Add(item.Element("YJDLBM").Value, item.Element("YJDLMC").Value); } return dic; } /// /// 获取二级地类地类编码和一级地类地类编码对应字典 /// /// public static Dictionary GetLevel2ToLevel1LandTypeDic() { Dictionary dic = new Dictionary(); string ConfigPath = System.IO.Path.Combine(KGIS.Framework.Utils.SysAppPath.GetConfigPath(), "CommonlyDic.xml"); XDocument SystemConfigDocument = XDocument.Load(ConfigPath); var elements = SystemConfigDocument.Element("Root").Elements(); foreach (XElement item in elements) { dic.Add(item.Attribute("DLBM").Value, item.Element("YJDLBM").Value); } return dic; } /// /// 获取二级地类地类编码和三大类对应字典 /// /// public static Dictionary GetLevel0LandTypeDic() { Dictionary dic = new Dictionary(); string ConfigPath = System.IO.Path.Combine(KGIS.Framework.Utils.SysAppPath.GetConfigPath(), "CommonlyDic.xml"); XDocument SystemConfigDocument = XDocument.Load(ConfigPath); var elements = SystemConfigDocument.Element("Root").Elements(); foreach (XElement item in elements) { dic.Add(item.Attribute("DLBM").Value, item.Element("SDL").Value); } return dic; } } }