using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Windows;
using System.Windows.Input;
using DevExpress.Xpf.Editors.Settings;
using DevExpress.Xpf.Grid;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.esriSystem;
using KGIS.Framework.DBOperator;
using KGIS.Framework.Maps;
using KGIS.Framework.Platform;
using KGIS.Framework.Utils;
using KGIS.Framework.Views;
using KGIS.Framework.Utils.Helper;
using KGIS.Framework.Utils.Interface;
using KGIS.Framework.AE;
using KGIS.Framework.AE.ExtensionMethod;
using ReactiveUI;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.DataSourcesGDB;
using System.IO;
using System.Runtime.InteropServices;
using KGIS.Framework.AE.GPHelper;
using KGIS.Framework.Platform.Helper;
using System.Windows.Forms;
using Kingo.Plugin.ResultsOfProof.Model;
using Kingo.Plugin.ResultsOfProof.View.JZTBXX;
using KGIS.Framework.Utils.ExtensionMethod;
using Kingo.PluginServiceInterface;
using Kingo.Plugin.ResultsOfProof.View.JZTBXX;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using KUI.Windows;
namespace Kingo.Plugin.ResultsOfProof.ViewModel
{
public class BGJZTBListViewModel : ReactiveObject
{
#region 变量
//切换工程后关闭Panel
public Action ClosePanel;
//用于定位
public IHookHelper m_hookHelper { get; set; }
///
/// 刷新数据Timer
///
private System.Timers.Timer RefreshTimer;
// public IPlatform Platform { get; set; }
///
/// 记录属性表是否正在刷新状态
///
private bool IsLoading = false;
//Dictionary dicFiled = new Dictionary();
//选中数据总数
int SelectCount = 0;
//用于导出Excel
private List lstDataColumnEx
{
get;
set;
}
///
/// 是否显示选中数据
///
private bool IsShowSelectData = false;
///
/// 当前图层
///
private IFeatureClass SourceFeature
{
get;
set;
}
private DataTable _Data;
///
/// 数据源集合
///
public DataTable Data
{
get { return _Data; }
set
{
this.RaiseAndSetIfChanged(ref _Data, value);
}
}
///
/// 主键字段名称
///
private string KeyIDName = "OBJECTID";
///
/// 控件加载全部按钮是否可操作
///
private bool IsLoadComplate
{
get
{
return IsLoadComplate;
}
set
{
//btnAll.IsEnabled = !value;
}
}
private int count;
///
/// 总数
///
public int Count { get { return count; } set { this.RaiseAndSetIfChanged(ref count, value); } }
private int showNum;
///
/// 当前显示数
///
public int ShowNum { get { return showNum; } set { this.RaiseAndSetIfChanged(ref showNum, value); } }
private bool _f_gjdlbyz;
///
/// 挂接地类不一致
///
public bool f_gjdlbyz { get { return _f_gjdlbyz; } set { this.RaiseAndSetIfChanged(ref _f_gjdlbyz, value); } }
private bool _f_wgj;
///
/// 未挂接
///
public bool f_wgj { get { return _f_wgj; } set { this.RaiseAndSetIfChanged(ref _f_wgj, value); } }
private bool _f_gjdtb;
///
/// 挂接多图斑
///
public bool f_gjdtb { get { return _f_gjdtb; } set { this.RaiseAndSetIfChanged(ref _f_gjdtb, value); } }
private string queryWhere = string.Empty;
///
/// 右键选中列名字
///
private string selectedFieldName = string.Empty;
private IFeatureLayer JZTBFeatureLayer = null;
private IFeatureLayer DLTBFeatureLayer = null;
private IFeatureClassAPI DLTBAPI = null;
private DataTable Data_WYHCFJ = null;
private DataTable Data_NYHS = null;
private IList currentSelectedItems = null;
public IList CurrentSelectedItems { get { return currentSelectedItems; } set { this.RaiseAndSetIfChanged(ref currentSelectedItems, value); } }
public DataRowView currentItem = null;
public DataRowView CurrentItem { get { return currentItem; } set { this.RaiseAndSetIfChanged(ref currentItem, value); } }
public bool IsMouseOver { get; set; }
private int cmbTypeSelectedIndex = 0;
public int CmbTypeSelectedIndex { get { return cmbTypeSelectedIndex; } set { this.RaiseAndSetIfChanged(ref cmbTypeSelectedIndex, value); } }
private bool tableViewPrintSelectedRowsOnly = false;
public bool TableViewPrintSelectedRowsOnly { get { return tableViewPrintSelectedRowsOnly; } set { this.RaiseAndSetIfChanged(ref tableViewPrintSelectedRowsOnly, value); } }
#endregion
#region GridControl命令
#region 输出Excel文档
public ReactiveCommand