|
|
|
|
using ESRI.ArcGIS.Controls;
|
|
|
|
|
using KGIS.Framework.Commands;
|
|
|
|
|
using KGIS.Framework.Maps;
|
|
|
|
|
using KGIS.Framework.Utils.Helper;
|
|
|
|
|
using Kingo.Plugin.General.ViewDTBJK;
|
|
|
|
|
using Kingo.PluginServiceInterface;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Kingo.Plugin.General.Commands
|
|
|
|
|
{
|
|
|
|
|
public class CmdResultExport : BaseMenuCommand
|
|
|
|
|
{
|
|
|
|
|
private UCJKResultExport ucJKResultExport = null;
|
|
|
|
|
public IHookHelper m_hookHelper { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 成果输出
|
|
|
|
|
/// </summary>
|
|
|
|
|
public override void OnClick()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
ProjectInfo projectInfo = MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo;
|
|
|
|
|
if (string.IsNullOrWhiteSpace(projectInfo.JCKPath))
|
|
|
|
|
{
|
|
|
|
|
MessageHelper.Show("请先使用“基础数据加载”功能设置基础库数据!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (projectInfo.ListTaskPackage == null || projectInfo.ListTaskPackage.Count <= 0)
|
|
|
|
|
{
|
|
|
|
|
MessageHelper.Show("请先使用“任务目录设置”功能加载建库任务包(*.jkrw)!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (string.IsNullOrWhiteSpace(projectInfo.UserName))
|
|
|
|
|
{
|
|
|
|
|
MessageHelper.Show("请先使用“用户信息设置”功能设置用户名!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (ucJKResultExport == null)
|
|
|
|
|
{
|
|
|
|
|
ucJKResultExport = new UCJKResultExport()
|
|
|
|
|
{
|
|
|
|
|
hookHelper = m_hookHelper,
|
|
|
|
|
Width = 900,
|
|
|
|
|
Height = 450,
|
|
|
|
|
Title = "导出成果(审核任务包)",
|
|
|
|
|
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
|
|
|
|
|
};
|
|
|
|
|
ucJKResultExport.Closed += UcJKResultExport_Closed;
|
|
|
|
|
ucJKResultExport.BID = "";
|
|
|
|
|
ucJKResultExport.BindData();
|
|
|
|
|
ucJKResultExport.ShowInMainForm(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
KGIS.Framework.Utils.LogAPI.Debug("建库成果导出界面初始化异常:" + ex.Message);
|
|
|
|
|
KGIS.Framework.Platform.Helper.ProgressHelper.CloseProcessBar();
|
|
|
|
|
MessageHelper.ShowError("建库成果导出界面初始化异常:" + ex.Message);
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void UcJKResultExport_Closed(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (ucJKResultExport != null)
|
|
|
|
|
{
|
|
|
|
|
ucJKResultExport.Close();
|
|
|
|
|
}
|
|
|
|
|
ucJKResultExport = null;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
KGIS.Framework.Utils.LogAPI.Debug(ex);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnCreate(object Hook)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (m_hookHelper == null)
|
|
|
|
|
{
|
|
|
|
|
m_hookHelper = new HookHelperClass
|
|
|
|
|
{
|
|
|
|
|
Hook = Hook
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
m_hookHelper = null;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Enabled
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return (MapsManager.Instance.MapService.GetProjectInfo() as ProjectInfo) == null ? false : true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|