using ESRI.ArcGIS.Carto; using ESRI.ArcGIS.ADF.BaseClasses; using ESRI.ArcGIS.Controls; using KGIS.Framework.Utils; using KGIS.Framework.Utils.Helper; using KGIS.Framework.Utils.Interface; using KGIS.Plugin.ResultsManage.View; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using KGIS.Framework.Platform; namespace KGIS.Plugin.ResultsManage.Commands { public class JZCGImportCommand : BaseMenuCommand { private IHookHelper hookHelper = null; public override void OnCreate(object hook) { if (hookHelper == null) { hookHelper = new HookHelperClass(); } hookHelper.Hook = hook; } public override void OnClick() { try { //KGIS.Framework.Common.Utils.LicenseManager.License(); } catch { } IEngineEditor pEditor = new EngineEditorClass(); if (pEditor.EditState == esriEngineEditState.esriEngineStateEditing) { MessageHelper.ShowTips("请先关闭编辑!"); return; } IFeatureLayer pDLTBBGFeatureLayer = Platform.Instance.MapsService.GetFeatureLayerByName("DLTBBG"); if (pDLTBBGFeatureLayer == null || pDLTBBGFeatureLayer.FeatureClass == null) { MessageHelper.ShowTips("未找到地类图斑变更图层!"); return; } else { if (pDLTBBGFeatureLayer.FeatureClass.FeatureCount(null) == 0) { KGIS.Framework.Utils.Helper.MessageHelper.ShowTips("地类图斑变更表数据为空,请先导入地类图斑变更数据!"); return; } } IFeatureLayer pJZFeatureLayer = Platform.Instance.MapsService.GetFeatureLayerByName("JZCG"); if (pJZFeatureLayer == null || pJZFeatureLayer.FeatureClass == null) { MessageHelper.ShowTips("未找到举证成果图层!"); return; } FrmJZCGImport main = new FrmJZCGImport(hookHelper); main.Closed += main_Closed; main.Width = 600; main.Height = 215; main.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; main.Left = 240; main.Top = 110; main.Title = "导入举证成果"; main.ShowInMainWindow(false); } void main_Closed(object sender, EventArgs e) { //if (!(sender as FrmBaseDataLoad).IsCancel) //{ // NotifyMsgPackage msg = new NotifyMsgPackage(); // msg.MsgType = "OpenPrj"; // SetNotifyMsg(msg); //} } public event Action NotifyMsgEven; public void SetNotifyMsg(NotifyMsgPackage msg) { try { if (NotifyMsgEven != null) NotifyMsgEven(msg); } catch (Exception ex) { MessageHelper.ShowError(ex.Message); } } public override string Caption { get { return "举证成果导入"; } } public override bool Enabled { get { KGIS.Framework.Utils.Model.ProjectInfo pTemp = KGIS.Framework.Platform.Platform.Instance.GetProjectInfo(); if (pTemp == null) { return false; } else { if (string.IsNullOrWhiteSpace(pTemp.GetProjDBPath())) { return false; } else { return true; } } } } } }