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

77 lines
2.7 KiB

using ESRI.ArcGIS.Controls;
using KGIS.Framework.Commands;
using KGIS.Framework.Maps;
using KGIS.Framework.Platform;
using KGIS.Framework.Utils;
using KGIS.Framework.Utils.Helper;
using Kingo.PluginServiceInterface;
using System;
namespace Kingo.Plugin.DTBYCL.Commands
{
public class CmdAllTasksList : BaseMenuCommand
{
public IHookHelper m_hookHelper;
public override void OnCreate(object hook)
{
if (hook == null)
{
return;
}
try
{
if (m_hookHelper == null)
{
m_hookHelper = new HookHelperClass();
m_hookHelper.Hook = hook;
}
}
catch
{
m_hookHelper = null;
return;
}
}
public override void OnClick()
{
try
{
ProjectInfo projectInfo = MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo;
var jcdltb = MapsManager.Instance.MapService.GetFeatureClassByName("DLTB");
if (string.IsNullOrWhiteSpace(projectInfo.JCKPath) && jcdltb == null)
{
MessageHelper.Show("请先使用“基础数据加载”功能设置基础库数据!");
return;
}
//if (string.IsNullOrWhiteSpace(projectInfo.UserName))
//{
// MessageHelper.Show("请先使用“用户信息设置”功能设置用户名!");
// return;
//}
//Platform.Instance.SendMsg(new KGIS.Framework.Utils.Interface.NotifyMsgPackage() { MsgType = "InitProject" });
//Platform.Instance.SendMsg(new KGIS.Framework.Utils.Interface.NotifyMsgPackage() { MsgType = "AfterLoadRefreshTreeData" });
Platform.Instance.SendMsg(new KGIS.Framework.Utils.Interface.NotifyMsgPackage() { Content = SystemTypeEnum.YCLJK, MsgType = "LoadDTBViewData" });
}
catch (Exception ex)
{
LogAPI.Debug("内业预审界面初始化失败" + ex.Message);
MessageHelper.ShowError("内业预审界面初始化失败:" + ex.Message);
}
}
public override bool Enabled
{
get
{
if (!(MapsManager.Instance.MapService.GetProjectInfo() is ProjectInfo projectInfo))
return false;
else if (string.IsNullOrWhiteSpace(projectInfo.DTBYCLYHDatabase))
{
return false;
}
return true;
}
}
}
}