年度变更建库软件5.0版本
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

111 lines
3.8 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using KGIS.Framework.Utils;
using Kingo.Plugin.EngineEditor.Model;
using Kingo.Plugin.EngineEditor.Unit;
namespace Kingo.Plugin.EngineEditor.helper
{
public class ConfigHelper
{
public static List<string> GetResultsCatalog(CheckTypeEnum typeEnum)
{
List<string> result = new List<string>();
try
{
XmlDocument doc = new XmlDocument();
string strPath = SysAppPath.GetGeoCheckCfgPath();
doc.Load(strPath);
XmlNode nodeDataCatalog = doc.SelectSingleNode("Infornation");
if (nodeDataCatalog == null)
return result;
switch(typeEnum)
{
case CheckTypeEnum.GeoOverInfor: result.AddRange(GetInfor("图斑压盖", nodeDataCatalog)); break;
case CheckTypeEnum.GeoCheckInfor: result.AddRange(GetInfor("图形规范性", nodeDataCatalog)); break;
default:break;
}
return result;
}
catch (Exception ex)
{
LogAPI.Debug(ex);
throw;
}
}
private static List<string> GetInfor(string Title, XmlNode nodeDataCatalog)
{
List<string> Columns = new List<string>();
foreach (XmlNode item in nodeDataCatalog.ChildNodes)
{
if (item.Attributes["Name"].Value.ToString() == Title)
{
foreach (XmlNode col in item.ChildNodes)
{
Columns.Add(col.Attributes["Name"].Value == null ? "" : col.Attributes["Name"].Value);
}
}
}
return Columns;
}
public static List<string> GetInfor(string NodeName)
{
List<string> Columns = new List<string>();
try
{
XmlDocument doc = new XmlDocument();
string strPath = SysAppPath.GetGeoCheckCfgPath();
doc.Load(strPath);
XmlNode nodeDataCatalog = doc.SelectSingleNode(NodeName);
if (nodeDataCatalog == null)
return Columns;
foreach (XmlNode item in nodeDataCatalog.ChildNodes)
{
Columns.Add(item.Attributes["Name"].Value == null ? "" : item.Attributes["Name"].Value);
}
return Columns;
} catch (Exception ex)
{
LogAPI.Debug(ex);
return Columns;
}
}
public static Dictionary<string,string> GetColumnsInFor
{
get {
Dictionary<string, string> pairs = new Dictionary<string, string>();
try
{
XmlDocument doc = new XmlDocument();
string strPath = SysAppPath.GetGeoCheckCfgPath();
doc.Load(strPath);
XmlNode nodeDataCatalog = doc.SelectSingleNode("Infornation");
if (nodeDataCatalog == null)
return null;
foreach (XmlNode item in nodeDataCatalog.ChildNodes)
{
foreach (XmlNode col in item.ChildNodes)
{
pairs.Add(col.Attributes["Name"].Value, col.Attributes["displayName"].Value);
}
}
return pairs;
}
catch (Exception ex)
{
LogAPI.Debug(ex);
return null;
}
}
}
}
}