From 4ca9a34c07f5e75e7174f7739c2fe2c43ec1ccf3 Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 19 Apr 2013 15:01:11 +0000 Subject: [PATCH] I added some RTF logic to indent the change description. This will make it easier for me to copy text into source safe from this document. Corrected logic for returning the RO Value when the ROs do not have multiple return values. This fixes Bug B2013-080. Added logic to the code that looks for a newer version of the RO.FST file, when the DocVersion (Folder) does not have an assocated RO Database. Added Caption, Button and Icon to Warning Message when DocVersion (Folder) does not have an assocated RO Database. Added logic to support ROs that do not have Multiple return values. Fixed logic to support ROST lookup when the DocVersion (Folder) does not have an assocated RO Database Added Caption, Button and Icon to Warning Message when DocVersion (Folder) does not have an assocated RO Database. Shut-off the RO Edit feature when DocVersion (Folder) does not have an assocated RO Database. --- PROMS/Sync/Sync/frmSync.cs | 14 ++++++++++++-- PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs | 2 +- .../Extension/DocVersionExt.cs | 2 +- PROMS/Volian.Controls.Library/DisplayRO.cs | 2 +- PROMS/Volian.Controls.Library/DisplayReports.cs | 2 +- PROMS/Volian.Controls.Library/StepTabRibbon.cs | 14 +++++++++++--- 6 files changed, 27 insertions(+), 9 deletions(-) diff --git a/PROMS/Sync/Sync/frmSync.cs b/PROMS/Sync/Sync/frmSync.cs index 10892e32..58482c0f 100644 --- a/PROMS/Sync/Sync/frmSync.cs +++ b/PROMS/Sync/Sync/frmSync.cs @@ -15,9 +15,12 @@ namespace Sync { private List _CheckedOut; private bool IsLoading = false; + private float _DPI=100; public frmSync() { InitializeComponent(); + using (Graphics gr = CreateGraphics()) + _DPI = gr.DpiX; } private void LoadSettings() { @@ -495,6 +498,7 @@ namespace Sync } sb.Append((fis.Exists ? "" : " =>NEW") + "\t" + fi.Name + "\r\n"); AddText(rtb, fntNormal, (fis.Exists ? "" : " =>NEW") + "\t" + fi.Name + "\r\n"); + AddIndent(rtb); } } sb.Append("\r\nInternal Release:\r\n\r\n"); @@ -541,7 +545,6 @@ namespace Sync MessageBox.Show(sb2.ToString(), "Error saving Clipboard", MessageBoxButtons.OK, MessageBoxIcon.Error); } } - private bool HasPromsFixes(List _CheckedOut) { foreach (FileCompare fc in _CheckedOut) @@ -561,7 +564,14 @@ namespace Sync } return false; } - + private void AddIndent(RichTextBox rtb) + { + rtb.Select(rtb.TextLength, 0); + rtb.SelectionIndent = (int) _DPI; + rtb.SelectedText = "\r\n"; + rtb.Select(rtb.TextLength, 0); + rtb.SelectionIndent = 0; + } private static void AddText(RichTextBox rtb, Font font, string txt) { rtb.Select(rtb.TextLength, 0); diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index 727e3e47..9e1233c5 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -916,7 +916,7 @@ namespace VEPROMS.CSLA.Library } if (((rochild)child).children != null && ((rochild)child).children.Length > 0) return ((rochild)child).children[0]; - return null; + return (rochild)child; } public string GetROValueByAccPagID(string accPageID, string spDefault, string igDefault) { diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocVersionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocVersionExt.cs index 86619019..c214d05e 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocVersionExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocVersionExt.cs @@ -25,7 +25,7 @@ namespace VEPROMS.CSLA.Library { get { - if (DocVersionAssociations == null) return false; + if (DocVersionAssociations == null || DocVersionAssociations.Count == 0) return false; ROFstInfo roFstInfo = ROFstInfo.GetJustROFst(DocVersionAssociations[0].ROFstID); RODbInfo rdi = RODbInfo.GetJustRODB(roFstInfo.RODbID); string rofstPath = rdi.FolderPath + @"\ro.fst"; diff --git a/PROMS/Volian.Controls.Library/DisplayRO.cs b/PROMS/Volian.Controls.Library/DisplayRO.cs index 941d3486..40d9cfd0 100644 --- a/PROMS/Volian.Controls.Library/DisplayRO.cs +++ b/PROMS/Volian.Controls.Library/DisplayRO.cs @@ -548,7 +548,7 @@ namespace Volian.Controls.Library 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 suffix = roch.roid.Substring(12, 4) == "0041" ? "" : "." + ((char)Convert.ToInt32(roch.roid.Substring(12, 4), 16)).ToString(); + string suffix = (roch.roid.Length==12 || roch.roid.Substring(12, 4) == "0041") ? "" : "." + ((char)Convert.ToInt32(roch.roid.Substring(12, 4), 16)).ToString(); string AccPageID = string.Format("<{0}-{1}{2}>", accPrefix, roch.appid, suffix);// makes for example Console.WriteLine(AccPageID); //string AccPageID = string.Format("{0} <{1}-{2}>", ConvertSymbolsAndStuff(selectedChld.value), accPrefix, roch.appid); // value and accesory ID diff --git a/PROMS/Volian.Controls.Library/DisplayReports.cs b/PROMS/Volian.Controls.Library/DisplayReports.cs index fee72ae9..59f101ff 100644 --- a/PROMS/Volian.Controls.Library/DisplayReports.cs +++ b/PROMS/Volian.Controls.Library/DisplayReports.cs @@ -751,7 +751,7 @@ namespace Volian.Controls.Library } if (MyDVI == null || MyDVI.DocVersionAssociationCount < 1) { - MessageBox.Show("Could not find associated path for ro data."); + MessageBox.Show("Could not find associated path for ro data.","No RO Data", MessageBoxButtons.OK, MessageBoxIcon.Information); return ""; } string roloc = "\"" + MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath + "\" " + "\"" + ROList + "\""; diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index da27479d..ec45210e 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -72,7 +72,10 @@ namespace Volian.Controls.Library if (procInfo == null) return null; _MyDVI = procInfo.ActiveParent as DocVersionInfo; // added jcb 20121221 to support set ro from word doc - MyLookup = _MyDVI.DocVersionAssociations[0].MyROFst.ROFSTLookup; + if (_MyDVI.DocVersionAssociations != null && _MyDVI.DocVersionAssociations.Count > 0) + MyLookup = _MyDVI.DocVersionAssociations[0].MyROFst.ROFSTLookup; + else + MyLookup = null; return _MyDVI; } return null; @@ -1663,7 +1666,7 @@ namespace Volian.Controls.Library //} if (MyDVI == null || MyDVI.DocVersionAssociationCount < 1) { - MessageBox.Show("Could not find associated path for ro data."); + MessageBox.Show("Could not find associated path for ro data.", "No RO Data", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } string roloc = "\"" + MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath + "\""; @@ -1764,7 +1767,12 @@ namespace Volian.Controls.Library { ribbonTab_SingleClick(sender, e); btnUpdROVal.Enabled = false; - if (MyDVI.DocVersionAssociations == null || MyDVI.DocVersionAssociations.Count < 1) return; + if (MyDVI.DocVersionAssociations == null || MyDVI.DocVersionAssociations.Count < 1) + { + btnROEdit.Enabled = false; + return; + } + btnROEdit.Enabled = true; if (!NewerRoFst()) return; btnUpdROVal.Enabled = true; }