private void 校验ToolStripMenuItem_Click(object sender, EventArgs e) { if (!IsLoadDataSource()) { return; } if (!PublicMethod.Instance.IsExecuteSystemCMD("")) { if (orderVerify == null) { orderVerify = new WorkOrderVerify(); } Application.ShowModelessDialog(orderVerify); orderVerify.WindowState = FormWindowState.Normal; orderVerify.Visible = true; } }
private void ToolSMI_ExportZl_Click(object sender, EventArgs e) { #if EnableLock LockDaemon.Instance.CheckLock(); #endif if (!IsLoadDataSource()) { return; } #region 检查增量数据是否完整 if (orderVerify == null) { orderVerify = new WorkOrderVerify(); } var verifyRes = orderVerify.VerifySucceedOrFailed(); if (verifyRes.Contains(VerifyRes.AttributeDefect) || verifyRes.Contains(VerifyRes.TopologyDefect)) { MessageBox.Show("导出增量包时发现数据缺失严重,禁止导出!!!", "CAD提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); Application.ShowModelessDialog(orderVerify); orderVerify.WindowState = FormWindowState.Normal; orderVerify.Visible = true; return; } if (verifyRes.Count > 0) { if (verifyRes.Contains(VerifyRes.NoSyncTzData)) { DialogResult dr = MessageBox.Show("功能位置属性部分字段值需要从台账同步,点击(工具->同步台账数据)", "CAD提示", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { return; } } DialogResult res = MessageBox.Show("增量包含有不完整数据,是否继续导出.", "CAD提示", MessageBoxButtons.YesNo); if (res == DialogResult.No) { Application.ShowModelessDialog(orderVerify); orderVerify.WindowState = FormWindowState.Normal; orderVerify.Visible = true; return; } } orderVerify.Close(); orderVerify = null; #endregion var sf = new SaveFileDialog { Filter = "*.xml|*.xml" }; string name; var time = DateTime.Now.ToString("ddHHmmss"); var kxmc = MapConfig.Instance.KXMC.Split(','); //按范围导出的时候没有馈线名称 if ((kxmc.Length == 1 && string.IsNullOrEmpty(kxmc[0])) || kxmc.Length > 1) { name = string.Format("{0}_增量{1}", MapConfig.Instance.GCID, time); } else { name = string.Format("{0}_{1}_增量{2}", MapConfig.Instance.KXMC, MapConfig.Instance.GCID, time); } sf.FileName = string.Format("{0}.xml", name); if (sf.ShowDialog() == DialogResult.OK) { PublicMethod.Instance.ShowMessage("\n正在努力导出,请稍候..."); //导出CAD增量包 if ((DBManager.Instance as XmlDBManager).SaveVariable(sf.FileName)) { //拷贝台帐增量包 WindowsServices.ExportIncrementPacket(sf.FileName, name); fileName = sf.FileName; PublicMethod.Instance.ShowMessage("导出成功!"); } } }