From 8258235611f9a137e46d6e3e0f2595285edd631c Mon Sep 17 00:00:00 2001 From: John Jenko Date: Mon, 13 Apr 2026 11:06:50 -0400 Subject: [PATCH 01/25] Baseline Application fixes --- PROMS/Baseline/frmBaseline.cs | 158 +++++++++++++++++++++++++--------- 1 file changed, 118 insertions(+), 40 deletions(-) diff --git a/PROMS/Baseline/frmBaseline.cs b/PROMS/Baseline/frmBaseline.cs index d634f138..8551661e 100644 --- a/PROMS/Baseline/frmBaseline.cs +++ b/PROMS/Baseline/frmBaseline.cs @@ -456,7 +456,7 @@ namespace Baseline switch (myLast) { case LastWas.Pagination: - line = OpenPDF(line); + OpenPDF(line); break; case LastWas.Baseline: // TODO: Need to add code here to open matching file OpenOnePDF(myLine,1); @@ -479,7 +479,7 @@ namespace Baseline switch (myLast) { case LastWas.Pagination: - line = OpenPDF(line); + OpenPDF(line); break; case LastWas.Baseline: // TODO: Need to add code here to open matching file OpenOnePDF(myLine,2); @@ -491,34 +491,99 @@ namespace Baseline break; } } - string exePath; - private string OpenPDF(string line) + + /// + /// This will return the full path to the PDF file + /// + /// + /// + /// + private string GetPFDFileAndPath(FileInfo fi, string patern) { - int page = int.Parse(line.Substring(0, 6)); + string[] fileList = Directory.GetFiles(fi.DirectoryName, patern); + // sort the list of file list + Array.Sort((string[])fileList); + return fileList.First(); // the PDF file that we what should be top of the list then. + } + + /// + /// This will parse out the procedure number for the PROMS ShortPath representation of a procedure section or step part + /// In the PROMS ShortPath, ".S" is used to delimit the procedure number, section then uses "..S" for the step parts + /// This method was written to handle cases where ".S" is used as part of the procedure number + /// + /// + /// + private string ParseOutProcedureNumberFromLine(string txt) + { + // old logic was looking for the first occurence of ".S" in the txt string as the ending point of the procedure nuumber + // Beaver Valley has a procedure number "1.SBGEN" in which the old logic would not work + // 1.SBGEN.SC. ==> short path of attachment section "C" + // 1.SBGEN.SC..S1. ==> short path of Step 1 in attachment section "C" + string rtnstr = null; + int lidx = -1; + // if the item is to a high levels step or sub-step the short path as "..S" for each part of the step + // so look for the last occurence of ".." which will be the end of the section information + lidx = txt.LastIndexOf(".."); + if (lidx > 0) + { + lidx = txt.LastIndexOf(".S", lidx); // this will position us to the end of the procedure number + } + else + { + lidx = txt.LastIndexOf(".S"); // this will position us to the end of the procedure number if there was no step information + } // B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file. - line = line.Substring(8, line.IndexOf(".S") - 8).Replace("/", "_").Replace("\\", "_"); + rtnstr = txt.Substring(8, lidx - 8).Replace("/", "_").Replace("\\", "_"); + return rtnstr; + } + + string exePath; + private void OpenPDF(string line) + { + int pageNum = int.Parse(line.Substring(0, 6)); + // B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file. + string ProcNum = ParseOutProcedureNumberFromLine(line); + string procPatern = string.Format("*{0}*.pdf", string.IsNullOrEmpty(line) ? "noProcNumber" : ProcNum); + FindFile ff = lbDifferent.SelectedItem as FindFile; FileInfo fi1 = new FileInfo(ff.File1); FileInfo fi2 = new FileInfo(ff.File2); + string PDFfileName1 = GetPFDFileAndPath(fi1,procPatern); + string PDFfileName2 = GetPFDFileAndPath(fi2,procPatern); + if (string.IsNullOrEmpty(PDFfileName1) || string.IsNullOrEmpty(PDFfileName2)) return; + // If you don't know where the Reader executable is for PDFs Open a PDF and Check to see where the path points if (exePath == null) { - System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + line + ".pdf"); - exePath = TryToGetPath(p); - p.Kill(); // No need to keep it open + try + { + System.Diagnostics.Process p = System.Diagnostics.Process.Start(PDFfileName1); + exePath = TryToGetPath(p); + p.Kill(); // No need to keep it open + } + catch (Exception ex) + { + Application.DoEvents(); + string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message); + Console.WriteLine(msg); + MessageBox.Show(msg, "Error opening default PDF Viewer"); + return; + } } + // Open the first PDF on a Specific Page - System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", page) + fi1.DirectoryName + "\\" + line + ".pdf "); + System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format(" /A \"page={0}\" \"{1}\" ", pageNum,PDFfileName1)); System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1); // Move the PDF Reader window to 0,0 MoveProcess(p1, 0, 0); - // Open the first PDF on a Specific Page - System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", page) + fi2.DirectoryName + "\\" + line + ".pdf "); + + // Open the second PDF on a Specific Page + System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format(" /A \"page={0}\" \"{1}\" ", pageNum, PDFfileName2)); System.Diagnostics.Process p2 = System.Diagnostics.Process.Start(psi2); // Move the PDF Reader window to 960,0 // TODO: This Offset could be a Setting MoveProcess(p2, 960, 0); - return line; + return; } /// /// Try to get the location of the PDF Reader executable @@ -530,7 +595,7 @@ namespace Baseline p.WaitForInputIdle(); while (p.MainModule == null) { - Console.WriteLine("{0} - {1}", p.MainWindowTitle,p.ProcessName); + Console.WriteLine("{0} - {1}", p.MainWindowTitle, p.ProcessName); p.WaitForInputIdle(); Application.DoEvents(); } @@ -594,40 +659,52 @@ namespace Baseline /// private void OpenOnePDF(Line myLine, int list) { + if (myLine == null) return; // no PDF to open // B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file. string proc = myLine.MyProc.Number.Replace("/","_").Replace("\\","_"); + + // if no procedure number, PROMS creates pdf filename "NoProcNumber.pdf" + // create pattern to use to get the PDF from the directory + // add wildcards (*) to file the file if any prefix or suffix was added to the filename + string procPatern = string.Format("*{0}*.pdf", proc == string.Empty ? "noProcNumber" : proc); int pagenum = myLine.MyPage.Number; FindFile ff = lbDifferent.SelectedItem as FindFile; - FileInfo fi1 = new FileInfo(ff.File1); - FileInfo fi2 = new FileInfo(ff.File2); - if (exePath == null) - { - System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + proc + ".pdf"); - while (exePath == null) - { - try - { - - exePath = p.MainModule.FileName; - } - catch (Exception ex) - { - Application.DoEvents(); - Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message); - } - } - p.Kill(); - } + string PDFfileName = null; if (list == 1) { - System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", pagenum) + fi1.DirectoryName + "\\" + proc + ".pdf "); - System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1); + FileInfo fi1 = new FileInfo(ff.File1); + PDFfileName = GetPFDFileAndPath(fi1, procPatern); } - else + else // list == 2 { - System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", pagenum) + fi2.DirectoryName + "\\" + proc + ".pdf "); - System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi2); + FileInfo fi2 = new FileInfo(ff.File2); + PDFfileName = GetPFDFileAndPath(fi2, procPatern); } + if (string.IsNullOrEmpty(PDFfileName)) return; // no PDF to open + + // if exePath is null, then open the found PDF with the default PDF viewer and + // capture/save the entire name and path of the default PDF viewer + if (exePath == null) + { + try + { + System.Diagnostics.Process tp = System.Diagnostics.Process.Start(PDFfileName); + exePath = TryToGetPath(tp); + tp.Kill(); + } + catch (Exception ex) + { + Application.DoEvents(); + string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message); + Console.WriteLine(msg); + MessageBox.Show(msg, "Error opening default PDF Viewer"); + return; + } + } + // open the PDF and jump to the page number + System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A \"page={0}\" \"{1}\" ", pagenum,PDFfileName)); + psi1.UseShellExecute = false; + System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1); } /// /// Perform Debug Meta file comparison for all of the folders within the automated testing folders @@ -709,11 +786,12 @@ namespace Baseline private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e) { //Initialize Results List Box - lbResults1.Items.Clear(); Procedure myProc = lbProcedures.SelectedItem as Procedure; + if (myProc == null) return; // clicked on the white space (blank line) in the list of different procedures //TODO: May need to consider if there are duplicate procedure numers and titles Procedure myProc1 = MyProcs1.Find(x => x.Number == myProc.Number && x.Title == myProc.Title); // Build the results ListBox for the left window + lbResults1.Items.Clear(); if (myProc1 != null) { foreach (Page myPage in myProc1.MyPages) From 9b7c30e1cd9fe191df596c1f79582bab8087f06f Mon Sep 17 00:00:00 2001 From: John Jenko Date: Wed, 15 Apr 2026 11:28:21 -0400 Subject: [PATCH 02/25] C2026-033 Added logic to not display the Empty Procedure message box if we are printing via baseline print testing. --- PROMS/Volian.Print.Library/PromsPrinter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs b/PROMS/Volian.Print.Library/PromsPrinter.cs index de678a4b..dcd0572a 100644 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs +++ b/PROMS/Volian.Print.Library/PromsPrinter.cs @@ -960,7 +960,9 @@ namespace Volian.Print.Library OnStatusChanged("After NewPage", PromsPrinterStatusType.NewPage); if (myProcedure.Sections == null) { - MessageBox.Show("This procedure has no content and will not be printed.", "Empty Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information); + // C2026-033 if we are running baselines, don't display the empty procedure message box, instead continue on as if OK was pressed. + if (!BaselineTesting) + MessageBox.Show("This procedure has no content and will not be printed.", "Empty Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information); ProfileTimer.Pop(profileDepth); // B2024-062 Added check for EmptyProcedure. This is to prevent the Try Again message // from appearing after the user clicks on the OK button from the Empty Procedure message From ff9ade75d45b35ff7e4832fcf9d1c921bc188bdc Mon Sep 17 00:00:00 2001 From: mschill Date: Thu, 16 Apr 2026 09:32:02 -0400 Subject: [PATCH 03/25] B2026-037 - Remove Fix Symbol Font --- PROMS/LBWordLibrary/LBObjectExtension.cs | 254 +-- .../frmVEPROMS.Designer.cs | 13 +- PROMS/VEPROMS User Interface/frmVEPROMS.cs | 41 +- PROMS/Volian.Controls.Library/DSOTabPanel.cs | 1379 ++++++++--------- 4 files changed, 687 insertions(+), 1000 deletions(-) diff --git a/PROMS/LBWordLibrary/LBObjectExtension.cs b/PROMS/LBWordLibrary/LBObjectExtension.cs index 139a52df..8af4c527 100644 --- a/PROMS/LBWordLibrary/LBObjectExtension.cs +++ b/PROMS/LBWordLibrary/LBObjectExtension.cs @@ -422,150 +422,6 @@ namespace LBWordLibrary return true; return false; } - /// - /// If document contains symbol characters, returns problem font. - /// - public string FontHasSymbolCharacters - { - get - { - LBRange myRange = Range(); - myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100); - myRange.Start = 0; - int end = myRange.End; - string myText = GetRangeText(myRange); - //return _RegFindSymbol.IsMatch(myText); - MatchCollection problems = _RegFindSymbol.Matches(myText); - int offset = 0; - List alreadyProcessed = new List(); - List fontHasSymbols = new List(); - foreach (Match problem in problems) - { - if (!alreadyProcessed.Contains(problem.Value)) - { - myRange.Start = problem.Index + offset; - myRange.End = problem.Index + problem.Length + offset; - int newOffset = FindRangeOffset(myRange, problem, offset, end); - string fontName = myRange.Font.Name; - if (IsSymbolFont(fontName)) - { - if( !fontHasSymbols.Contains(fontName)) - { - fontHasSymbols.Add(fontName); - // Found symbol font - _MyLog.InfoFormat("Font '{0}' has Symbols", fontName); - } - //Console.WriteLine("Font '{0}' has Symbols", myRange.Font.Name); - //return true; - } - else - return myRange.Font.Name; - offset = newOffset; - alreadyProcessed.Add(problem.Value); - } - } - return null; - } - } - /// - /// Debug Tool - Return a string containing a list of the fonts that have symbol characters. - /// - public string FontsHaveSymbolCharacters - { - get - { - string sep = ""; - StringBuilder sb = new StringBuilder(); - List fonts=new List(); - LBRange myRange = Range(); - myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100); - myRange.Start = 0; - int end = myRange.End; - string myText = GetRangeText(myRange); - //return _RegFindSymbol.IsMatch(myText); - MatchCollection problems = _RegFindSymbol.Matches(myText); - int offset = 0; - foreach (Match problem in problems) - { - myRange.Start = problem.Index + offset; - myRange.End = problem.Index + problem.Length + offset; - int newOffset = FindRangeOffset(myRange, problem, offset, end); - if (!fonts.Contains(myRange.Font.Name)) - { - fonts.Add(myRange.Font.Name); - sb.Append(sep + "'" + myRange.Font.Name + "'"); - sep = ","; - } - offset = newOffset; - } - if (sb.Length > 0) return sb.ToString(); - return null; - } - } - /// - /// Debug Tool - Return a list of symbol characters using VESYMB font. - /// - public string FontsHaveSymbolCharacters2 - { - get - { - try - { - Dictionary> fonts = new Dictionary>(); - LBRange myRange = Range(); - myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100); - myRange.Start = 0; - int end = myRange.End; - string myText = GetRangeText(myRange); - //return _RegFindSymbol.IsMatch(myText); - MatchCollection problems = _RegFindSymbol.Matches(myText); - int offset = 0; - foreach (Match problem in problems) - { - myRange.Start = problem.Index + offset; - myRange.End = problem.Index + problem.Length + offset; - int newOffset = FindRangeOffset(myRange, problem, offset, end); - string sFont = myRange.Font.Name; - if (sFont.ToUpper().StartsWith("VESYM")) - { - if (!fonts.ContainsKey(sFont)) - { - fonts.Add(sFont, new List()); - } - List symbols = fonts[sFont]; - string myTextSymb = GetRangeText(myRange); - foreach (char c in myTextSymb) - { - if (!symbols.Contains((int)c)) - symbols.Add((int)c); - } - } - offset = newOffset; - } - if (fonts.Count > 0) - { - string sep = ""; - StringBuilder sb = new StringBuilder(); - foreach (string font in fonts.Keys) - { - sb.Append(sep + "'" + font + "'"); - sep = ","; - foreach (int i in fonts[font]) - { - sb.Append(sep); - sb.Append(i); - } - } - return sb.ToString(); - } - } - catch (Exception ex) - { - Console.WriteLine("{0},{1},{2}", ex.GetType().Name, ex.Message, ex.StackTrace); - } - return null; - } - } /// /// Checks to see if the document contains symbol characters @@ -601,86 +457,7 @@ namespace LBWordLibrary } } Regex _RegFindSymbol = new Regex("[\\uF020-\\uF07F]+"); - /// - /// FixSymbolCharacters - Fix any symbol characters in the document - /// - public void FixSymbolCharacters() - { - // Set up range object to be used to process text - LBRange myRange = Range(); - myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100); - int end = myRange.End; - myRange.Start = 0; - string myText = GetRangeText(myRange); - MatchCollection problems = _RegFindSymbol.Matches(myText); - int offset = 0; - foreach (Match problem in problems) - { - myRange.Start = problem.Index + offset; - myRange.End = problem.Index + problem.Length + offset; - int newOffset = FindRangeOffset(myRange, problem, offset, end); - if (myRange.Font.Name == "") - { - int wrdStart = myRange.Start; - int wrdEnd = myRange.End; - int wrdMiddle = wrdStart; - while (myRange.Font.Name == "") - { - do - { - myRange.End = ++wrdMiddle; - } while(myRange.Font.Name != ""); - myRange.End = wrdMiddle - 1; - ReplaceSymbolCharacters(myRange); - myRange.Start = wrdMiddle -1; - myRange.End = wrdEnd; - } - ReplaceSymbolCharacters(myRange); - } - else - { - ReplaceSymbolCharacters(myRange); - } - offset = newOffset; - } - } - /// - /// Try to fix the first character in the symbol range F000 to F0FF. If it cannot be - /// fixed, it is an indicator that the font is not installed properly. Regardless of - /// whether there is success, the change is undone so that the document will not be - /// considered dirty, i.e. will not prompt user for save. - /// - /// - public bool AttemptToFixASymbolCharacter() - { - // Set up range object to be used to process text - LBRange myRange = Range(); - myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100); - - int end = myRange.End; - myRange.Start = 0; - string myText = GetRangeText(myRange); - MatchCollection problems = _RegFindSymbol.Matches(myText); - if (problems.Count>0) - { - Match problem = problems[0]; - myRange.Start = problem.Index; - myRange.End = myRange.Start + 1; - if (IsSymbolFont(myRange.Font.Name)) return true; // if it's a symbol font already, no issue. - string before = GetRangeText(myRange); - string updated = ReplaceSymbolCharacters(before); - myRange.Text = updated; - string after = GetRangeText(myRange); - Undo(1); - //Console.WriteLine("Undo1 results = {0}", tst); - //tst = Undo(1); - //Console.WriteLine("Undo2 results = {0}", tst); - //tst = Undo(1); - //Console.WriteLine("Undo3 results = {0}", tst); - return (updated == after); - } - return true; - } + /// /// Get the Range Text with error handling. myRange.Text sometimes will get a null reference exception. /// @@ -737,35 +514,6 @@ namespace LBWordLibrary return myRange.Start - problem.Index; } /// - /// ReplaceSymbolCharacters Replaces any symbol characters in the specified range - /// - /// - private static void ReplaceSymbolCharacters(LBRange myRange) - { - try - { - if (IsSymbolFont(myRange.Font.Name)) - return; - string before = GetRangeText(myRange); - string updated = ReplaceSymbolCharacters(before); - myRange.Text = updated; - string after = GetRangeText(myRange); - if (after != updated) // If the Word text doesn't match try including a character before and after and do it again. - { - Console.WriteLine("'TryEntireRange Failed',{0},{1},'{2}','{3}','{4}'", myRange.Start, myRange.End, before, updated, after); - int end = myRange.End; - myRange.Start = myRange.Start - 1; - myRange.End = end + 1; - myRange.Text = ReplaceSymbolCharacters(GetRangeText(myRange)); - Console.WriteLine("'TryEntireRange Failed',{0},{1},'{2}'", myRange.Start, myRange.End, GetRangeText(myRange)); - } - } - catch (Exception ex) - { - Console.WriteLine("'TryEntireRange Exception',{0},{1},'{2}'", myRange.Start, myRange.End, ex.Message); - } - } - /// /// ReplaceSymbolCharacters processes the string returned and changes any symbols (0xF0??) to normal characters /// /// diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs index d2f33d9d..2da63893 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs @@ -83,7 +83,6 @@ namespace VEPROMS this.lblUser = new DevComponents.DotNetBar.LabelItem(); this.lblLastChange = new DevComponents.DotNetBar.LabelItem(); this.btnStepRTF = new DevComponents.DotNetBar.ButtonItem(); - this.btnFixMSWord = new DevComponents.DotNetBar.ButtonItem(); this.epAnnotations = new DevComponents.DotNetBar.ExpandablePanel(); this.ctrlAnnotationDetails = new Volian.Controls.Library.AnnotationDetails(); this.btnAnnoDetailsPushPin = new DevComponents.DotNetBar.ButtonX(); @@ -541,8 +540,7 @@ namespace VEPROMS this.btnEditItem, this.lblUser, this.lblLastChange, - this.btnStepRTF, - this.btnFixMSWord}); + this.btnStepRTF}); this.bottomBar.Location = new System.Drawing.Point(5, 573); this.bottomBar.Name = "bottomBar"; this.bottomBar.Size = new System.Drawing.Size(1185, 25); @@ -728,14 +726,6 @@ namespace VEPROMS this.btnStepRTF.Text = "Step RTF"; this.btnStepRTF.Click += new System.EventHandler(this.btnStepRTF_Click); // - // btnFixMSWord - // - this.btnFixMSWord.ForeColor = System.Drawing.Color.Black; - this.btnFixMSWord.Name = "btnFixMSWord"; - this.btnFixMSWord.Text = "Fix Symbol Fonts"; - this.btnFixMSWord.Visible = false; - this.btnFixMSWord.Click += new System.EventHandler(this.btnFixMSWord_Click); - // // epAnnotations // this.epAnnotations.CanvasColor = System.Drawing.SystemColors.Control; @@ -1775,7 +1765,6 @@ namespace VEPROMS private DevComponents.DotNetBar.ButtonItem btnItemInfo; private DevComponents.DotNetBar.ButtonItem btnFilter; private DevComponents.DotNetBar.TextBoxItem txtFilter; - private DevComponents.DotNetBar.ButtonItem btnFixMSWord; private Volian.Controls.Library.DisplayBookMarks displayBookMarks; //private DevComponents.DotNetBar.LabelItem lblLocked; private DevComponents.DotNetBar.ButtonItem btnShortCuts; diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index c73eb983..10210c96 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -234,7 +234,7 @@ namespace VEPROMS System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); displayRO.TabControl = tc; // B2019-043 this was being passed in as a parameter for DisplayRO which caused issues with the Visual Studio designer - SetupFolder(MyDocVersion.FolderID); + SetupFolder(MyDocVersion.FolderID); tc.MySessionInfo = MyParent.MySessionInfo; displaySearch1.TopFolderID = myDocVersion.FolderID; SelectedDVI = myDocVersion; @@ -1578,13 +1578,13 @@ namespace VEPROMS } else { - SelectedROFst = myDTP.MyDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; + SelectedROFst = myDTP.MyDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; } } } else if (tc.MyEditItem != null && displayRO.MyROFST != null && tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].ROFstID != displayRO.MyROFST.ROFstID) { - SelectedROFst = tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; + SelectedROFst = tc.MyEditItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; } // need this to update RO Tree after UpdateRofst (B2015-226) @@ -1592,9 +1592,9 @@ namespace VEPROMS if (displayRO.MyROFST != SelectedROFst) { displayRO.MyROFST = SelectedROFst; - // B2023-021: force Load of Step Prop/RO panel RO tree by passing in - // true to LoadTree - displayRO.LoadTree(true); + // B2023-021: force Load of Step Prop/RO panel RO tree by passing in + // true to LoadTree + displayRO.LoadTree(true); } } @@ -2396,8 +2396,8 @@ namespace VEPROMS tv.MyUserInfo = MyUserInfo; StepTabRibbon.MySessionInfo = MySessionInfo; - // Initialize Caption with Server name and Database name. - SetCaption(tv.TopNode as VETreeNode); + // Initialize Caption with Server name and Database name. + SetCaption(tv.TopNode as VETreeNode); System.Threading.AutoResetEvent autoEvent = new System.Threading.AutoResetEvent(false); //System.Threading.TimerCallback timerDelegate = new System.Threading.TimerCallback(MySessionInfo.PingSession); @@ -4552,8 +4552,8 @@ namespace VEPROMS SetCaption(tv.SelectedNode as VETreeNode); displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem; - - if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0) + + if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0) { displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; } @@ -4628,8 +4628,6 @@ namespace VEPROMS if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus) return; - btnFixMSWord.Visible = (args != null && (args.MyItemInfo != null && args.MyEditItem == null)); - if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed) _LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged); @@ -4767,9 +4765,9 @@ namespace VEPROMS // B2022-026 RO Memory reduction coding (Jakes Merge) displayRO.ProgressBar = bottomProgBar; displayRO.MyRTB = args.MyEditItem.MyStepRTB; - displayRO.LoadTree(); + displayRO.LoadTree(); - displayBookMarks.MyEditItem = args.MyEditItem; + displayBookMarks.MyEditItem = args.MyEditItem; displayHistory.MyEditItem = args.MyEditItem; lblEditView.Text = args.MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? "Edit" : "View"; @@ -4932,7 +4930,7 @@ namespace VEPROMS // B2022-026 RO Memory reduction coding (Jakes Merge) displayRO.LoadTree(); - } + } #endregion @@ -5241,19 +5239,6 @@ namespace VEPROMS Clipboard.SetDataObject(mydo); } } - private void btnFixMSWord_Click(object sender, EventArgs e) - { - if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyDSOTabPanel != null) - { - string btnText = btnFixMSWord.Text; - btnFixMSWord.FixedSize = btnFixMSWord.Size; - btnFixMSWord.Text = "Processing ..."; - this.Cursor = Cursors.WaitCursor; - tc.SelectedDisplayTabItem.MyDSOTabPanel.FixSymbolCharacters(); - btnFixMSWord.Text = btnText; - this.Cursor = Cursors.Default; - } - } private void epAnnotations_Resize(object sender, EventArgs e) { diff --git a/PROMS/Volian.Controls.Library/DSOTabPanel.cs b/PROMS/Volian.Controls.Library/DSOTabPanel.cs index 45b5b70c..a97e038a 100644 --- a/PROMS/Volian.Controls.Library/DSOTabPanel.cs +++ b/PROMS/Volian.Controls.Library/DSOTabPanel.cs @@ -14,736 +14,701 @@ using Volian.Base.Library; namespace Volian.Controls.Library { - public partial class DSOTabPanel : DevComponents.DotNetBar.PanelDockContainer - { - #region Private Fields - private DisplayTabControl _MyDisplayTabControl; - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private AxEDWordLib.AxEDWord _MyEdWord; // B2017-133 Edraw DSO Framer Replacement - public AxEDWordLib.AxEDWord MyEdWord - { - get { return _MyEdWord; } - set { _MyEdWord = value; } - } - private TransparentPanel _MyTransparentPanel; - private static int _Count = 0; - private DocumentInfo _MyDocumentInfo; - private int _MyCount; - private DisplayTabItem _MyDisplayTabItem; - private DSOFile _DSOFile; - public static int MSWordLimit = 10; - #endregion - #region Public Properties - private String _SearchString; - public String SearchString - { - get { return _SearchString; } - set { _SearchString = value; FindSearchString(); } - } - /// - /// Count of DSO Pages open. Limited to 18 in DisplayTabControl - /// - public static int Count - { - get { return _Count; } - set { _Count = value; } - } - /// - /// Pointer to the related DisplayTabItem - /// - public DisplayTabItem MyDisplayTabItem - { - get { return _MyDisplayTabItem; } - set - { - _MyDisplayTabItem = value; - _MyDisplayTabItem.Visible = false; - _MyDisplayTabItem.Visible = true; - } - } - /// - /// DocumentInfo record for the Word document - /// - public DocumentInfo MyDocumentInfo - { - get { return _MyDocumentInfo; } - } - /// - /// Temporary Word file used for editing. - /// - internal DSOFile MyDSOFile - { - get - { - if (_DSOFile == null) - _DSOFile = new DSOFile(_MyDocumentInfo); - return _DSOFile; - } - } - /// - /// Dirty status. Only saved if dirty. - /// - public bool IsDirty - { - get - { - if (_MyEdWord == null) return false; // B2017-133 Edraw Is Dirty Property - // B2017-249 Recover Temporary File And AutoSave support for MSWord - return _MyEdWord.IsDirty() || MyDSOFile.ContentIsDirty; - //LBDocumentClass doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - //return !doc.Saved; - } - } - private bool _OverrideClose = false; - public bool OverrideClose - { - get { return _OverrideClose; } - set { _OverrideClose = value; } - } - public E_ViewMode PanelViewEditMode = E_ViewMode.Edit; - #endregion - //private frmPG _frm = null; - #region Constructors - private Timer _RefreshTimer; - private ItemInfo _ItemInfo; - private bool _AllowedToEdit; - public DSOTabPanel(DocumentInfo documentInfo, DisplayTabControl myDisplayTabControl, ItemInfo itemInfo, bool allowedToEdit) - { - _MyDisplayTabControl = myDisplayTabControl; - _ItemInfo = itemInfo; - _AllowedToEdit = allowedToEdit; - InitializeComponent(); - SetupDSOTabPanel(); - _MyDocumentInfo = documentInfo; - SetupDSO(); - if (_MyEdWord == null) return; //B2017-219 could not open the word attachment so just return + public partial class DSOTabPanel : DevComponents.DotNetBar.PanelDockContainer + { + #region Private Fields + private DisplayTabControl _MyDisplayTabControl; + private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private AxEDWordLib.AxEDWord _MyEdWord; // B2017-133 Edraw DSO Framer Replacement + public AxEDWordLib.AxEDWord MyEdWord + { + get { return _MyEdWord; } + set { _MyEdWord = value; } + } + private TransparentPanel _MyTransparentPanel; + private static int _Count = 0; + private DocumentInfo _MyDocumentInfo; + private int _MyCount; + private DisplayTabItem _MyDisplayTabItem; + private DSOFile _DSOFile; + public static int MSWordLimit = 10; + #endregion + #region Public Properties + private String _SearchString; + public String SearchString + { + get { return _SearchString; } + set { _SearchString = value; FindSearchString(); } + } + /// + /// Count of DSO Pages open. Limited to 18 in DisplayTabControl + /// + public static int Count + { + get { return _Count; } + set { _Count = value; } + } + /// + /// Pointer to the related DisplayTabItem + /// + public DisplayTabItem MyDisplayTabItem + { + get { return _MyDisplayTabItem; } + set + { + _MyDisplayTabItem = value; + _MyDisplayTabItem.Visible = false; + _MyDisplayTabItem.Visible = true; + } + } + /// + /// DocumentInfo record for the Word document + /// + public DocumentInfo MyDocumentInfo + { + get { return _MyDocumentInfo; } + } + /// + /// Temporary Word file used for editing. + /// + internal DSOFile MyDSOFile + { + get + { + if (_DSOFile == null) + _DSOFile = new DSOFile(_MyDocumentInfo); + return _DSOFile; + } + } + /// + /// Dirty status. Only saved if dirty. + /// + public bool IsDirty + { + get + { + if (_MyEdWord == null) return false; // B2017-133 Edraw Is Dirty Property + // B2017-249 Recover Temporary File And AutoSave support for MSWord + return _MyEdWord.IsDirty() || MyDSOFile.ContentIsDirty; + //LBDocumentClass doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); + //return !doc.Saved; + } + } + private bool _OverrideClose = false; + public bool OverrideClose + { + get { return _OverrideClose; } + set { _OverrideClose = value; } + } + public E_ViewMode PanelViewEditMode = E_ViewMode.Edit; + #endregion + //private frmPG _frm = null; + #region Constructors + private Timer _RefreshTimer; + private ItemInfo _ItemInfo; + private bool _AllowedToEdit; + public DSOTabPanel(DocumentInfo documentInfo, DisplayTabControl myDisplayTabControl, ItemInfo itemInfo, bool allowedToEdit) + { + _MyDisplayTabControl = myDisplayTabControl; + _ItemInfo = itemInfo; + _AllowedToEdit = allowedToEdit; + InitializeComponent(); + SetupDSOTabPanel(); + _MyDocumentInfo = documentInfo; + SetupDSO(); + if (_MyEdWord == null) return; //B2017-219 could not open the word attachment so just return _RefreshTimer = new Timer(); // Enabled is false and interval is 1/10th of second. - _RefreshTimer.Interval = 500;// B2017-133 Edraw - ClientSizeChanged += new EventHandler(DSOTabPanel_ClientSizeChanged); - _RefreshTimer.Tick += new EventHandler(_RefreshTimer_Tick); - // B2018-070 Activate MS Word Panel - _RefreshTimer.Enabled = true; - _MyEdWord.BeforeDocumentSaved += _MyEdWord_BeforeDocumentSaved;// B2017-133 Edraw - } - void _MyEdWord_BeforeDocumentSaved(object sender, EventArgs e)// B2017-133 Edraw - { - _MyEdWord.Save(); // B2017-135 Only open the Message Box once - } - void DisableWordCommands()// B2017-133 Edraw - { - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableClose, true); - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableNew, true); - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrint, true); - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrintPreview, true); - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrintQuick, true); - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableSave, true); - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableSaveAs, true); - _MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypeSave, true); - _MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypeClose, true); - _MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypePrint, true); - _MyEdWord.DisableSaveHotKey(true); - _MyEdWord.DisablePrintHotKey(true); - } - // B2019-161 When tracking timing time this action - private static VolianTimer _TimeActivity = new VolianTimer("DSOTabPanel.cs _RefreshTimer_Tick", 148); + _RefreshTimer.Interval = 500;// B2017-133 Edraw + ClientSizeChanged += new EventHandler(DSOTabPanel_ClientSizeChanged); + _RefreshTimer.Tick += new EventHandler(_RefreshTimer_Tick); + // B2018-070 Activate MS Word Panel + _RefreshTimer.Enabled = true; + _MyEdWord.BeforeDocumentSaved += _MyEdWord_BeforeDocumentSaved;// B2017-133 Edraw + } + void _MyEdWord_BeforeDocumentSaved(object sender, EventArgs e)// B2017-133 Edraw + { + _MyEdWord.Save(); // B2017-135 Only open the Message Box once + } + void DisableWordCommands()// B2017-133 Edraw + { + _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableClose, true); + _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableNew, true); + _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrint, true); + _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrintPreview, true); + _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrintQuick, true); + _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableSave, true); + _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableSaveAs, true); + _MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypeSave, true); + _MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypeClose, true); + _MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypePrint, true); + _MyEdWord.DisableSaveHotKey(true); + _MyEdWord.DisablePrintHotKey(true); + } + // B2019-161 When tracking timing time this action + private static VolianTimer _TimeActivity = new VolianTimer("DSOTabPanel.cs _RefreshTimer_Tick", 148); - void _RefreshTimer_Tick(object sender, EventArgs e) - { - _TimeActivity.Open(); - _RefreshTimer.Enabled = false; - if (_MyEdWord != null)// B2017-133 Edraw - { - // B2018-070 Activate MS Word Panel - _MyEdWord.GotoItem(EDWordLib.WdGoToItem.wdGoToObject, EDWordLib.WdGoToDirection.wdGoToNext, 0, null); - } - //else - //{ - // _MyDisplayTabControl.CloseTabItem(_MyDisplayTabItem); - //} - _TimeActivity.Close(); - } + void _RefreshTimer_Tick(object sender, EventArgs e) + { + _TimeActivity.Open(); + _RefreshTimer.Enabled = false; + if (_MyEdWord != null)// B2017-133 Edraw + { + // B2018-070 Activate MS Word Panel + _MyEdWord.GotoItem(EDWordLib.WdGoToItem.wdGoToObject, EDWordLib.WdGoToDirection.wdGoToNext, 0, null); + } + //else + //{ + // _MyDisplayTabControl.CloseTabItem(_MyDisplayTabItem); + //} + _TimeActivity.Close(); + } - void DSOTabPanel_ClientSizeChanged(object sender, EventArgs e) - { - // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel - if (_InDSOTabPanel) - { + void DSOTabPanel_ClientSizeChanged(object sender, EventArgs e) + { + // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel + if (_InDSOTabPanel) + { _RefreshTimer.Enabled = false; // This assures that interval is used from last event. - _RefreshTimer.Enabled = true; - } - } - #endregion - #region Private Methods - private void SetupDSOTabPanel() - { - Dock = System.Windows.Forms.DockStyle.Fill; // Automatically Fill the panel - } - private void SetupDSO() - { - _Count++; // Increment the count of open Word documents (Limit = MSWordLimit) - _MyCount = _Count; - this._MyTransparentPanel = new TransparentPanel(); - this._MyEdWord = new AxEDWordLib.AxEDWord();// B2017-133 Edraw - _MyEdWord.BeginInit(); - this.Controls.Add(this._MyEdWord); - this.Controls.Add(this._MyTransparentPanel); // A transparent panel is added over top of the DSO Framer window so that - // the related tab can be activated when the user clicks on a Word Document. Since the Word document is actually running - // in a different thread, it does not behave properly with focus events. - this.components.Add(this._MyEdWord);// B2017-133 Edraw - this.components.Add(this._MyTransparentPanel); - this._MyTransparentPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this._MyTransparentPanel.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this._MyTransparentPanel.ForeColor = System.Drawing.Color.Brown; // This is the color used to show InActive on the right side on the Word - // document menu line. - //this._MyTransPanel.Location = new System.Drawing.Point(0, 0); - //this._MyTransPanel.Name = "transPanel1"; - //this._MyTransPanel.Size = new System.Drawing.Size(370, 423); - //this._MyTransPanel.TabIndex = 1; - this._MyTransparentPanel.Click += new EventHandler(_MyTransparentPanel_Click); - this._MyEdWord.Dock = System.Windows.Forms.DockStyle.Fill; - //System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WordDSOTab)); - //this._DSOFramer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("_FC.OcxState"))); - _MyEdWord.EndInit(); - LBDocumentClass doc; - try - { - try - { - this._MyEdWord.LicenseName = "Volian7573291802";// B2017-133 Edraw - this._MyEdWord.LicenseCode = "EDW8-5527-1201-AB8A";// B2017-133 Edraw - DisableWordCommands(); - this._MyEdWord.Open(MyDSOFile.MyFile.FullName); - doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - } - catch (Exception ex) - { - // B2017-137 Restore Previous valid version if the current version cannot be opened, - using (DocumentAuditInfoList dail = DocumentAuditInfoList.Get(MyDocumentInfo.DocID)) - { - if (dail.Count > 0) - { - //DocumentAuditInfo dai = dail[0]; - //foreach (DocumentAuditInfo tmpa in dail) - //{ - // if (tmpa.DTS > dai.DTS) dai = tmpa; - //} - if (MessageBox.Show("Do you want to revert to a previous version?", "Error in MS Word section", - MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - { - using (Document myDoc = Document.Get(MyDocumentInfo.DocID)) - { - myDoc.RestoreWordDoc(_ItemInfo); - } - using (Document myDoc = Document.Get(MyDocumentInfo.DocID)) - { - System.IO.FileStream fs = MyDSOFile.MyFile.Create(); - fs.Write(myDoc.DocContent, 0, myDoc.DocContent.Length); - fs.Close(); - MyDSOFile.SaveFile(0, "", _ItemInfo, false, StatusChanged); // B2017-219 save the restored document to database - this._MyEdWord = null; // B2017-219 Set MyEdWord to null - we will check for this in the calling functions - return; - //_MyDocumentInfo = DocumentInfo.Get(MyDocumentInfo.DocID); - //DocumentInfo.Refresh(myDoc); - ////_DSOFile = null; - //this._MyEdWord.Open(MyDSOFile.MyFile.FullName); - //doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - //doc.Range(1, 1); - } - } + _RefreshTimer.Enabled = true; + } + } + #endregion + #region Private Methods + private void SetupDSOTabPanel() + { + Dock = System.Windows.Forms.DockStyle.Fill; // Automatically Fill the panel + } + private void SetupDSO() + { + _Count++; // Increment the count of open Word documents (Limit = MSWordLimit) + _MyCount = _Count; + this._MyTransparentPanel = new TransparentPanel(); + this._MyEdWord = new AxEDWordLib.AxEDWord();// B2017-133 Edraw + _MyEdWord.BeginInit(); + this.Controls.Add(this._MyEdWord); + this.Controls.Add(this._MyTransparentPanel); // A transparent panel is added over top of the DSO Framer window so that + // the related tab can be activated when the user clicks on a Word Document. Since the Word document is actually running + // in a different thread, it does not behave properly with focus events. + this.components.Add(this._MyEdWord);// B2017-133 Edraw + this.components.Add(this._MyTransparentPanel); + this._MyTransparentPanel.Dock = System.Windows.Forms.DockStyle.Fill; + this._MyTransparentPanel.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this._MyTransparentPanel.ForeColor = System.Drawing.Color.Brown; // This is the color used to show InActive on the right side on the Word + // document menu line. + //this._MyTransPanel.Location = new System.Drawing.Point(0, 0); + //this._MyTransPanel.Name = "transPanel1"; + //this._MyTransPanel.Size = new System.Drawing.Size(370, 423); + //this._MyTransPanel.TabIndex = 1; + this._MyTransparentPanel.Click += new EventHandler(_MyTransparentPanel_Click); + this._MyEdWord.Dock = System.Windows.Forms.DockStyle.Fill; + //System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WordDSOTab)); + //this._DSOFramer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("_FC.OcxState"))); + _MyEdWord.EndInit(); + LBDocumentClass doc; + try + { + try + { + this._MyEdWord.LicenseName = "Volian7573291802";// B2017-133 Edraw + this._MyEdWord.LicenseCode = "EDW8-5527-1201-AB8A";// B2017-133 Edraw + DisableWordCommands(); + this._MyEdWord.Open(MyDSOFile.MyFile.FullName); + doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); + } + catch (Exception ex) + { + // B2017-137 Restore Previous valid version if the current version cannot be opened, + using (DocumentAuditInfoList dail = DocumentAuditInfoList.Get(MyDocumentInfo.DocID)) + { + if (dail.Count > 0) + { + //DocumentAuditInfo dai = dail[0]; + //foreach (DocumentAuditInfo tmpa in dail) + //{ + // if (tmpa.DTS > dai.DTS) dai = tmpa; + //} + if (MessageBox.Show("Do you want to revert to a previous version?", "Error in MS Word section", + MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + { + using (Document myDoc = Document.Get(MyDocumentInfo.DocID)) + { + myDoc.RestoreWordDoc(_ItemInfo); + } + using (Document myDoc = Document.Get(MyDocumentInfo.DocID)) + { + System.IO.FileStream fs = MyDSOFile.MyFile.Create(); + fs.Write(myDoc.DocContent, 0, myDoc.DocContent.Length); + fs.Close(); + MyDSOFile.SaveFile(0, "", _ItemInfo, false, StatusChanged); // B2017-219 save the restored document to database + this._MyEdWord = null; // B2017-219 Set MyEdWord to null - we will check for this in the calling functions + return; + //_MyDocumentInfo = DocumentInfo.Get(MyDocumentInfo.DocID); + //DocumentInfo.Refresh(myDoc); + ////_DSOFile = null; + //this._MyEdWord.Open(MyDSOFile.MyFile.FullName); + //doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); + //doc.Range(1, 1); + } + } - } - else - { - System.IO.FileStream fs = MyDSOFile.MyFile.Create(); - fs.Close(); - MyDSOFile.SaveFile(0, "", _ItemInfo, false, StatusChanged); // B2017-219 save the blank document to database - MessageBox.Show("Reverting to Blank Document", "Error in MS Word section", - MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - this._MyEdWord = null; // B2017-219 Set MyEdWord to null - we will check for this in the calling functions - return; - } - } - this._MyEdWord.Open(MyDSOFile.MyFile.FullName);// B2017-133 Edraw - } - doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - //Console.WriteLine("Version {0}", doc.Application.Version); - float ver; - if (!float.TryParse(doc.Application.Version, out ver)) - ver = 12.0F; - this.Enter += new EventHandler(DSOTabPanel_Enter); - // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel - this.Leave += DSOTabPanel_Leave; - Application.DoEvents(); - // The following line corrects Symbol characters in MSWord Sections - // CheckForSymbolCharacters(doc); - InitializeWordDocument(doc); - FindSearchString(); - } - catch (Exception ex) - { - //string message = ShowException(ex); - //Console.WriteLine("\r\n-------------\r\n{0}{1}{2}\r\n-------------\r\n", MyDSOFile.MyFile.FullName, ex.GetType().Name, message); - // TODO: Should output a message - // TODO: Should try to do a direct open using Word. - } - } + } + else + { + System.IO.FileStream fs = MyDSOFile.MyFile.Create(); + fs.Close(); + MyDSOFile.SaveFile(0, "", _ItemInfo, false, StatusChanged); // B2017-219 save the blank document to database + MessageBox.Show("Reverting to Blank Document", "Error in MS Word section", + MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + this._MyEdWord = null; // B2017-219 Set MyEdWord to null - we will check for this in the calling functions + return; + } + } + this._MyEdWord.Open(MyDSOFile.MyFile.FullName);// B2017-133 Edraw + } + doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); + //Console.WriteLine("Version {0}", doc.Application.Version); + float ver; + if (!float.TryParse(doc.Application.Version, out ver)) + ver = 12.0F; + this.Enter += new EventHandler(DSOTabPanel_Enter); + // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel + this.Leave += DSOTabPanel_Leave; + Application.DoEvents(); + // The following line corrects Symbol characters in MSWord Sections + // CheckForSymbolCharacters(doc); + InitializeWordDocument(doc); + FindSearchString(); + } + catch (Exception ex) + { + //string message = ShowException(ex); + //Console.WriteLine("\r\n-------------\r\n{0}{1}{2}\r\n-------------\r\n", MyDSOFile.MyFile.FullName, ex.GetType().Name, message); + // TODO: Should output a message + // TODO: Should try to do a direct open using Word. + } + } - void DSOTabPanel_Leave(object sender, EventArgs e) - { - // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel - _InDSOTabPanel = false; - } - public void FixSymbolCharacters() - { - CheckForSymbolCharacters(new LBDocumentClass(_MyEdWord.ActiveDocument()));// B2017-133 Edraw - } - private void CheckForSymbolCharacters(LBDocumentClass doc) - { - string fontHasSymbolCharacters = doc.FontHasSymbolCharacters; - if (fontHasSymbolCharacters != null) - { - // do a string for the log message, depending if this is a libdoc. - string msg = null; - if (MyDocumentInfo.LibTitle == null || MyDocumentInfo.LibTitle == "") - { - if (MyDocumentInfo.DocumentEntryCount>0) - msg = string.Format("Procedure = {0}, Section {1}", MyDocumentInfo.DocumentEntries[0].MyContent.ContentItems[0].MyProcedure, MyDocumentInfo.DocumentEntries[0].MyContent.ContentItems[0].DisplayText); - else - msg = string.Format("Procedure and Section can't be determined"); - } - else - msg = string.Format("Library Document: {0}", MyDocumentInfo.LibTitle); - if (doc.AttemptToFixASymbolCharacter()) // font is installed correctly, 'fix' this file. - { - //MessageBox.Show(string.Format("This document uses the font {0}, which previously had an error.\r\nThe program will attempt to fix the problem for this Word section.", fontHasSymbolCharacters), - // "Font Being Corrected", MessageBoxButtons.OK); - doc.FixSymbolCharacters(); - _MyLog.Info(string.Format("Font problem being fixed in Font: {0}, {1}.",fontHasSymbolCharacters, msg)); - } - else - { - MessageBox.Show(string.Format("This document uses the font {0}, which has an error.\r\n\r\nReinstall this font.", fontHasSymbolCharacters), - "Reinstall Font", MessageBoxButtons.OK); - _MyLog.Info(string.Format("Font problem found in Font: {0}, {1}.",fontHasSymbolCharacters, msg)); - } - } - } + void DSOTabPanel_Leave(object sender, EventArgs e) + { + // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel + _InDSOTabPanel = false; + } - private void InitializeWordDocument(LBDocumentClass doc) - { - if (MyDocumentInfo.Config == null || MyDocumentInfo.Config == "" && MyDocumentInfo.DocumentEntryCount > 0) - { - DocStyle ds = MyDocumentInfo.DocumentEntries[0].MyContent.ContentItems[0].MyDocStyle; - // this will cause an error and goto the Catch if the family or size is null, - // Westinghouse needs it to to this - at least for now - //if (ds.Font.Family != null) doc.Application.Selection.Font.Name = ds.Font.Family; - //if (ds.Font.Size != null) doc.Application.Selection.Font.Size = (float)ds.Font.Size; - doc.Application.Selection.Font.Name = ds.Font.Family; - doc.Application.Selection.Font.Size = (float)ds.Font.Size; - doc.Application.Selection.ParagraphFormat.SpaceBefore = 0; - doc.Application.Selection.ParagraphFormat.SpaceAfter = 0; - doc.Application.Selection.ParagraphFormat.LineSpacingRule = LBWdLineSpacing.wdLineSpaceExactly; - doc.Application.Selection.ParagraphFormat.LineSpacing = 72 / 6; // for 6 LPI - MSWordToPDF.AdjustMargins(ds, doc, false); - } - if (doc.ActiveWindow.ActivePane.View.Zoom.Percentage < 40) - doc.ActiveWindow.ActivePane.View.Zoom.Percentage = 100; - } - public void FindSearchString() - { - if (SearchString == null) return; - // Get the Document + private void InitializeWordDocument(LBDocumentClass doc) + { + if (MyDocumentInfo.Config == null || MyDocumentInfo.Config == "" && MyDocumentInfo.DocumentEntryCount > 0) + { + DocStyle ds = MyDocumentInfo.DocumentEntries[0].MyContent.ContentItems[0].MyDocStyle; + // this will cause an error and goto the Catch if the family or size is null, + // Westinghouse needs it to to this - at least for now + //if (ds.Font.Family != null) doc.Application.Selection.Font.Name = ds.Font.Family; + //if (ds.Font.Size != null) doc.Application.Selection.Font.Size = (float)ds.Font.Size; + doc.Application.Selection.Font.Name = ds.Font.Family; + doc.Application.Selection.Font.Size = (float)ds.Font.Size; + doc.Application.Selection.ParagraphFormat.SpaceBefore = 0; + doc.Application.Selection.ParagraphFormat.SpaceAfter = 0; + doc.Application.Selection.ParagraphFormat.LineSpacingRule = LBWdLineSpacing.wdLineSpaceExactly; + doc.Application.Selection.ParagraphFormat.LineSpacing = 72 / 6; // for 6 LPI + MSWordToPDF.AdjustMargins(ds, doc, false); + } + if (doc.ActiveWindow.ActivePane.View.Zoom.Percentage < 40) + doc.ActiveWindow.ActivePane.View.Zoom.Percentage = 100; + } + public void FindSearchString() + { + if (SearchString == null) return; + // Get the Document LBDocumentClass wordDoc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - //LBSelection sel = wordDoc.Application.Selection; - LBFind find = wordDoc.Application.Selection.Find; - find.ClearFormatting(); - bool wildCards = SearchString.Contains("?") || SearchString.Contains("*"); - bool found = find.Execute(SearchString, false, false, wildCards, false, false, true, LBWdFindWrap.wdFindContinue, null, null, null, false, false, false, false); - //Console.WriteLine("find = {0}", found); - } - /// - /// Text will either replace current selection or be inserted at the current cursor position if no selection - /// - /// - public void InsertText(string txt) - { - if (txt == null || txt.Length == 0) return; //nothing to insert - // Get the Document - LBDocumentClass wordDoc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - //This will get the selected range or just the current cursor position - LBSelection sel = wordDoc.Application.Selection; - // This will replace the selection or insert at current position - sel.Text = txt; - } + //LBSelection sel = wordDoc.Application.Selection; + LBFind find = wordDoc.Application.Selection.Find; + find.ClearFormatting(); + bool wildCards = SearchString.Contains("?") || SearchString.Contains("*"); + bool found = find.Execute(SearchString, false, false, wildCards, false, false, true, LBWdFindWrap.wdFindContinue, null, null, null, false, false, false, false); + //Console.WriteLine("find = {0}", found); + } + /// + /// Text will either replace current selection or be inserted at the current cursor position if no selection + /// + /// + public void InsertText(string txt) + { + if (txt == null || txt.Length == 0) return; //nothing to insert + // Get the Document + LBDocumentClass wordDoc = new LBDocumentClass(_MyEdWord.ActiveDocument()); + //This will get the selected range or just the current cursor position + LBSelection sel = wordDoc.Application.Selection; + // This will replace the selection or insert at current position + sel.Text = txt; + } - public string GetSelectedString() - { - LBDocumentClass wordDoc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - //This will get the selected range or just the current cursor position - LBSelection sel = wordDoc.Application.Selection; - // if the start & end are the same, nothing is selected: - if (sel.Start == sel.End) return null; - return sel.Text; - } + public string GetSelectedString() + { + LBDocumentClass wordDoc = new LBDocumentClass(_MyEdWord.ActiveDocument()); + //This will get the selected range or just the current cursor position + LBSelection sel = wordDoc.Application.Selection; + // if the start & end are the same, nothing is selected: + if (sel.Start == sel.End) return null; + return sel.Text; + } - private string ShowException(Exception ex) - { - string sep = "\r\n "; - StringBuilder sb = new StringBuilder(); - do - { - sb.Append(sep + ex.Message); - sep += " "; - ex = ex.InnerException; - } while (ex != null); - return sb.ToString(); - } + private string ShowException(Exception ex) + { + string sep = "\r\n "; + StringBuilder sb = new StringBuilder(); + do + { + sb.Append(sep + ex.Message); + sep += " "; + ex = ex.InnerException; + } while (ex != null); + return sb.ToString(); + } - //void _MyDSOFramer_Leave(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSO Leave {0}", this.MyDocumentInfo.DocID); - //} + //void _MyDSOFramer_Leave(object sender, EventArgs e) + //{ + // vlnStackTrace.ShowStack("DSO Leave {0}", this.MyDocumentInfo.DocID); + //} - //void _MyDSOFramer_Enter(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSO Enter {0}", this.MyDocumentInfo.DocID); - //} + //void _MyDSOFramer_Enter(object sender, EventArgs e) + //{ + // vlnStackTrace.ShowStack("DSO Enter {0}", this.MyDocumentInfo.DocID); + //} - //void _MyDSOFramer_GotFocus(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSO Got Focus {0}",this.MyDocumentInfo.DocID); - //} + //void _MyDSOFramer_GotFocus(object sender, EventArgs e) + //{ + // vlnStackTrace.ShowStack("DSO Got Focus {0}",this.MyDocumentInfo.DocID); + //} - //void _MyDSOFramer_LostFocus(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSO Lost Focus {0}", this.MyDocumentInfo.DocID); - //} - public void EnterPanel() - { - DSOTabPanel_Enter(this, new EventArgs()); - } - //void DSOTabPanel_LostFocus(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSOTabPanel_LostFocus {0} DocID {1} Index {2} {3}", _In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName); - //} - //void DSOTabPanel_GotFocus(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSOTabPanel_GotFocus {0} DocID {1} Index {2} {3}", _In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName); - //} - #endregion - #region Event Handlers - /// - /// Display MyTransparentPanel over the DSOPanel so that the Word "Inactive" appears in the upper right hand corner. - /// - public void InActive() - { - _MyTransparentPanel.BringToFront(); - } - /// - /// Force this item to be selected when the transparent window is clicked. - /// This will in-turn send the Transparent Panel to back and make the DSO Panel - /// editable. - /// - /// - /// - void _MyTransparentPanel_Click(object sender, EventArgs e) - { - this.Select(); - } - ///// - ///// If the user presses the save button, tell the file to save it's contents to the database - ///// - ///// - ///// - //void _MyDSOFramer_OnSaveCompleted(object sender, AxDSOFramer._DFramerCtlEvents_OnSaveCompletedEvent e) - //{ - // _MyLog.WarnFormat("_MyDSOFramer_OnSaveCompleted"); - // Volian.Base.Library.vlnStackTrace.ShowStack("_MyDSOFramer_OnSaveCompleted"); - // SaveDSO_Phase2(); - //} + //void _MyDSOFramer_LostFocus(object sender, EventArgs e) + //{ + // vlnStackTrace.ShowStack("DSO Lost Focus {0}", this.MyDocumentInfo.DocID); + //} + public void EnterPanel() + { + DSOTabPanel_Enter(this, new EventArgs()); + } + //void DSOTabPanel_LostFocus(object sender, EventArgs e) + //{ + // vlnStackTrace.ShowStack("DSOTabPanel_LostFocus {0} DocID {1} Index {2} {3}", _In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName); + //} + //void DSOTabPanel_GotFocus(object sender, EventArgs e) + //{ + // vlnStackTrace.ShowStack("DSOTabPanel_GotFocus {0} DocID {1} Index {2} {3}", _In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName); + //} + #endregion + #region Event Handlers + /// + /// Display MyTransparentPanel over the DSOPanel so that the Word "Inactive" appears in the upper right hand corner. + /// + public void InActive() + { + _MyTransparentPanel.BringToFront(); + } + /// + /// Force this item to be selected when the transparent window is clicked. + /// This will in-turn send the Transparent Panel to back and make the DSO Panel + /// editable. + /// + /// + /// + void _MyTransparentPanel_Click(object sender, EventArgs e) + { + this.Select(); + } + ///// + ///// If the user presses the save button, tell the file to save it's contents to the database + ///// + ///// + ///// + //void _MyDSOFramer_OnSaveCompleted(object sender, AxDSOFramer._DFramerCtlEvents_OnSaveCompletedEvent e) + //{ + // _MyLog.WarnFormat("_MyDSOFramer_OnSaveCompleted"); + // Volian.Base.Library.vlnStackTrace.ShowStack("_MyDSOFramer_OnSaveCompleted"); + // SaveDSO_Phase2(); + //} - private void SaveDSO_Phase2() - { - // Unfortunately, the only way to handle view mode for DSO Framer is to not save. - if (PanelViewEditMode == E_ViewMode.View) - { - MessageBox.Show("Currently in VIEW mode,\r\n cannot Save " + _MyDisplayTabItem.Tooltip); - return; - } - LBDocumentClass doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - //while (doc.Saved = false) - // Application.DoEvents(); - string tmp = GetReflectiveProperty(_MyEdWord.ActiveDocument(), "FullName"); - if (System.IO.File.Exists(tmp)) - MyDSOFile.FullName = tmp; - else - _MyLog.FatalFormat("File does not exist {0}\r\nFile was {1}", tmp, MyDSOFile.FullName); - // if this was a library document, ask user if it should be saved for all usages. - bool cvtLibDoc = false; - if (MyDisplayTabItem.MyItemInfo != null) // B2016-131 if myiteminfo is null then the lib doc is not referenced, so just save the changes - don't generate a pdf - { - EntryInfo myei = MyDisplayTabItem.MyItemInfo.MyContent.MyEntry; - if (myei != null && myei.MyDocument != null && myei.MyDocument.LibTitle != null && myei.MyDocument.LibTitle != "") - { - // C2019-033 - make save options more clear with respect to library documents - string msgstr = "Save to Library Document?" + - "\n\n YES - Save for all usages of this Library Document." + - "\n\n NO - Unlink this Section from the Library Document and Save in this Word Section.\n\n" + - _MyDocumentInfo.LibraryDocumentUsageAll; - DialogResult ans = FlexibleMessageBox.Show(msgstr, "Document Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (ans == DialogResult.No) cvtLibDoc = true; - } - } - MyDSOFile.SaveFile(doc.Length, doc.Ascii, MyDisplayTabItem.MyItemInfo, cvtLibDoc, StatusChanged); - if (cvtLibDoc) - { - MyDisplayTabItem.Text = MyDisplayTabItem.MyItemInfo.TabTitle; - MyDisplayTabItem.Tooltip = MyDisplayTabItem.MyItemInfo.TabToolTip; - MyDisplayTabItem.SetPrivateTooltip(MyDisplayTabItem.MyItemInfo.TabToolTip); - } - } - public void StatusChanged(VolianStatusType type, int count, string text) - { - if (Parent != null && Parent.Parent != null && Parent.Parent.Parent is DisplayTabControl) - { - DisplayTabControl tc = Parent.Parent.Parent as DisplayTabControl; - tc.ONStatusChanged(this, new DisplayTabControlStatusEventArgs(type, count, text)); - } - } - ///// - ///// Before a document closes check to see if it's contents should be saved. - ///// - ///// - ///// - //void _MyDSOFramer_BeforeDocumentClosed(object sender, AxDSOFramer._DFramerCtlEvents_BeforeDocumentClosedEvent e) - //{ - // SaveDSOPhase1(); - //} + private void SaveDSO_Phase2() + { + // Unfortunately, the only way to handle view mode for DSO Framer is to not save. + if (PanelViewEditMode == E_ViewMode.View) + { + MessageBox.Show("Currently in VIEW mode,\r\n cannot Save " + _MyDisplayTabItem.Tooltip); + return; + } + LBDocumentClass doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); + //while (doc.Saved = false) + // Application.DoEvents(); + string tmp = GetReflectiveProperty(_MyEdWord.ActiveDocument(), "FullName"); + if (System.IO.File.Exists(tmp)) + MyDSOFile.FullName = tmp; + else + _MyLog.FatalFormat("File does not exist {0}\r\nFile was {1}", tmp, MyDSOFile.FullName); + // if this was a library document, ask user if it should be saved for all usages. + bool cvtLibDoc = false; + if (MyDisplayTabItem.MyItemInfo != null) // B2016-131 if myiteminfo is null then the lib doc is not referenced, so just save the changes - don't generate a pdf + { + EntryInfo myei = MyDisplayTabItem.MyItemInfo.MyContent.MyEntry; + if (myei != null && myei.MyDocument != null && myei.MyDocument.LibTitle != null && myei.MyDocument.LibTitle != "") + { + // C2019-033 - make save options more clear with respect to library documents + string msgstr = "Save to Library Document?" + + "\n\n YES - Save for all usages of this Library Document." + + "\n\n NO - Unlink this Section from the Library Document and Save in this Word Section.\n\n" + + _MyDocumentInfo.LibraryDocumentUsageAll; + DialogResult ans = FlexibleMessageBox.Show(msgstr, "Document Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question); + if (ans == DialogResult.No) cvtLibDoc = true; + } + } + MyDSOFile.SaveFile(doc.Length, doc.Ascii, MyDisplayTabItem.MyItemInfo, cvtLibDoc, StatusChanged); + if (cvtLibDoc) + { + MyDisplayTabItem.Text = MyDisplayTabItem.MyItemInfo.TabTitle; + MyDisplayTabItem.Tooltip = MyDisplayTabItem.MyItemInfo.TabToolTip; + MyDisplayTabItem.SetPrivateTooltip(MyDisplayTabItem.MyItemInfo.TabToolTip); + } + } + public void StatusChanged(VolianStatusType type, int count, string text) + { + if (Parent != null && Parent.Parent != null && Parent.Parent.Parent is DisplayTabControl) + { + DisplayTabControl tc = Parent.Parent.Parent as DisplayTabControl; + tc.ONStatusChanged(this, new DisplayTabControlStatusEventArgs(type, count, text)); + } + } + ///// + ///// Before a document closes check to see if it's contents should be saved. + ///// + ///// + ///// + //void _MyDSOFramer_BeforeDocumentClosed(object sender, AxDSOFramer._DFramerCtlEvents_BeforeDocumentClosedEvent e) + //{ + // SaveDSOPhase1(); + //} - private void SaveDSO_Phase1() - { - try - { - if (!IsBeingDeleted) - SaveDirty(); - this.Enter -= new EventHandler(DSOTabPanel_Enter); - // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel - this.Leave -= DSOTabPanel_Leave; - // SaveDirty(); // SaveDirty happens in CloseDSO(bool) - } - catch (Exception ex) - { - _MyLog.Warn("Before Closing Document ", ex); - } - } - /// - /// Save the contents of the Word Document to a file - /// and save the file to the database - /// - /// - public bool SaveDSO() - { - bool result = true; - try - { - bool stat = _MyEdWord.Save();// B2017-133 Edraw - //Console.WriteLine("Save = {0}", stat); - SaveDSO_Phase2(); - //_MyDSOFramer_OnSaveCompleted(this, null); - // These are handled in the method above - //LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument); - //MyDSOFile.FullName = GetReflectiveProperty(_MyDSOFramer.ActiveDocument, "FullName"); - //MyDSOFile.SaveFile(doc.Length, doc.Ascii); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SaveDSO", ex); - MessageBox.Show(ex.Message, "Error Saving Document", MessageBoxButtons.OK, MessageBoxIcon.Error); - result = false; - } - return result; - } - /// - /// Check to see if a Word document should be saved. If it is dirty ask the user if the - /// changes should be changed. Save the changes if the user says "yes". - /// - /// - public bool SaveDirty() - { - if (OverrideClose) - return false; - // B2017-249 Recover Temporary File And AutoSave support for MSWord - if (IsDirty || MyDSOFile.MyDocument.ContentIsDirty) - { - // Unfortunately, the only way to handle view mode for DSO Framer is to not save. - if (PanelViewEditMode == E_ViewMode.View || !_AllowedToEdit) - { - MessageBox.Show("Currently in VIEW mode,\r\n cannot Save " + _MyDisplayTabItem.Tooltip); - return false; - } - //if (MessageBox.Show("Save changes to " + _MyDisplayTabItem.MyItemInfo.TabTitle + "\r\n" + _MyDisplayTabItem.MyItemInfo.TabToolTip, "Document has Changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - // B2017-249 Recover Temporary File And AutoSave support for MSWord - // C2019-033 - make save options more clear with respect to library documents second dialog will appear if Yes is selected and it's a library document - string msgstr = "Save changes to " + (MyDSOFile.MyDocument.ContentIsDirty ? "Recovered Version of " : "") + _MyDisplayTabItem.Text; + private void SaveDSO_Phase1() + { + try + { + if (!IsBeingDeleted) + SaveDirty(); + this.Enter -= new EventHandler(DSOTabPanel_Enter); + // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel + this.Leave -= DSOTabPanel_Leave; + // SaveDirty(); // SaveDirty happens in CloseDSO(bool) + } + catch (Exception ex) + { + _MyLog.Warn("Before Closing Document ", ex); + } + } + /// + /// Save the contents of the Word Document to a file + /// and save the file to the database + /// + /// + public bool SaveDSO() + { + bool result = true; + try + { + bool stat = _MyEdWord.Save();// B2017-133 Edraw + //Console.WriteLine("Save = {0}", stat); + SaveDSO_Phase2(); + //_MyDSOFramer_OnSaveCompleted(this, null); + // These are handled in the method above + //LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument); + //MyDSOFile.FullName = GetReflectiveProperty(_MyDSOFramer.ActiveDocument, "FullName"); + //MyDSOFile.SaveFile(doc.Length, doc.Ascii); + } + catch (Exception ex) + { + if (_MyLog.IsErrorEnabled) _MyLog.Error("SaveDSO", ex); + MessageBox.Show(ex.Message, "Error Saving Document", MessageBoxButtons.OK, MessageBoxIcon.Error); + result = false; + } + return result; + } + /// + /// Check to see if a Word document should be saved. If it is dirty ask the user if the + /// changes should be changed. Save the changes if the user says "yes". + /// + /// + public bool SaveDirty() + { + if (OverrideClose) + return false; + // B2017-249 Recover Temporary File And AutoSave support for MSWord + if (IsDirty || MyDSOFile.MyDocument.ContentIsDirty) + { + // Unfortunately, the only way to handle view mode for DSO Framer is to not save. + if (PanelViewEditMode == E_ViewMode.View || !_AllowedToEdit) + { + MessageBox.Show("Currently in VIEW mode,\r\n cannot Save " + _MyDisplayTabItem.Tooltip); + return false; + } + //if (MessageBox.Show("Save changes to " + _MyDisplayTabItem.MyItemInfo.TabTitle + "\r\n" + _MyDisplayTabItem.MyItemInfo.TabToolTip, "Document has Changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + // B2017-249 Recover Temporary File And AutoSave support for MSWord + // C2019-033 - make save options more clear with respect to library documents second dialog will appear if Yes is selected and it's a library document + string msgstr = "Save changes to " + (MyDSOFile.MyDocument.ContentIsDirty ? "Recovered Version of " : "") + _MyDisplayTabItem.Text; if (FlexibleMessageBox.Show(msgstr, (IsDirty ? "Document has Changed" : "Previous Changes were not Saved"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - return SaveDSO(); - //Console.WriteLine("Delete {0}", MyDSOFile.MyFile.Name); - DeleteOnClose = true; - return false; - } - return true; - } - // B2017-249 Recover Temporary File And AutoSave support for MSWord - private bool _DeleteOnClose = false; + return SaveDSO(); + //Console.WriteLine("Delete {0}", MyDSOFile.MyFile.Name); + DeleteOnClose = true; + return false; + } + return true; + } + // B2017-249 Recover Temporary File And AutoSave support for MSWord + private bool _DeleteOnClose = false; - public bool DeleteOnClose - { - get { return _DeleteOnClose; } - set { _DeleteOnClose = value; } - } - public static bool IgnoreEnter = false; + public bool DeleteOnClose + { + get { return _DeleteOnClose; } + set { _DeleteOnClose = value; } + } + public static bool IgnoreEnter = false; private bool _In_DSOTabPanel_Enter=false; - // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel - private bool _InDSOTabPanel = false; - /// - /// When a Word document is selected make sure it's tab is activated and - /// the SelectedItem for the DisplayTabControl is updated. - /// - /// - /// - private void DSOTabPanel_Enter(object sender, EventArgs e) - { - // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel - _InDSOTabPanel = true; - if (IgnoreEnter) return; - _MyTransparentPanel.SendToBack(); + // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel + private bool _InDSOTabPanel = false; + /// + /// When a Word document is selected make sure it's tab is activated and + /// the SelectedItem for the DisplayTabControl is updated. + /// + /// + /// + private void DSOTabPanel_Enter(object sender, EventArgs e) + { + // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel + _InDSOTabPanel = true; + if (IgnoreEnter) return; + _MyTransparentPanel.SendToBack(); - // Set whether this worddoc is in view/edit mode by checking whether the - // procedure is in view/edit mode (based on the steppanel. This occurs on - // the enter event so that the mode is determined any time this panel becomes - // active. - // find steptabpanel and its view/edit. If it doesn't have a steptabpanel - // use default - edit. Later when we have ownership, need to use that. + // Set whether this worddoc is in view/edit mode by checking whether the + // procedure is in view/edit mode (based on the steppanel. This occurs on + // the enter event so that the mode is determined any time this panel becomes + // active. + // find steptabpanel and its view/edit. If it doesn't have a steptabpanel + // use default - edit. Later when we have ownership, need to use that. PanelViewEditMode = E_ViewMode.Edit; // default to edit - if (MyDisplayTabItem.MyItemInfo != null) // lib doc with no associated active procedure defaults to edit - { - StepTabPanel stpanel = _MyDisplayTabControl.GetProcedureTabPanel(MyDisplayTabItem.MyItemInfo); - PanelViewEditMode = (stpanel == null) ? E_ViewMode.Edit : stpanel.MyStepPanel.VwMode; - } - try - { - //_MyDSOFramer.EventsEnabled = true; - //_MyEdWord.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow; - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.ErrorFormat("DSOTabPage_Enter", ex); - } - if (_In_DSOTabPanel_Enter) return; - //vlnStackTrace.ShowStack("DSOTabPanel_Enter {0} DocID {1} Index {2} {3}",_In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName); - _In_DSOTabPanel_Enter = true; + if (MyDisplayTabItem.MyItemInfo != null) // lib doc with no associated active procedure defaults to edit + { + StepTabPanel stpanel = _MyDisplayTabControl.GetProcedureTabPanel(MyDisplayTabItem.MyItemInfo); + PanelViewEditMode = (stpanel == null) ? E_ViewMode.Edit : stpanel.MyStepPanel.VwMode; + } + try + { + //_MyDSOFramer.EventsEnabled = true; + //_MyEdWord.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow; + } + catch (Exception ex) + { + if (_MyLog.IsErrorEnabled) _MyLog.ErrorFormat("DSOTabPage_Enter", ex); + } + if (_In_DSOTabPanel_Enter) return; + //vlnStackTrace.ShowStack("DSOTabPanel_Enter {0} DocID {1} Index {2} {3}",_In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName); + _In_DSOTabPanel_Enter = true; if (MyDisplayTabItem.MyItemInfo != null) _MyDisplayTabControl.OnItemSelectedChanged(this,new ItemSelectedChangedEventArgs(MyDisplayTabItem.MyItemInfo)); - _MyEdWord.Focus(); - _In_DSOTabPanel_Enter = false; - _MyDisplayTabControl.SelectedDisplayTabItem = MyDisplayTabItem; - // B2018-070 Position the text cursor - Activate MS Word Panel - _MyEdWord.GotoItem(EDWordLib.WdGoToItem.wdGoToObject, EDWordLib.WdGoToDirection.wdGoToNext, 0, null); - } - #endregion - #region Public Methods - private bool _IsBeingDeleted = false; - public bool IsBeingDeleted - { - get { return _IsBeingDeleted; } - set { _IsBeingDeleted = value; } - } - /// - /// Cleans-up the DSO Framer window - /// - /// - public bool CloseDSO() - { - return CloseDSO(false); - } - /// - /// Cleans-up the DSO Framer window - /// - /// - /// - public bool CloseDSO(bool force) - { - _MyLog.Debug("CloseDSO"); - bool result = true; - try - { - if (_MyEdWord != null) - { - SaveDSO_Phase1(); - _MyEdWord.CloseDoc(); - Controls.Remove(_MyEdWord); - components.Remove(_MyEdWord); - _MyEdWord.Dispose(); - _MyEdWord = null; - // B2017-249 Recover Temporary File And AutoSave support for MSWord - if (DeleteOnClose) MyDSOFile.MyFile.Delete(); - _Count--; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SaveDSO - " + this.Name, ex); - result = false; - } - return result; - } - /// - /// Activates the current DSO Framer window (Word) - /// - public void Activate() - { - try - { - //this._MyEdWord.Activate(); - //if (_MyCount <= MSWordLimit) - // this._MyEdWord.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow; - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Activate", ex); - } - } - #endregion - #region DocumentProperties + _MyEdWord.Focus(); + _In_DSOTabPanel_Enter = false; + _MyDisplayTabControl.SelectedDisplayTabItem = MyDisplayTabItem; + // B2018-070 Position the text cursor - Activate MS Word Panel + _MyEdWord.GotoItem(EDWordLib.WdGoToItem.wdGoToObject, EDWordLib.WdGoToDirection.wdGoToNext, 0, null); + } + #endregion + #region Public Methods + private bool _IsBeingDeleted = false; + public bool IsBeingDeleted + { + get { return _IsBeingDeleted; } + set { _IsBeingDeleted = value; } + } + /// + /// Cleans-up the DSO Framer window + /// + /// + public bool CloseDSO() + { + return CloseDSO(false); + } + /// + /// Cleans-up the DSO Framer window + /// + /// + /// + public bool CloseDSO(bool force) + { + _MyLog.Debug("CloseDSO"); + bool result = true; + try + { + if (_MyEdWord != null) + { + SaveDSO_Phase1(); + _MyEdWord.CloseDoc(); + Controls.Remove(_MyEdWord); + components.Remove(_MyEdWord); + _MyEdWord.Dispose(); + _MyEdWord = null; + // B2017-249 Recover Temporary File And AutoSave support for MSWord + if (DeleteOnClose) MyDSOFile.MyFile.Delete(); + _Count--; + } + } + catch (Exception ex) + { + if (_MyLog.IsErrorEnabled) _MyLog.Error("SaveDSO - " + this.Name, ex); + result = false; + } + return result; + } + /// + /// Activates the current DSO Framer window (Word) + /// + public void Activate() + { + try + { + //this._MyEdWord.Activate(); + //if (_MyCount <= MSWordLimit) + // this._MyEdWord.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow; + } + catch (Exception ex) + { + if (_MyLog.IsErrorEnabled) _MyLog.Error("Activate", ex); + } + } + #endregion + #region DocumentProperties - private string GetReflectiveProperty(object objectToInspect, string propertyName) - { - string returnString = ""; - //To use reflection on an object, you - // first need to get an instance - // of that object's type. - Type objectType = objectToInspect.GetType(); - //After you have the object's type, you can get - // information on that type. In this case, we're - // asking the type to tell us all the - // properties that it contains. - PropertyInfo[] properties = objectType.GetProperties(); - //You can then use the PropertyInfo array - // to loop through each property of the type. - foreach (PropertyInfo property in properties) - { - //The interest part of this code - // is the GetValue method. This method - // returns the value of the property. + private string GetReflectiveProperty(object objectToInspect, string propertyName) + { + string returnString = ""; + //To use reflection on an object, you + // first need to get an instance + // of that object's type. + Type objectType = objectToInspect.GetType(); + //After you have the object's type, you can get + // information on that type. In this case, we're + // asking the type to tell us all the + // properties that it contains. + PropertyInfo[] properties = objectType.GetProperties(); + //You can then use the PropertyInfo array + // to loop through each property of the type. + foreach (PropertyInfo property in properties) + { + //The interest part of this code + // is the GetValue method. This method + // returns the value of the property. if(property.Name == propertyName) - return property.GetValue(objectToInspect, null).ToString(); - } - return null; - } - #endregion - public override string ToString() - { - return string.Format("DSOTabPanel Document {0}", MyDocumentInfo.DocID); - } - } + return property.GetValue(objectToInspect, null).ToString(); + } + return null; + } + #endregion + public override string ToString() + { + return string.Format("DSOTabPanel Document {0}", MyDocumentInfo.DocID); + } + } } From 7273a8b13b3da589f87670f176262f9f5e5ef92e Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Mon, 27 Apr 2026 15:43:38 -0400 Subject: [PATCH 04/25] Development --- PROMS/VEPROMS User Interface/frmVEPROMS.cs | 1 - .../DisplayApplicability.Designer.cs | 2 +- .../DisplayApplicability.cs | 18 +++++++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 10210c96..d998f451 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -11,7 +11,6 @@ using System.IO; using System.Configuration; using System.Reflection; using VEPROMS.CSLA.Library; -//using Csla; using DevComponents; using DevComponents.DotNetBar; using DevComponents.DotNetBar.Rendering; diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs index cc37fbea..0faa9a92 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs @@ -49,7 +49,7 @@ namespace Volian.Controls.Library this.btnApplicabilitychg.Size = new System.Drawing.Size(80, 22); this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(2); this.btnApplicabilitychg.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all steps at the level of the current step will have their applicability settings changed. Note that for two column procedures, the left column and right column are handled separately.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all sub-steps at that level of the current step will be set to the selected applicability. Note that this button is disabled when on a RNO step type but enabled for sub-step under it.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); this.btnApplicabilitychg.TabIndex = 0; this.btnApplicabilitychg.Text = "Set All at Level"; this.btnApplicabilitychg.ColorTable = DevComponents.DotNetBar.eButtonColor.BlueOrb; diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.cs index 48b7003e..d5a06001 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.cs @@ -69,6 +69,14 @@ namespace Volian.Controls.Library { MyItemInfo = _MyDisplayTabItem.MyItemInfo; } + if (MyItemInfo.IsRNOPart == true) + { + btnApplicabilitychg.Enabled = false; + } + else + { + btnApplicabilitychg.Enabled = true; + } } } } @@ -390,10 +398,18 @@ namespace Volian.Controls.Library } } } - _MyItemInfo = value; + _MyItemInfo = value; if (_MyItemInfo != null) { if (this.Visible == false) return; + if (_MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button. + { + btnApplicabilitychg.Enabled = false; + } + else + { + btnApplicabilitychg.Enabled = true; + } IItemConfig cfg = _MyItemInfo.MyConfig as IItemConfig; List apples = cfg.MasterSlave_Applicability.GetFlags(); UnwireCheckboxes(true); From 2b57c552d1a388cc60a7f5ddcb888fb586c8fd9b Mon Sep 17 00:00:00 2001 From: mschill Date: Tue, 28 Apr 2026 11:03:04 -0400 Subject: [PATCH 05/25] B2026-040 - Signoff/Checkoffs not printing unless set to Section Default --- PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index a2c4960e..5150df19 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -6215,8 +6215,13 @@ namespace VEPROMS.CSLA.Library if (!SectionHasCheckOffs()) return null; int stpCoIndx = CheckOffIndex(); // this step has a checkoff defined if (stpCoIndx == -1) return null; + //B2026-040 - Signoff/Checkoffs not printing unless set to Section Default + if (stpCoIndx > 1) + { + return ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList[stpCoIndx]; // DO override of CheckOffList[] + } - int sectCoIndx = SectionDefaultCheckOffIndex(); // no checkoff on step, see if there is a section default. + int sectCoIndx = SectionDefaultCheckOffIndex(); // no checkoff on step, see if there is a section default. if (sectCoIndx == -1) return null; if ((ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffOnHLSOnly && IsHigh) || (!ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffOnHLSOnly && IsLowestLevelStep && stpCheckOff)) // && !RNOsHighHasCheckOff())) From b321bc354b5b9d9665c8d5d04ae6f09797a28fa4 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Tue, 28 Apr 2026 18:09:15 -0400 Subject: [PATCH 06/25] C2026-027-New-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-3 --- PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs | 1 + PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs | 1 + PROMS/Volian.Controls.Library/DisplayApplicability.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 5150df19..6bbb9e0a 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -9241,3 +9241,4 @@ namespace VEPROMS.CSLA.Library Everything = 2 } } + diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs index 0faa9a92..d3f1a844 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs @@ -175,3 +175,4 @@ namespace Volian.Controls.Library } } + diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.cs index d5a06001..77342c37 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.cs @@ -516,3 +516,4 @@ namespace Volian.Controls.Library } } } + From 123b1b08c2071f4094a6f58d8a02d16e49ba48e0 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Thu, 30 Apr 2026 08:20:41 -0400 Subject: [PATCH 07/25] C2026-027-New-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-3 --- PROMS/VEPROMS User Interface/frmVEPROMS.cs | 1 + PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs | 1 - PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index d998f451..10210c96 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -11,6 +11,7 @@ using System.IO; using System.Configuration; using System.Reflection; using VEPROMS.CSLA.Library; +//using Csla; using DevComponents; using DevComponents.DotNetBar; using DevComponents.DotNetBar.Rendering; diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 6bbb9e0a..5150df19 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -9241,4 +9241,3 @@ namespace VEPROMS.CSLA.Library Everything = 2 } } - diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs index d3f1a844..cffdd423 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs @@ -49,7 +49,7 @@ namespace Volian.Controls.Library this.btnApplicabilitychg.Size = new System.Drawing.Size(80, 22); this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(2); this.btnApplicabilitychg.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all sub-steps at that level of the current step will be set to the selected applicability. Note that this button is disabled when on a RNO step type but enabled for sub-step under it.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all steps at that level of the current step will be set to the selected applicability. Note that this button is disabled when on a RNO step type but enabled for sub-step under it.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); this.btnApplicabilitychg.TabIndex = 0; this.btnApplicabilitychg.Text = "Set All at Level"; this.btnApplicabilitychg.ColorTable = DevComponents.DotNetBar.eButtonColor.BlueOrb; From 2a9f2e188dc857d6bde55a56a97f2c3610a7e313 Mon Sep 17 00:00:00 2001 From: mschill Date: Thu, 30 Apr 2026 13:53:02 -0400 Subject: [PATCH 08/25] C2026-015 Set overall Changebar date when approving multi-unit --- PROMS/VEPROMS User Interface/dlgApproveProcedure.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs index cdbfc521..b808b138 100644 --- a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs +++ b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs @@ -1478,11 +1478,15 @@ namespace VEPROMS { ProcedureConfig pc = procedureInfo.MyConfig as ProcedureConfig; if (pc == null) return; - pc.SelectedSlave = selectedSlave; + + //C2026-015 set overall change bar date + pc.Print_ChangeBarDate = dts.ToString("MM/dd/yyyy HH:mm:ss"); + + pc.SelectedSlave = selectedSlave; pc.Print_Rev = revNumber; //AppRevDate Change pc.Print_RevDate = revDate.ToString("MM/dd/yyyy"); - pc.Print_ChangeBarDate = dts.ToString("MM/dd/yyyy HH:mm:ss"); + pc.Print_ChangeBarDate = dts.ToString("MM/dd/yyyy HH:mm:ss"); //this is needed to set the changebar date for an indeividual unit also using (Item itm = Item.Get(procedureInfo.ItemID)) { itm.MyContent.Config = pc.ToString(); From 1b1dc785489c337ed833c778db5520f4181299f3 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Thu, 30 Apr 2026 16:37:10 -0400 Subject: [PATCH 09/25] C2026-027-New-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-4 --- .../DisplayApplicability.cs | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.cs index 77342c37..e68ced7a 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.cs @@ -69,13 +69,16 @@ namespace Volian.Controls.Library { MyItemInfo = _MyDisplayTabItem.MyItemInfo; } - if (MyItemInfo.IsRNOPart == true) + if (MyItemInfo != null) { - btnApplicabilitychg.Enabled = false; - } - else - { - btnApplicabilitychg.Enabled = true; + if (MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button. + { + btnApplicabilitychg.Enabled = false; + } + else + { + btnApplicabilitychg.Enabled = true; + } } } } @@ -402,13 +405,16 @@ namespace Volian.Controls.Library if (_MyItemInfo != null) { if (this.Visible == false) return; - if (_MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button. + if (MyItemInfo != null) { - btnApplicabilitychg.Enabled = false; - } - else - { - btnApplicabilitychg.Enabled = true; + if (MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button. + { + btnApplicabilitychg.Enabled = false; + } + else + { + btnApplicabilitychg.Enabled = true; + } } IItemConfig cfg = _MyItemInfo.MyConfig as IItemConfig; List apples = cfg.MasterSlave_Applicability.GetFlags(); From 90c215d4c1821b3106782cef40125348154c0163 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Fri, 1 May 2026 16:26:04 -0400 Subject: [PATCH 10/25] B2026-042-Fix-Null-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-4 --- .../DisplayApplicability.cs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.cs index e68ced7a..5022dde7 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.cs @@ -42,7 +42,7 @@ namespace Volian.Controls.Library names.Add(dcfg.Unit_Name); } dcfg.SelectedSlave = 0; -// string[] names = dcfg.Unit_Name.Split(','); + // string[] names = dcfg.Unit_Name.Split(','); int apple = -1; if(_MyDisplayTabItem.MyStepTabPanel != null) apple = _MyDisplayTabItem.MyStepTabPanel.MyStepPanel.ApplDisplayMode; @@ -69,17 +69,6 @@ namespace Volian.Controls.Library { MyItemInfo = _MyDisplayTabItem.MyItemInfo; } - if (MyItemInfo != null) - { - if (MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button. - { - btnApplicabilitychg.Enabled = false; - } - else - { - btnApplicabilitychg.Enabled = true; - } - } } } } @@ -405,9 +394,9 @@ namespace Volian.Controls.Library if (_MyItemInfo != null) { if (this.Visible == false) return; - if (MyItemInfo != null) + if (_MyItemInfo != null) { - if (MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button. + if (_MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button. { btnApplicabilitychg.Enabled = false; } From d0cae8c2fc1f4c3ddfbd831006fb38c1ebdee3eb Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Mon, 4 May 2026 08:48:51 -0400 Subject: [PATCH 11/25] B2026-042-Fix-Null-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-4 --- .../DisplayApplicability.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.cs index 5022dde7..271f1f98 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.cs @@ -394,16 +394,13 @@ namespace Volian.Controls.Library if (_MyItemInfo != null) { if (this.Visible == false) return; - if (_MyItemInfo != null) + if (_MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button. { - if (_MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button. - { - btnApplicabilitychg.Enabled = false; - } - else - { - btnApplicabilitychg.Enabled = true; - } + btnApplicabilitychg.Enabled = false; + } + else + { + btnApplicabilitychg.Enabled = true; } IItemConfig cfg = _MyItemInfo.MyConfig as IItemConfig; List apples = cfg.MasterSlave_Applicability.GetFlags(); From a0e0b1e788030378e00596c8e7431717d8a6937e Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Mon, 4 May 2026 16:33:08 -0400 Subject: [PATCH 12/25] B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function --- .../DisplayApplicability.Designer.cs | 39 ++++++++++++++++--- .../DisplayApplicability.cs | 13 ++++++- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs index cffdd423..25f3c2de 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs @@ -1,3 +1,4 @@ +using System.Drawing; using System.Security.Cryptography; using VEPROMS.CSLA.Library; @@ -34,7 +35,8 @@ namespace Volian.Controls.Library { this.gpMode = new DevComponents.DotNetBar.Controls.GroupPanel(); this.gpItem = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.btnApplicabilitychg2 = new DevComponents.DotNetBar.ButtonItem(); + this.gpSubItem = new DevComponents.DotNetBar.Controls.GroupPanel(); + //this.btnApplicabilitychg2 = new DevComponents.DotNetBar.ButtonItem(); this.btnApplicabilitychg = new DevComponents.DotNetBar.ButtonX(); this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); this.gpItem.SuspendLayout(); @@ -42,11 +44,11 @@ namespace Volian.Controls.Library // // btnApplicabilitychg // - this.btnApplicabilitychg.Location = new System.Drawing.Point(60, 8); + this.btnApplicabilitychg.Location = new System.Drawing.Point(90, 8); this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(4); this.btnApplicabilitychg.BackColor = System.Drawing.SystemColors.Control; this.btnApplicabilitychg.Name = "btnApplicabilitychg"; - this.btnApplicabilitychg.Size = new System.Drawing.Size(80, 22); + this.btnApplicabilitychg.Size = new System.Drawing.Size(85, 22); this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(2); this.btnApplicabilitychg.RightToLeft = System.Windows.Forms.RightToLeft.No; this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all steps at that level of the current step will be set to the selected applicability. Note that this button is disabled when on a RNO step type but enabled for sub-step under it.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); @@ -112,7 +114,8 @@ namespace Volian.Controls.Library this.gpItem.Location = new System.Drawing.Point(0, 49); this.gpItem.Margin = new System.Windows.Forms.Padding(4); this.gpItem.Name = "gpItem"; - this.gpItem.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37); + //this.gpItem.Padding = new System.Windows.Forms.Padding(13, 20, 13, 37); + this.gpItem.Padding = new System.Windows.Forms.Padding(0, 20, 0, 0); this.gpItem.Size = new System.Drawing.Size(432, 85); // // @@ -144,6 +147,31 @@ namespace Volian.Controls.Library this.gpItem.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.gpItem.TabIndex = 1; this.gpItem.Text = "Item Mode"; + // + // gpSubItem + // + gpSubItem.AutoSize = true; + gpSubItem.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + gpSubItem.CanvasColor = System.Drawing.SystemColors.Control; + gpSubItem.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; + gpSubItem.DisabledBackColor = System.Drawing.Color.Empty; + gpSubItem.Dock = System.Windows.Forms.DockStyle.Top; + gpSubItem.Location = new System.Drawing.Point(0, 49); + gpSubItem.Margin = new System.Windows.Forms.Padding(4); + gpSubItem.Name = "gpSubItem"; + gpSubItem.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37); + gpSubItem.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + gpSubItem.Style.BackColorGradientAngle = 90; + gpSubItem.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + gpSubItem.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; + gpSubItem.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + gpSubItem.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; + gpSubItem.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + gpSubItem.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + gpSubItem.TabIndex = 1; + gpSubItem.Text = ""; + gpSubItem.Location = new System.Drawing.Point(0, 49); + gpSubItem.Size = new System.Drawing.Size(400, 250); // // DisplayApplicability // @@ -169,7 +197,8 @@ namespace Volian.Controls.Library private DevComponents.DotNetBar.Controls.GroupPanel gpMode; private DevComponents.DotNetBar.Controls.GroupPanel gpItem; - private DevComponents.DotNetBar.ButtonItem btnApplicabilitychg2; + private DevComponents.DotNetBar.Controls.GroupPanel gpSubItem; + //private DevComponents.DotNetBar.ButtonItem btnApplicabilitychg2; private DevComponents.DotNetBar.ButtonX btnApplicabilitychg; private DevComponents.DotNetBar.SuperTooltip superTooltip1; diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.cs index 271f1f98..97dc1c00 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.cs @@ -31,6 +31,7 @@ namespace Volian.Controls.Library _MyDisplayTabItem = value; gpMode.Controls.Clear(); gpItem.Controls.Clear(); + gpSubItem.Controls.Clear(); MyCheckBoxes.Clear(); if (_MyDisplayTabItem != null) { @@ -59,6 +60,8 @@ namespace Volian.Controls.Library foreach (string name in names) AddItemMode(name.Trim(), (++i).ToString()); AddItemMode("None", "0"); + gpItem.Controls.Add(gpSubItem); + gpSubItem.BringToFront(); gpItem.Controls.Add(btnApplicabilitychg); btnApplicabilitychg.BringToFront(); if (_MyDisplayTabItem.MyStepTabPanel != null) @@ -131,11 +134,17 @@ namespace Volian.Controls.Library private void AddItemMode(string name, string value) { CheckBox cb = new CheckBox(); + //cb.BackColor = Color.Beige; cb.BackColor = Color.Transparent; + cb.Height = 24; + cb.Width = 75; + cb.AutoSize = true; cb.Text = name; cb.Tag = value; cb.Dock = DockStyle.Top; - gpItem.Controls.Add(cb); + //cb.Dock = DockStyle.Left; + //gpItem.Controls.Add(cb); + gpSubItem.Controls.Add(cb); cb.BringToFront(); cb.CheckedChanged += new EventHandler(cb_CheckedChanged); MyCheckBoxes.Add(value == null ? -1 : int.Parse(value), cb); @@ -401,7 +410,7 @@ namespace Volian.Controls.Library else { btnApplicabilitychg.Enabled = true; - } + } IItemConfig cfg = _MyItemInfo.MyConfig as IItemConfig; List apples = cfg.MasterSlave_Applicability.GetFlags(); UnwireCheckboxes(true); From ec5229101f50f44adbb36879462eea29fc7f5ce3 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Mon, 4 May 2026 17:00:42 -0400 Subject: [PATCH 13/25] B2026-043-Fix-Error-for-Set_At_AAll_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function --- PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs index 25f3c2de..b88fceca 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs @@ -48,7 +48,7 @@ namespace Volian.Controls.Library this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(4); this.btnApplicabilitychg.BackColor = System.Drawing.SystemColors.Control; this.btnApplicabilitychg.Name = "btnApplicabilitychg"; - this.btnApplicabilitychg.Size = new System.Drawing.Size(85, 22); + this.btnApplicabilitychg.Size = new System.Drawing.Size(87, 22); this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(2); this.btnApplicabilitychg.RightToLeft = System.Windows.Forms.RightToLeft.No; this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all steps at that level of the current step will be set to the selected applicability. Note that this button is disabled when on a RNO step type but enabled for sub-step under it.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); From 7baa9628d61966f02f613a0e4645f802ae38af8d Mon Sep 17 00:00:00 2001 From: mschill Date: Tue, 5 May 2026 06:00:43 -0400 Subject: [PATCH 14/25] C2026-015 Set overall Changebar date when approving multi-unit --- .../dlgApproveProcedure.cs | 19 +++++++++++++++---- .../VEPROMS.CSLA.Library/Extension/ItemExt.cs | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs index b808b138..60266e0e 100644 --- a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs +++ b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs @@ -1479,9 +1479,6 @@ namespace VEPROMS ProcedureConfig pc = procedureInfo.MyConfig as ProcedureConfig; if (pc == null) return; - //C2026-015 set overall change bar date - pc.Print_ChangeBarDate = dts.ToString("MM/dd/yyyy HH:mm:ss"); - pc.SelectedSlave = selectedSlave; pc.Print_Rev = revNumber; //AppRevDate Change @@ -1493,8 +1490,22 @@ namespace VEPROMS //itm.DTS = dts; itm.UserID = Volian.Base.Library.VlnSettings.UserID; itm.Save(); - } + //C2026-015 set overall change bar date + if (selectedSlave > 0) + { + pc.SelectedSlave = 0; + pc.Print_Rev = revNumber; + pc.Print_RevDate = revDate.ToString("MM/dd/yyyy"); + pc.Print_ChangeBarDate = dts.ToString("MM/dd/yyyy HH:mm:ss"); //this is needed to set the changebar date for an indeividual unit also + using (Item itm2 = Item.Get(procedureInfo.ItemID)) + { + itm2.MyContent.Config = pc.ToString(); + itm2.UserID = Volian.Base.Library.VlnSettings.UserID; + itm2.Save(); + } + } + } } } public class RevType diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 5150df19..a8656812 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -4054,7 +4054,7 @@ namespace VEPROMS.CSLA.Library // date). Print_ViewableAfterChangeBarDate was created to get only that user specified date, if it exists. If it does exist, we compare // that with the Content datetime, otherwise we proceed as before. DateTime? viewableStartingDateTime = (MyProcedure.MyConfig as ProcedureConfig).Print_ViewableStartingChangeBarDate; - if (viewableStartingDateTime != null && viewableStartingDateTime > MyProcedure.ChangeBarDate) + if (viewableStartingDateTime != null && viewableStartingDateTime > MyProcedure.ChangeBarDate && (MyProcedure.MyConfig as ProcedureConfig).SelectedSlave == 0) return (MyContent.DTS > viewableStartingDateTime); return (MyContent.DTS > MyProcedure.ChangeBarDate); } From d0fe36f86e80622038b127236e0e3008cfaf7515 Mon Sep 17 00:00:00 2001 From: mschill Date: Tue, 5 May 2026 08:50:39 -0400 Subject: [PATCH 15/25] C2026-014 Set Changebar date with multi-unit --- .../dlgSetChangeBarStartDate.cs | 37 +++++++++++++++---- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/PROMS/VEPROMS User Interface/dlgSetChangeBarStartDate.cs b/PROMS/VEPROMS User Interface/dlgSetChangeBarStartDate.cs index a9ba9321..1ccd47a5 100644 --- a/PROMS/VEPROMS User Interface/dlgSetChangeBarStartDate.cs +++ b/PROMS/VEPROMS User Interface/dlgSetChangeBarStartDate.cs @@ -68,8 +68,26 @@ namespace VEPROMS MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");// ("MM/dd/yyyy HH:mm:ss"); //CSM - C2026-010 - Add Audit Record for Change Bar Audit History - ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({ dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({ VlnSettings.UserID}) on ({DateTime.Now})", DateTime.Now, VlnSettings.UserID, 0); + ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({VlnSettings.UserID}) on ({DateTime.Now})", DateTime.Now, VlnSettings.UserID, 0); + //CSM C2026-014 if multi-unit, set for each unit + System.Data.DataTable dt = RevisionData.GetRevisionDataByUnit(MyProcInfo.ItemID); + if (RevisionData.HasUnits(dt)) + { + //Change the ChangeBarDate for each unit + foreach (DataRow r in dt.Rows) + { + if (!r.IsNull("UnitID")) + { + MyProcConfig.SelectedSlave = Convert.ToInt32(r["UnitID"]); + MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss"); + + //CSM - C2026-010 - Add Audit Record for Change Bar Audit History + ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({VlnSettings.UserID}) on ({DateTime.Now}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave); + } + } + MyProcConfig.SelectedSlave = 0; + } } @@ -108,7 +126,10 @@ namespace VEPROMS sb.Append($" The Procedure Viewer Change Bar Date will be set to ({maxDTS})."); foreach (DataRow r in dt.Rows) { - sb.Append($"\r\n The Change Bar Date for Unit ({r["UnitName"]}) will be set to ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss})."); + if (!r.IsNull("UnitID")) + { + sb.Append($"\r\n The Change Bar Date for Unit ({r["UnitName"]}) will be set to ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss})."); + } } sb.Append("\r\n Any Change Bars for Units not listed above will use the Overall/Procedure Viewer Change Bar Date (as these Units have no approvals)."); @@ -121,12 +142,14 @@ namespace VEPROMS //Change the ChangeBarDate for each unit foreach (DataRow r in dt.Rows) { - MyProcConfig.SelectedSlave = Convert.ToInt32(r["UnitID"]); - MyProcConfig.Print_ChangeBarDate = Convert.ToDateTime(r["DTS"]).ToString("MM / dd / yyyy HH: mm: ss"); - - //CSM - C2026-010 - Add Audit Record for Change Bar Audit History - ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show since last approval ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave); + if (!r.IsNull("UnitID")) + { + MyProcConfig.SelectedSlave = Convert.ToInt32(r["UnitID"]); + MyProcConfig.Print_ChangeBarDate = Convert.ToDateTime(r["DTS"]).ToString("MM / dd / yyyy HH: mm: ss"); + //CSM - C2026-010 - Add Audit Record for Change Bar Audit History + ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show since last approval ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave); + } } MyProcConfig.SelectedSlave = 0; DialogResult = DialogResult.OK; From 2a0849fae5939628a8c6078e66ee11e472484b3a Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Tue, 5 May 2026 22:08:27 -0400 Subject: [PATCH 16/25] B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function --- .../DisplayApplicability.Designer.cs | 35 +----------------- .../DisplayApplicability.cs | 37 +++++++++++++++++-- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs index b88fceca..9d682f94 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs @@ -1,4 +1,4 @@ -using System.Drawing; +//using System.Drawing; using System.Security.Cryptography; using VEPROMS.CSLA.Library; @@ -35,8 +35,6 @@ namespace Volian.Controls.Library { this.gpMode = new DevComponents.DotNetBar.Controls.GroupPanel(); this.gpItem = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.gpSubItem = new DevComponents.DotNetBar.Controls.GroupPanel(); - //this.btnApplicabilitychg2 = new DevComponents.DotNetBar.ButtonItem(); this.btnApplicabilitychg = new DevComponents.DotNetBar.ButtonX(); this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); this.gpItem.SuspendLayout(); @@ -51,7 +49,7 @@ namespace Volian.Controls.Library this.btnApplicabilitychg.Size = new System.Drawing.Size(87, 22); this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(2); this.btnApplicabilitychg.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all steps at that level of the current step will be set to the selected applicability. Note that this button is disabled when on a RNO step type but enabled for sub-step under it.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Set All at Level", "", "When clicked, all steps at that level of the current step will be set to the selected applicability. Note that the Set All at Level button is disabled for RNO step types unless they are substeps off of a RNO step.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); this.btnApplicabilitychg.TabIndex = 0; this.btnApplicabilitychg.Text = "Set All at Level"; this.btnApplicabilitychg.ColorTable = DevComponents.DotNetBar.eButtonColor.BlueOrb; @@ -71,9 +69,6 @@ namespace Volian.Controls.Library this.gpMode.Name = "gpMode"; this.gpMode.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37); this.gpMode.Size = new System.Drawing.Size(432, 49); - // - // - // this.gpMode.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; this.gpMode.Style.BackColorGradientAngle = 90; this.gpMode.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; @@ -147,31 +142,6 @@ namespace Volian.Controls.Library this.gpItem.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.gpItem.TabIndex = 1; this.gpItem.Text = "Item Mode"; - // - // gpSubItem - // - gpSubItem.AutoSize = true; - gpSubItem.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - gpSubItem.CanvasColor = System.Drawing.SystemColors.Control; - gpSubItem.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - gpSubItem.DisabledBackColor = System.Drawing.Color.Empty; - gpSubItem.Dock = System.Windows.Forms.DockStyle.Top; - gpSubItem.Location = new System.Drawing.Point(0, 49); - gpSubItem.Margin = new System.Windows.Forms.Padding(4); - gpSubItem.Name = "gpSubItem"; - gpSubItem.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37); - gpSubItem.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - gpSubItem.Style.BackColorGradientAngle = 90; - gpSubItem.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - gpSubItem.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - gpSubItem.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - gpSubItem.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - gpSubItem.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - gpSubItem.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - gpSubItem.TabIndex = 1; - gpSubItem.Text = ""; - gpSubItem.Location = new System.Drawing.Point(0, 49); - gpSubItem.Size = new System.Drawing.Size(400, 250); // // DisplayApplicability // @@ -197,7 +167,6 @@ namespace Volian.Controls.Library private DevComponents.DotNetBar.Controls.GroupPanel gpMode; private DevComponents.DotNetBar.Controls.GroupPanel gpItem; - private DevComponents.DotNetBar.Controls.GroupPanel gpSubItem; //private DevComponents.DotNetBar.ButtonItem btnApplicabilitychg2; private DevComponents.DotNetBar.ButtonX btnApplicabilitychg; private DevComponents.DotNetBar.SuperTooltip superTooltip1; diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.cs index 97dc1c00..9cebebe4 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.cs @@ -21,6 +21,7 @@ namespace Volian.Controls.Library if (ApplicabilityViewModeChanged != null) ApplicabilityViewModeChanged(this, new EventArgs()); } + private DisplayTabItem _MyDisplayTabItem = null; public DisplayTabItem MyDisplayTabItem { @@ -88,6 +89,38 @@ namespace Volian.Controls.Library return 0; } } + private void InitializegpSubItem() //B2026-043 Fix "Set All At Level" button. + { + this.gpSubItem = new DevComponents.DotNetBar.Controls.GroupPanel(); + // + // gpSubItem + // + gpSubItem.AutoSize = true; + gpSubItem.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + gpSubItem.CanvasColor = System.Drawing.SystemColors.Control; + gpSubItem.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; + gpSubItem.DisabledBackColor = System.Drawing.Color.Empty; + gpSubItem.Dock = System.Windows.Forms.DockStyle.Top; + gpSubItem.Location = new System.Drawing.Point(0, 49); + gpSubItem.Margin = new System.Windows.Forms.Padding(4); + gpSubItem.Name = "gpSubItem"; + gpSubItem.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37); + gpSubItem.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; + gpSubItem.Style.BackColorGradientAngle = 90; + gpSubItem.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + gpSubItem.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; + gpSubItem.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; + gpSubItem.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; + gpSubItem.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + gpSubItem.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; + gpSubItem.TabIndex = 1; + gpSubItem.Text = ""; + gpSubItem.Location = new System.Drawing.Point(0, 49); + gpSubItem.Size = new System.Drawing.Size(400, 250); + // + + } + private DevComponents.DotNetBar.Controls.GroupPanel gpSubItem; private Dictionary MyCheckBoxes = new Dictionary(); private string _MyApplicability = string.Empty; public string MyApplicability @@ -134,7 +167,6 @@ namespace Volian.Controls.Library private void AddItemMode(string name, string value) { CheckBox cb = new CheckBox(); - //cb.BackColor = Color.Beige; cb.BackColor = Color.Transparent; cb.Height = 24; cb.Width = 75; @@ -142,8 +174,6 @@ namespace Volian.Controls.Library cb.Text = name; cb.Tag = value; cb.Dock = DockStyle.Top; - //cb.Dock = DockStyle.Left; - //gpItem.Controls.Add(cb); gpSubItem.Controls.Add(cb); cb.BringToFront(); cb.CheckedChanged += new EventHandler(cb_CheckedChanged); @@ -507,6 +537,7 @@ namespace Volian.Controls.Library public DisplayApplicability() { InitializeComponent(); + InitializegpSubItem(); //B2026-043 Fix "Set All At Level" button. this.VisibleChanged += new EventHandler(DisplayApplicability_VisibleChanged); } From 3924e2fca5cafb56eab32c617116ac409be4ea4d Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Wed, 6 May 2026 07:54:39 -0400 Subject: [PATCH 17/25] B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function --- PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs index 9d682f94..fbe58344 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs @@ -109,7 +109,6 @@ namespace Volian.Controls.Library this.gpItem.Location = new System.Drawing.Point(0, 49); this.gpItem.Margin = new System.Windows.Forms.Padding(4); this.gpItem.Name = "gpItem"; - //this.gpItem.Padding = new System.Windows.Forms.Padding(13, 20, 13, 37); this.gpItem.Padding = new System.Windows.Forms.Padding(0, 20, 0, 0); this.gpItem.Size = new System.Drawing.Size(432, 85); // @@ -167,7 +166,6 @@ namespace Volian.Controls.Library private DevComponents.DotNetBar.Controls.GroupPanel gpMode; private DevComponents.DotNetBar.Controls.GroupPanel gpItem; - //private DevComponents.DotNetBar.ButtonItem btnApplicabilitychg2; private DevComponents.DotNetBar.ButtonX btnApplicabilitychg; private DevComponents.DotNetBar.SuperTooltip superTooltip1; From 7bbf62d7358814b7a073f1e33bbfd6a10ae5fbd2 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Thu, 7 May 2026 11:27:36 -0400 Subject: [PATCH 18/25] B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function --- .../DisplayApplicability.Designer.cs | 12 +--- .../DisplayApplicability.cs | 68 +++++++++++-------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs index fbe58344..cf30191f 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs @@ -1,4 +1,4 @@ -//using System.Drawing; +using System.Drawing; using System.Security.Cryptography; using VEPROMS.CSLA.Library; @@ -24,7 +24,6 @@ namespace Volian.Controls.Library base.Dispose(disposing); } - #region Component Designer generated code /// @@ -49,7 +48,7 @@ namespace Volian.Controls.Library this.btnApplicabilitychg.Size = new System.Drawing.Size(87, 22); this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(2); this.btnApplicabilitychg.RightToLeft = System.Windows.Forms.RightToLeft.No; - this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Set All at Level", "", "When clicked, all steps at that level of the current step will be set to the selected applicability. Note that the Set All at Level button is disabled for RNO step types unless they are substeps off of a RNO step.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); + this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Set All at Level", "", "When clicked, all steps at that level of the current step will be set to the selected applicability. Note that the Set All at Level button is disabled for RNO step types unless they are substeps off of a RNO step.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); // C2026-034 fix tool tip text. this.btnApplicabilitychg.TabIndex = 0; this.btnApplicabilitychg.Text = "Set All at Level"; this.btnApplicabilitychg.ColorTable = DevComponents.DotNetBar.eButtonColor.BlueOrb; @@ -86,13 +85,7 @@ namespace Volian.Controls.Library this.gpMode.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.gpMode.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.gpMode.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // this.gpMode.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // this.gpMode.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.gpMode.TabIndex = 0; this.gpMode.Text = "Viewing Mode"; @@ -103,7 +96,6 @@ namespace Volian.Controls.Library this.gpItem.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; this.gpItem.CanvasColor = System.Drawing.SystemColors.Control; this.gpItem.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - //this.gpItem.Controls.Add(this.btnApplicabilitychg); this.gpItem.DisabledBackColor = System.Drawing.Color.Empty; this.gpItem.Dock = System.Windows.Forms.DockStyle.Top; this.gpItem.Location = new System.Drawing.Point(0, 49); diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.cs index 9cebebe4..96cdaf98 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.cs @@ -28,15 +28,18 @@ namespace Volian.Controls.Library get { return _MyDisplayTabItem; } set { - if (DesignMode) return; // B2019-043 need to check if we are just saving changes to the user interface + if (DesignMode) return; // B2019-043 need to check if we are just saving changes to the user interface _MyDisplayTabItem = value; gpMode.Controls.Clear(); gpItem.Controls.Clear(); - gpSubItem.Controls.Clear(); MyCheckBoxes.Clear(); if (_MyDisplayTabItem != null) { - DocVersionConfig dcfg = _MyDisplayTabItem.MyItemInfo.MyDocVersion.MyConfig as DocVersionConfig; + //B2026-043 Fix "Set All At Level" button. + DevComponents.DotNetBar.Controls.GroupPanel gpSubItem = InitializegpSubItem(); + gpSubItem.Controls.Clear(); + + DocVersionConfig dcfg = _MyDisplayTabItem.MyItemInfo.MyDocVersion.MyConfig as DocVersionConfig; List names = new List(); for (int n = 1; n <= dcfg.Unit_Count; n++) { @@ -56,11 +59,11 @@ namespace Volian.Controls.Library AddViewMode(name.Trim(), i.ToString(), apple == i); } - AddItemMode("All", "-1"); + AddItemMode("All", "-1", ref gpSubItem); i = 0; foreach (string name in names) - AddItemMode(name.Trim(), (++i).ToString()); - AddItemMode("None", "0"); + AddItemMode(name.Trim(), (++i).ToString(), ref gpSubItem); + AddItemMode("None", "0", ref gpSubItem); gpItem.Controls.Add(gpSubItem); gpSubItem.BringToFront(); gpItem.Controls.Add(btnApplicabilitychg); @@ -89,25 +92,26 @@ namespace Volian.Controls.Library return 0; } } - private void InitializegpSubItem() //B2026-043 Fix "Set All At Level" button. + private DevComponents.DotNetBar.Controls.GroupPanel InitializegpSubItem() //B2026-043 Fix "Set All At Level" button. { - this.gpSubItem = new DevComponents.DotNetBar.Controls.GroupPanel(); - // - // gpSubItem - // - gpSubItem.AutoSize = true; - gpSubItem.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - gpSubItem.CanvasColor = System.Drawing.SystemColors.Control; - gpSubItem.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - gpSubItem.DisabledBackColor = System.Drawing.Color.Empty; - gpSubItem.Dock = System.Windows.Forms.DockStyle.Top; - gpSubItem.Location = new System.Drawing.Point(0, 49); - gpSubItem.Margin = new System.Windows.Forms.Padding(4); - gpSubItem.Name = "gpSubItem"; - gpSubItem.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37); - gpSubItem.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - gpSubItem.Style.BackColorGradientAngle = 90; - gpSubItem.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; + DevComponents.DotNetBar.Controls.GroupPanel gpSubItem; + gpSubItem = new DevComponents.DotNetBar.Controls.GroupPanel + { + // + // gpSubItem + // + AutoSize = true, + AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink, + CanvasColor = System.Drawing.SystemColors.Control, + ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007, + DisabledBackColor = System.Drawing.Color.Empty, + Dock = System.Windows.Forms.DockStyle.Top, + Location = new System.Drawing.Point(0, 49), + Margin = new System.Windows.Forms.Padding(4), + Name = "gpSubItem", + Padding = new System.Windows.Forms.Padding(13, 12, 13, 37) + }; + gpSubItem.BackColor = Color.Transparent; gpSubItem.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; gpSubItem.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; gpSubItem.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; @@ -117,10 +121,8 @@ namespace Volian.Controls.Library gpSubItem.Text = ""; gpSubItem.Location = new System.Drawing.Point(0, 49); gpSubItem.Size = new System.Drawing.Size(400, 250); - // - + return gpSubItem; } - private DevComponents.DotNetBar.Controls.GroupPanel gpSubItem; private Dictionary MyCheckBoxes = new Dictionary(); private string _MyApplicability = string.Empty; public string MyApplicability @@ -164,7 +166,7 @@ namespace Volian.Controls.Library // } //} //} - private void AddItemMode(string name, string value) + private void AddItemMode(string name, string value, ref DevComponents.DotNetBar.Controls.GroupPanel gpSubItem) { CheckBox cb = new CheckBox(); cb.BackColor = Color.Transparent; @@ -181,6 +183,8 @@ namespace Volian.Controls.Library } private void cb_CheckedChanged(object sender, EventArgs e) { + EditItem ei = MyDisplayTabItem.MyStepTabPanel.SelectedEditItem; + ei.SaveCurrentAndContents(); // C2026-035 save unsaved step text. UnwireCheckboxes(false); CheckBox cb = sender as CheckBox; CheckState cs = cb.CheckState; @@ -326,8 +330,12 @@ namespace Volian.Controls.Library MasterSlave_ApplicabilityTmp = sc.MasterSlave_Applicability; StringBuilder sb = new StringBuilder(); + EditItem ei = MyDisplayTabItem.MyStepTabPanel.SelectedEditItem; + ei.SaveCurrentAndContents(); // C2026-035 save unsaved step text. - ItemInfo startitm = MyItemInfo.FirstSibling; + + + ItemInfo startitm = MyItemInfo.FirstSibling; while (startitm != null) { @@ -537,7 +545,7 @@ namespace Volian.Controls.Library public DisplayApplicability() { InitializeComponent(); - InitializegpSubItem(); //B2026-043 Fix "Set All At Level" button. + //InitializegpSubItem(); //B2026-043 Fix "Set All At Level" button. this.VisibleChanged += new EventHandler(DisplayApplicability_VisibleChanged); } From 194ca84d38c17eff9475440243ad8c05afa3214b Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Thu, 7 May 2026 11:34:16 -0400 Subject: [PATCH 19/25] B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function --- PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs index cf30191f..debee89f 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs @@ -1,4 +1,3 @@ -using System.Drawing; using System.Security.Cryptography; using VEPROMS.CSLA.Library; From 401fa128514726d0b3243e56a598120783dd83a2 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Thu, 7 May 2026 13:29:55 -0400 Subject: [PATCH 20/25] B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function --- .../DisplayApplicability.Designer.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs index debee89f..e51b1e5b 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.Designer.cs @@ -67,6 +67,9 @@ namespace Volian.Controls.Library this.gpMode.Name = "gpMode"; this.gpMode.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37); this.gpMode.Size = new System.Drawing.Size(432, 49); + // + // + // this.gpMode.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; this.gpMode.Style.BackColorGradientAngle = 90; this.gpMode.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; @@ -84,7 +87,13 @@ namespace Volian.Controls.Library this.gpMode.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; this.gpMode.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; this.gpMode.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; + // + // + // this.gpMode.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; + // + // + // this.gpMode.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; this.gpMode.TabIndex = 0; this.gpMode.Text = "Viewing Mode"; From d07e132216cd0af858d6903be6659ba074172d2a Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Thu, 7 May 2026 14:55:44 -0400 Subject: [PATCH 21/25] B2026-043-Fix-Error-for-Set_At_All_Level-in-the-Applicability-tab-evaluate-having-the-button-grayed-out-for-the-RNO-column-when-clicked-executes-function --- PROMS/Volian.Controls.Library/DisplayApplicability.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PROMS/Volian.Controls.Library/DisplayApplicability.cs b/PROMS/Volian.Controls.Library/DisplayApplicability.cs index 96cdaf98..1f4a388c 100644 --- a/PROMS/Volian.Controls.Library/DisplayApplicability.cs +++ b/PROMS/Volian.Controls.Library/DisplayApplicability.cs @@ -37,7 +37,6 @@ namespace Volian.Controls.Library { //B2026-043 Fix "Set All At Level" button. DevComponents.DotNetBar.Controls.GroupPanel gpSubItem = InitializegpSubItem(); - gpSubItem.Controls.Clear(); DocVersionConfig dcfg = _MyDisplayTabItem.MyItemInfo.MyDocVersion.MyConfig as DocVersionConfig; List names = new List(); @@ -544,8 +543,7 @@ namespace Volian.Controls.Library public DisplayApplicability() { - InitializeComponent(); - //InitializegpSubItem(); //B2026-043 Fix "Set All At Level" button. + InitializeComponent(); //B2026-043 Fix "Set All At Level" button. this.VisibleChanged += new EventHandler(DisplayApplicability_VisibleChanged); } From 23173074aa818b33a27d72bbd1bfe51fe3f1e028 Mon Sep 17 00:00:00 2001 From: John Jenko Date: Thu, 7 May 2026 15:21:48 -0400 Subject: [PATCH 22/25] F2026_013 Fixed typo in Vogtle format title --- PROMS/Formats/fmtall/VEGP1all.xml | Bin 186088 -> 186088 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/PROMS/Formats/fmtall/VEGP1all.xml b/PROMS/Formats/fmtall/VEGP1all.xml index 09565922260b6aadb7c8ff92536d65e897168d71..3904e24a029dc212629f7c4df5fde20d46cbeb44 100644 GIT binary patch delta 27 jcmaE{mixt8?hSE_)AK$vay4f#wr4OhZqHz3YPbpjrN;`V delta 26 icmaE{mixt8?hSE_%q0xz&54ZdiHwZf6B(J>uL1y!EeUi0 From 4b5b06210c247bec9b3aecd8da344ba1eefa4948 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Fri, 8 May 2026 23:20:38 -0400 Subject: [PATCH 23/25] B2026-046-RO-symbols-and-Annotations --- .../Volian.Controls.Library/AnnotationDetails.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/PROMS/Volian.Controls.Library/AnnotationDetails.cs b/PROMS/Volian.Controls.Library/AnnotationDetails.cs index 27577b01..d1bc6dbc 100644 --- a/PROMS/Volian.Controls.Library/AnnotationDetails.cs +++ b/PROMS/Volian.Controls.Library/AnnotationDetails.cs @@ -1,16 +1,17 @@ +using JR.Utils.GUI.Forms; using System; using System.Collections.Generic; using System.ComponentModel; -using System.Drawing; using System.Data; +using System.Diagnostics; +using System.Drawing; using System.Text; +using System.Text.RegularExpressions; using System.Windows.Forms; +using System.Xml; using VEPROMS.CSLA.Library; using Volian.Base.Library; using Volian.Pipe.Library; -using System.Xml; -using System.Diagnostics; -using JR.Utils.GUI.Forms; namespace Volian.Controls.Library { @@ -220,7 +221,11 @@ namespace Volian.Controls.Library { if (!DesignMode) // B2019-043 need to check if we are just saving changes to the user interface { - rtxbComment.Text = value; + //rtxbComment.Text = value; + if (value != null) + { + rtxbComment.Text = Regex.Replace(value, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); + } if (rtxbComment.Text != string.Empty) rtxbComment.SelectionStart = rtxbComment.TextLength; // position cursor to end of text } From 70782cd655b70f9ef09108ea553f2f919cb27fca Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Wed, 13 May 2026 13:37:12 -0400 Subject: [PATCH 24/25] B2026-046-RO-symbols-and-Annotations --- PROMS/Volian.Controls.Library/AnnotationDetails.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/PROMS/Volian.Controls.Library/AnnotationDetails.cs b/PROMS/Volian.Controls.Library/AnnotationDetails.cs index d1bc6dbc..45cbeb1d 100644 --- a/PROMS/Volian.Controls.Library/AnnotationDetails.cs +++ b/PROMS/Volian.Controls.Library/AnnotationDetails.cs @@ -221,7 +221,6 @@ namespace Volian.Controls.Library { if (!DesignMode) // B2019-043 need to check if we are just saving changes to the user interface { - //rtxbComment.Text = value; if (value != null) { rtxbComment.Text = Regex.Replace(value, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); From f4168b5202797767b8d9f94fc1ce287461226a71 Mon Sep 17 00:00:00 2001 From: mschill Date: Wed, 13 May 2026 15:02:52 -0400 Subject: [PATCH 25/25] B2026-045 Issue with Refreshing Changebars when Approval is done multiple times in a row on Multi-unit. Printing was ok but the UI required leaving PROMS and going back in. --- .../dlgApproveProcedure.cs | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs index 60266e0e..6062ac78 100644 --- a/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs +++ b/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs @@ -1343,31 +1343,23 @@ namespace VEPROMS //// so change bars update //// on any open StepPanel - //B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open - DisplayTabItem dti = MyFrmVEPROMS.GetTabContainingProcedure(pi.ItemID); + newproc = ItemInfo.ResetProcedure(pi.ItemID); + + //B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open + DisplayTabItem dti = MyFrmVEPROMS.GetTabContainingProcedure(pi.ItemID); if (dti != null) { if (!dti.MyStepTabPanel.MyStepPanel.ContainsFocus) dti.MyStepTabPanel.MyStepPanel.Focus(); - foreach (EditItem eitm in dti.MyStepTabPanel.MyStepPanel.Controls.OfType()) - { - eitm.ChangeBar = eitm.MyItemInfo.HasChangeBar; - } + dti.MyStepTabPanel.MyStepTabRibbon.RefreshProcedure(); + Application.DoEvents(); - dti.MyStepTabPanel.MyStepTabRibbon.RefreshProcedure(); - Application.DoEvents(); - newproc = ProcedureInfo.Get(pi.ItemID); + } - } - else - { - newproc = ItemInfo.ResetProcedure(pi.ItemID); - } - - //since in a separate form, need to update the tree view - //so "Showing Change Bars" Content Menu Item is correct - MyFrmVEPROMS.RefreshProcedureNode(newproc); + //since in a separate form, need to update the tree view + //so "Showing Change Bars" Content Menu Item is correct + MyFrmVEPROMS.RefreshProcedureNode(newproc); } else UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, myDTS, selectedSlave);