From 641dbf945d226ca9db7c7864aa5f5829eca88100 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 2 Dec 2009 14:28:21 +0000 Subject: [PATCH] Fix insert the RO Accessory Page ID into a Word attachment --- PROMS/Volian.Controls.Library/DisplayRO.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayRO.cs b/PROMS/Volian.Controls.Library/DisplayRO.cs index e29e4927..7318a077 100644 --- a/PROMS/Volian.Controls.Library/DisplayRO.cs +++ b/PROMS/Volian.Controls.Library/DisplayRO.cs @@ -419,8 +419,13 @@ namespace Volian.Controls.Library DisplayTabItem dti = _TabControl.SelectedDisplayTabItem; //.OpenItem(_ItemInfo); // open the corresponding procedure text if (dti.MyDSOTabPanel != null) // A Word Document tab is the active tab { - string accPrefix = (roch.type == 8) ? _Mydvi.DocVersionConfig.RODefaults_graphicsprefix : _Mydvi.DocVersionConfig.RODefaults_setpointprefix; + ROFSTLookup.rodbi[] dbs = MyROFST.ROFSTLookup.GetRODatabaseList(); + ROFSTLookup.rodbi db = dbs[int.Parse(roch.roid.Substring(0, 4))-1]; + string accPrefix = db.dbiAP.Replace(_Mydvi.DocVersionConfig.RODefaults_graphicsprefix,"IG"); + accPrefix = accPrefix.Replace(_Mydvi.DocVersionConfig.RODefaults_setpointprefix, "SP"); +// string accPrefix = (roch.type == 8) ? _Mydvi.DocVersionConfig.RODefaults_graphicsprefix : _Mydvi.DocVersionConfig.RODefaults_setpointprefix; string AccPageID = string.Format("<{0}-{1}>", accPrefix, roch.appid);// makes for example + Console.WriteLine(AccPageID); //string AccPageID = string.Format("{0} <{1}-{2}>", ConvertSymbolsAndStuff(selectedChld.value), accPrefix, roch.appid); // value and accesory ID //string AccPageID = string.Format("{0} {1}", ConvertSymbolsAndStuff(selectedChld.value), string.Format(@"#Link:ReferencedObject: {0} {1}", roch.roid, _MyROFST.MyRODb.RODbID)); // value and link reference //if (MessageBox.Show(AccPageID,"Place on Windows Clipboard?",MessageBoxButtons.YesNo) == DialogResult.Yes) @@ -447,6 +452,9 @@ namespace Volian.Controls.Library _MyRTB.Focus(); } _MyRTB.inRoAdd = false; + btnSaveRO.Enabled = btnCancelRO.Enabled = btnPreviewRO.Enabled = false; + _SavCurROLink = null; + CurROLink = null; } //else // we're in an Word attachment //{ @@ -458,9 +466,6 @@ namespace Volian.Controls.Library // if (dti.MyDSOTabPanel != null) // dti.MyDSOTabPanel.InsertText(AccPageID); //} - btnSaveRO.Enabled = btnCancelRO.Enabled = btnPreviewRO.Enabled = false; - _SavCurROLink = null; - CurROLink = null; } }