年度变更建库软件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.
 
 

158 lines
5.6 KiB

using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geometry;
using Kingo.Plugin.EngineEditor.Entity;
using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Windows.Forms;
using KGIS.Framework.Utils;
namespace Kingo.Plugin.EngineEditor.ViewModel
{
public class InterlligentData2ViewModel : ReactiveObject, IScreen
{
public RoutingState Router => throw new NotImplementedException();
Dictionary<string, System.Data.DataTable> Keys = new Dictionary<string, System.Data.DataTable>();
private IFeatureLayer _featureLayer;
private int _iGeoOverRecordTotal;//图斑压盖情况 记录显示总数
public int iGeoOverRecordTotal { get => _iGeoOverRecordTotal; set => this.RaiseAndSetIfChanged(ref _iGeoOverRecordTotal, value); }
private int _iCheckRecordTotal;//图形规范性 记录显示总数
public int iCheckRecordTotal { get => _iCheckRecordTotal; set => this.RaiseAndSetIfChanged(ref _iCheckRecordTotal, value); }
private DataTable _GeoOverTable;
public DataTable GeoOverTable
{
get { return _GeoOverTable; }
set { this.RaiseAndSetIfChanged(ref _GeoOverTable, value); }
}
private DataTable _CheckTable;
public DataTable CheckTable
{
get { return _CheckTable; }
set { this.RaiseAndSetIfChanged(ref _CheckTable, value); }
}
//ObservableCollection<InterlligentEntity> _GeoOverList = new ObservableCollection<InterlligentEntity>();
//private ObservableCollection<InterlligentEntity> GeoOverList
//{
// get {
// return _GeoOverList;
// }
// set
// {
// SetProperty(ref GeoOverList, value);
// }
//}
//ObservableCollection<InterlligentEntity> GeoOverList = new ObservableCollection<InterlligentEntity>();
//ObservableCollection<InterlligentEntity> CheckList = new ObservableCollection<InterlligentEntity>();
private string _lableTitle = "检查通过";
public IGeometry Geometry
{
set
{
//白明雅 2020-04-10 图层授权验证
//if (!KGIS.Framework.Common.Utils.LicenseManager.Region(value))
//{
// MessageBox.Show("图斑不在授权范围内!");
// return;
//}
Keys = Unit.GeoOverCheck.GetData(value, FeatureLayer);
if (Keys["图形规范性"].Select("是否通过='不通过'").Count() > 0)
{
lableTitle = "检查未通过";
}
else
lableTitle = "检查通过";
GeoOverTable = Keys["图斑压盖"];
CheckTable = Keys["图形规范性"];
if (GeoOverTable == null || GeoOverTable.Rows.Count <= 0)
{
iGeoOverRecordTotal = 0;
}
else
{
iGeoOverRecordTotal = GeoOverTable.Rows.Count;
}
if (CheckTable == null || CheckTable.Rows.Count <= 0)
{
iCheckRecordTotal = 0;
}
else
{
iCheckRecordTotal = CheckTable.Rows.Count;
}
//SetGeoOver(Keys["图斑压盖"]);
//SetCheck(Keys["图形规范性"]);
}
}
public IFeatureLayer FeatureLayer
{
get => _featureLayer;
set
{
_featureLayer = value;
//白明雅 2020-04-10 图层授权验证
//if (!KGIS.Framework.Common.Utils.LicenseManager.Region(_featureLayer.FeatureClass))
//{
// MessageBox.Show(_featureLayer.Name + "图层不在授权范围内!");
// return;
//}
}
}
public string lableTitle
{
get => _lableTitle;
set
{
_lableTitle = value;
this.RaiseAndSetIfChanged(ref _lableTitle, value);
}
}
public void SetGeoOver(System.Data.DataTable table)
{
//GeoOverList.Clear();
//foreach (DataRow row in table.Rows)
//{
// GeoOverList.Add(
// new InterlligentEntity() {
// OID= row["OBJECTID"].ToString(),
// DLBM = row["DLBM"].ToString(),
// DLMC = row["DLMC"].ToString(),
// AREA = row["TBMJ"].ToString(),
// }
// );
//}
}
public void SetCheck(System.Data.DataTable table)
{
//CheckList.Clear();
//if (table.Select("是否通过='不通过'").Count() > 0)
//{
// lableTitle = "检查未通过";
//}else
// lableTitle = "检查通过";
//foreach (DataRow row in table.Rows)
//{
// CheckList.Add(
// new InterlligentEntity()
// {
// OID = row["检查项"].ToString(),
// DLBM = row["值"].ToString(),
// DLMC = row["是否通过"].ToString(),
// }
// );
//}
}
}
}