Compare commits

...

19 Commits

Author SHA1 Message Date
mschill 45e78ef184 Merge branch 'Development' into C2026-008 2026-04-28 13:43:35 -04:00
jjenko fe7c5893bb Merge pull request 'B2026-040 - Signoff/Checkoffs not printing unless set to Section Default' (#758) from B2026-040 into Development
good for testing
2026-04-28 11:11:45 -04:00
mschill 2b57c552d1 B2026-040 - Signoff/Checkoffs not printing unless set to Section Default 2026-04-28 11:03:04 -04:00
mschill 7f0d39b684 C2026-008 - Re-Architect RO.FST to include RO Modification date/time and use those when updating ROs from the RO.FST 2026-04-28 09:13:17 -04:00
jjenko a544a5cd4f Merge pull request 'B2026-037 - Remove Fix Symbol Font' (#755) from B2026-037 into Development
good for testing phase
2026-04-16 14:02:42 -04:00
mschill ff9ade75d4 B2026-037 - Remove Fix Symbol Font 2026-04-16 09:32:02 -04:00
mschill cfd5498521 Merge pull request 'C2026-033 Added logic to not display the Empty Procedure message box if we are printing via baseline print testing.' (#754) from C2026-033_Baseline_Printing into Development
Looks Good. Ready for QA.
2026-04-15 11:55:19 -04:00
jjenko 9b7c30e1cd C2026-033 Added logic to not display the Empty Procedure message box if we are printing via baseline print testing. 2026-04-15 11:28:21 -04:00
mschill 670e5d7fa9 Merge pull request 'Baseline Application fixes' (#753) from baseline into Development
Looks good. Ready for QA.
2026-04-13 11:13:50 -04:00
jjenko 8258235611 Baseline Application fixes 2026-04-13 11:06:50 -04:00
jjenko 4d97f29943 Merge pull request 'B2026-035_fix_RO_Preview_for_X_Y_Plots' (#751) from B2026-035_fix_RO_Preview_for_X_Y_Plots into Development
good for testing
2026-03-31 08:53:49 -04:00
plarsen ab8d59eb2d Merge branch 'Development' into B2026-035_fix_RO_Preview_for_X_Y_Plots 2026-03-31 08:48:01 -04:00
plarsen c324fa69b2 B2026-035_fix_RO_Preview_for_X_Y_Plots 2026-03-31 08:47:43 -04:00
plarsen 1cdb9b4cc2 Development 2026-03-31 08:43:41 -04:00
plarsen f47fa49b80 B2026-035_fix_RO_Preview_for_X_Y_Plots 2026-03-30 16:12:37 -04:00
plarsen 6ade96c7ef B2026-035_fix_RO_Preview_for_X_Y_Plots 2026-03-30 13:41:03 -04:00
plarsen 61d31a3c67 Merge branch 'Development' of https://git.volian.com/Volian/SourceCode into Development 2026-03-30 13:05:08 -04:00
mschill 014509ea30 Merge pull request 'B2026-036 Fixed issue where if a RO return value and a dash followed by numbers, the numbers following the dash would be truncated when inserting in step editor text.' (#750) from General_Debugging into Development
Looks Good. Ready for QA.
2026-03-27 15:32:54 -04:00
plarsen b6da13a653 Development 2026-03-26 11:49:54 -04:00
21 changed files with 1537 additions and 1542 deletions
+109 -31
View File
@@ -456,7 +456,7 @@ namespace Baseline
switch (myLast) switch (myLast)
{ {
case LastWas.Pagination: case LastWas.Pagination:
line = OpenPDF(line); OpenPDF(line);
break; break;
case LastWas.Baseline: // TODO: Need to add code here to open matching file case LastWas.Baseline: // TODO: Need to add code here to open matching file
OpenOnePDF(myLine,1); OpenOnePDF(myLine,1);
@@ -479,7 +479,7 @@ namespace Baseline
switch (myLast) switch (myLast)
{ {
case LastWas.Pagination: case LastWas.Pagination:
line = OpenPDF(line); OpenPDF(line);
break; break;
case LastWas.Baseline: // TODO: Need to add code here to open matching file case LastWas.Baseline: // TODO: Need to add code here to open matching file
OpenOnePDF(myLine,2); OpenOnePDF(myLine,2);
@@ -491,34 +491,99 @@ namespace Baseline
break; break;
} }
} }
string exePath;
private string OpenPDF(string line) /// <summary>
/// This will return the full path to the PDF file
/// </summary>
/// <param name="fi"></param>
/// <param name="patern"></param>
/// <returns></returns>
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.
}
/// <summary>
/// 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
/// </summary>
/// <param name="txt"></param>
/// <returns></returns>
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. // 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; FindFile ff = lbDifferent.SelectedItem as FindFile;
FileInfo fi1 = new FileInfo(ff.File1); FileInfo fi1 = new FileInfo(ff.File1);
FileInfo fi2 = new FileInfo(ff.File2); 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 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) if (exePath == null)
{ {
System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + line + ".pdf"); try
{
System.Diagnostics.Process p = System.Diagnostics.Process.Start(PDFfileName1);
exePath = TryToGetPath(p); exePath = TryToGetPath(p);
p.Kill(); // No need to keep it open 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 // 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); System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
// Move the PDF Reader window to 0,0 // Move the PDF Reader window to 0,0
MoveProcess(p1, 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); System.Diagnostics.Process p2 = System.Diagnostics.Process.Start(psi2);
// Move the PDF Reader window to 960,0 // Move the PDF Reader window to 960,0
// TODO: This Offset could be a Setting // TODO: This Offset could be a Setting
MoveProcess(p2, 960, 0); MoveProcess(p2, 960, 0);
return line; return;
} }
/// <summary> /// <summary>
/// Try to get the location of the PDF Reader executable /// Try to get the location of the PDF Reader executable
@@ -594,41 +659,53 @@ namespace Baseline
/// <param name="list"></param> /// <param name="list"></param>
private void OpenOnePDF(Line myLine, int list) 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. // B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
string proc = myLine.MyProc.Number.Replace("/","_").Replace("\\","_"); 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; int pagenum = myLine.MyPage.Number;
FindFile ff = lbDifferent.SelectedItem as FindFile; FindFile ff = lbDifferent.SelectedItem as FindFile;
FileInfo fi1 = new FileInfo(ff.File1); string PDFfileName = null;
FileInfo fi2 = new FileInfo(ff.File2); if (list == 1)
if (exePath == null)
{ {
System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + proc + ".pdf"); FileInfo fi1 = new FileInfo(ff.File1);
while (exePath == null) PDFfileName = GetPFDFileAndPath(fi1, procPatern);
}
else // list == 2
{
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 try
{ {
System.Diagnostics.Process tp = System.Diagnostics.Process.Start(PDFfileName);
exePath = p.MainModule.FileName; exePath = TryToGetPath(tp);
tp.Kill();
} }
catch (Exception ex) catch (Exception ex)
{ {
Application.DoEvents(); Application.DoEvents();
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message); string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
Console.WriteLine(msg);
MessageBox.Show(msg, "Error opening default PDF Viewer");
return;
} }
} }
p.Kill(); // 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));
if (list == 1) psi1.UseShellExecute = false;
{
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); System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
} }
else
{
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);
}
}
/// <summary> /// <summary>
/// Perform Debug Meta file comparison for all of the folders within the automated testing folders /// Perform Debug Meta file comparison for all of the folders within the automated testing folders
/// </summary> /// </summary>
@@ -709,11 +786,12 @@ namespace Baseline
private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e) private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e)
{ {
//Initialize Results List Box //Initialize Results List Box
lbResults1.Items.Clear();
Procedure myProc = lbProcedures.SelectedItem as Procedure; 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 //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); Procedure myProc1 = MyProcs1.Find(x => x.Number == myProc.Number && x.Title == myProc.Title);
// Build the results ListBox for the left window // Build the results ListBox for the left window
lbResults1.Items.Clear();
if (myProc1 != null) if (myProc1 != null)
{ {
foreach (Page myPage in myProc1.MyPages) foreach (Page myPage in myProc1.MyPages)
-252
View File
@@ -422,150 +422,6 @@ namespace LBWordLibrary
return true; return true;
return false; return false;
} }
/// <summary>
/// If document contains symbol characters, returns problem font.
/// </summary>
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<string> alreadyProcessed = new List<string>();
List<string> fontHasSymbols = new List<string>();
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;
}
}
/// <summary>
/// Debug Tool - Return a string containing a list of the fonts that have symbol characters.
/// </summary>
public string FontsHaveSymbolCharacters
{
get
{
string sep = "";
StringBuilder sb = new StringBuilder();
List<string> fonts=new List<string>();
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;
}
}
/// <summary>
/// Debug Tool - Return a list of symbol characters using VESYMB font.
/// </summary>
public string FontsHaveSymbolCharacters2
{
get
{
try
{
Dictionary<string, List<int>> fonts = new Dictionary<string, List<int>>();
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<int>());
}
List<int> 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;
}
}
/// <summary> /// <summary>
/// Checks to see if the document contains symbol characters /// Checks to see if the document contains symbol characters
@@ -601,86 +457,7 @@ namespace LBWordLibrary
} }
} }
Regex _RegFindSymbol = new Regex("[\\uF020-\\uF07F]+"); Regex _RegFindSymbol = new Regex("[\\uF020-\\uF07F]+");
/// <summary>
/// FixSymbolCharacters - Fix any symbol characters in the document
/// </summary>
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;
}
}
/// <summary>
/// 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.
/// </summary>
/// <returns></returns>
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;
}
/// <summary> /// <summary>
/// Get the Range Text with error handling. myRange.Text sometimes will get a null reference exception. /// Get the Range Text with error handling. myRange.Text sometimes will get a null reference exception.
/// </summary> /// </summary>
@@ -737,35 +514,6 @@ namespace LBWordLibrary
return myRange.Start - problem.Index; return myRange.Start - problem.Index;
} }
/// <summary> /// <summary>
/// ReplaceSymbolCharacters Replaces any symbol characters in the specified range
/// </summary>
/// <param name="myRange"></param>
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);
}
}
/// <summary>
/// ReplaceSymbolCharacters processes the string returned and changes any symbols (0xF0??) to normal characters /// ReplaceSymbolCharacters processes the string returned and changes any symbols (0xF0??) to normal characters
/// </summary> /// </summary>
/// <param name="str"></param> /// <param name="str"></param>
@@ -2844,6 +2844,7 @@ namespace ROEditor
} }
else else
{ {
mnutitle = Regex.Replace(mnutitle, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022
newt =null; newt =null;
success = myrodb.RODB_WriteRO((VlnXmlElement)roTreeView.SelectedNode.Tag); success = myrodb.RODB_WriteRO((VlnXmlElement)roTreeView.SelectedNode.Tag);
if (success==true && mnutitle != "") roTreeView.SelectedNode.Text = mnutitle; //B2021-077 make sure mnutitle has text or it will clear the node's title in the tree if (success==true && mnutitle != "") roTreeView.SelectedNode.Text = mnutitle; //B2021-077 make sure mnutitle has text or it will clear the node's title in the tree
@@ -844,6 +844,10 @@ namespace ROEditor
AccPageID = " "; AccPageID = " ";
WriteString(AccPageID); WriteString(AccPageID);
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
string moddt = ROdatabase.RODB_GetModDateTime(elem.GetAttribute("RecID"), elem.GetAttribute("Table"));
if (!string.IsNullOrEmpty(moddt)) WriteString(moddt);
// Save the ID and offset entry for the current ID // Save the ID and offset entry for the current ID
IdsAndOffsets.Add(RORecID, startFST); IdsAndOffsets.Add(RORecID, startFST);
@@ -355,6 +355,7 @@ namespace RODBInterface
public abstract string RODB_GetDBServerForAbout(); public abstract string RODB_GetDBServerForAbout();
public abstract string RODB_HasBeenConverted(); public abstract string RODB_HasBeenConverted();
public abstract bool RODB_WriteSqlConnectToAccess(string newConectStr); public abstract bool RODB_WriteSqlConnectToAccess(string newConectStr);
public abstract string RODB_GetModDateTime(string Recid, string table);
#endregion #endregion
public RODB() public RODB()
@@ -3082,6 +3083,27 @@ namespace RODBInterface
return GrpCnt; return GrpCnt;
} }
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
//Get the Modification Date / Time for the RO
public override string RODB_GetModDateTime(string Recid, string table)
{
using (System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection(strDatabaseConnectionCommand))
{
connection.Open();
using (System.Data.OleDb.OleDbCommand command = connection.CreateCommand())
{
//Unfortunately Access wont let you paramaterize the table name
command.CommandText = $"SELECT ModDateTime FROM {Regex.Replace(table, "[^a-zA-Z0-9]", "")} WHERE RecID = @Value";
command.Parameters.Add(new System.Data.OleDb.OleDbParameter
{
OleDbType = System.Data.OleDb.OleDbType.VarChar,
ParameterName = "@Value",
Value = Recid
});
return command.ExecuteScalar().ToString();
}
}
}
} }
} }
@@ -2653,6 +2653,34 @@ namespace RODBInterface
} }
return GrpCnt; return GrpCnt;
} }
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
//Get the Modification Date / Time for the RO
public override string RODB_GetModDateTime(string Recid, string table)
{
using (SqlConnection connection = new SqlConnection(strDatabaseConnectionCommand))
{
connection.Open();
using (SqlCommand command = connection.CreateCommand())
{
command.CommandText = $"SELECT ModDateTime FROM ROALL WHERE RecID = @Value AND ROTable = @table";
command.Parameters.Add(new SqlParameter
{
SqlDbType = SqlDbType.VarChar,
ParameterName = "@Value",
Value = Recid
});
command.Parameters.Add(new SqlParameter
{
SqlDbType = SqlDbType.VarChar,
ParameterName = "@table",
Value = table
});
return command.ExecuteScalar().ToString();
}
}
}
#endregion #endregion
public static bool TestConnect(string constring) public static bool TestConnect(string constring)
{ {
+163 -32
View File
@@ -13541,34 +13541,6 @@ IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteAllDocVers
DROP PROCEDURE [deleteAllDocVersionPdfs]; DROP PROCEDURE [deleteAllDocVersionPdfs];
GO GO
/*****************************************************************************
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
Copyright 2017 - Volian Enterprises, Inc. All rights reserved.
*****************************************************************************/
CREATE PROCEDURE [dbo].[deleteAllDocVersionPdfs]
(
@VersionID int
)
WITH EXECUTE AS OWNER
AS
BEGIN TRY -- Try Block
BEGIN TRANSACTION
DELETE [Pdfs]
WHERE [DocID] IN(select EE.DocID from vefn_GetVersionItems(cast(@VersionID as varchar(20))) VI
Join Entries EE ON EE.ContentID= VI.ContentID)
IF( @@TRANCOUNT > 0 ) COMMIT
END TRY
BEGIN CATCH -- Catch Block
IF( @@TRANCOUNT = 1 ) ROLLBACK -- Only rollback if top level
ELSE IF( @@TRANCOUNT > 1 ) COMMIT -- Otherwise commit. Top level will rollback
EXEC vlnErrorHandler
END CATCH
GO
-- Display the status of Proc creation
IF (@@Error = 0) PRINT 'Procedure Creation: deleteAllDocVersionPdfs Succeeded'
ELSE PRINT 'Procedure Creation: deleteAllDocVersionPdfs Error on Creation'
GO
/****** Object: StoredProcedure [addFiguresByROFstIDandImageIDs] ******/ /****** Object: StoredProcedure [addFiguresByROFstIDandImageIDs] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[addFiguresByROFstIDandImageIDs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[addFiguresByROFstIDandImageIDs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [addFiguresByROFstIDandImageIDs]; DROP PROCEDURE [addFiguresByROFstIDandImageIDs];
@@ -17169,6 +17141,7 @@ GO
[roid] [varchar](50) NOT NULL, [roid] [varchar](50) NOT NULL,
[appid] [varchar](max) NULL, [appid] [varchar](max) NULL,
[value] [varchar](max) NULL, [value] [varchar](max) NULL,
[moddatetime] [datetime] NULL,
CONSTRAINT [PK_RofstChild] PRIMARY KEY CLUSTERED CONSTRAINT [PK_RofstChild] PRIMARY KEY CLUSTERED
( (
[RofstChildID] ASC [RofstChildID] ASC
@@ -17303,6 +17276,23 @@ GO
End -- Rofst Tables End -- Rofst Tables
Go Go
-- =============================================
-- Author: Matthew Schill
-- Create date: 03/30/2026
-- Description: Store RO Modification date/time
-- =============================================
--- Add Column to store RO Modification date/time if it does not already exist
IF NOT EXISTS(SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'RofstChild'
AND COLUMN_NAME = 'moddatetime')
ALTER TABLE RofstChild ADD moddatetime datetime NULL;
go
-- Display the status
IF (@@Error = 0) PRINT 'Altered table [RofstChild] Succeeded for moddatetime'
ELSE PRINT 'Altered table [RofstChild] Error on Alter for moddatetime'
go
/* /*
---------------------------------------------------------------------------------- ----------------------------------------------------------------------------------
@@ -19705,6 +19695,7 @@ GO
@roid VarChar(50), @roid VarChar(50),
@appid VarChar(Max) = null, @appid VarChar(Max) = null,
@value VarChar(Max) = null, @value VarChar(Max) = null,
@ModDateTime DateTime = null,
@missingDefaultValue VarChar(Max) = null @missingDefaultValue VarChar(Max) = null
) )
With Execute as Owner With Execute as Owner
@@ -19722,8 +19713,8 @@ GO
Set @missingDefaultValue = '[TBD]'; Set @missingDefaultValue = '[TBD]';
-- Create Rofst Child/Group Record --> [Roid = (12) Digits] -- Create Rofst Child/Group Record --> [Roid = (12) Digits]
Insert Into RofstChild (RofstID, ID, ParentID, dbiID, [type], title, roid, appid, [value]) Insert Into RofstChild (RofstID, ID, ParentID, dbiID, [type], title, roid, appid, moddatetime, [value])
Values (@RofstID, @ID, @ParentID, @dbiID, @type, @title, @roid, @appid, REPLACE(REPLACE(@value, '&123;', '{'), '&125;', '}')); Values (@RofstID, @ID, @ParentID, @dbiID, @type, @title, @roid, @appid, @ModDateTime, REPLACE(REPLACE(@value, '&123;', '{'), '&125;', '}'));
-- Check for appid, if exists, then insert the default value for each return type if multi-value -- Check for appid, if exists, then insert the default value for each return type if multi-value
@@ -24777,6 +24768,146 @@ IF (@@Error = 0) PRINT 'Procedure Creation: [GetMissingDocsByUnit] Succeeded'
ELSE PRINT 'Procedure Creation: [GetMissingDocsByUnit] Error on Creation' ELSE PRINT 'Procedure Creation: [GetMissingDocsByUnit] Error on Creation'
GO GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_ROFST_changes]') AND OBJECTPROPERTY(id,N'IsTableFunction') = 1)
DROP FUNCTION [vefn_ROFST_changes];
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*
==========================================================================================================
Author: Matthew Schill
Create Date: 03/31/2026
Description: Function for ROs that updated in latest RO FST Load
==========================================================================================================
*/
CREATE FUNCTION [dbo].[vefn_ROFST_changes](@OrigFSTID int, @NewFSTid int, @VersionID int)
RETURNS @ROIDs TABLE
(
[roid] varchar(50)
)
WITH EXECUTE AS OWNER
AS
BEGIN
insert into @ROIDs
SELECT DISTINCT ISNULL(RofstChild.roid,previous.roid)
FROM
(SELECT * FROM RofstChild where RofstChild.RofstID = @NewFSTid) RofstChild
FULL OUTER JOIN
(SELECT * FROM RofstChild previous where previous.RofstID = @OrigFSTID) previous
ON previous.dbiID = RofstChild.dbiID AND previous.ID = RofstChild.ID
where
ISNULL(previous.RofstID,'') != ISNULL(RofstChild.RofstID,'')
AND
(
(RofstChild.RofstID = @NewFSTid OR RofstChild.RofstID IS NULL)
AND
(previous.RofstID = @OrigFSTID OR previous.RofstID IS NULL)
)
AND
(previous.moddatetime IS NULL
OR RofstChild.moddatetime IS NULL
OR RofstChild.moddatetime != previous.moddatetime
OR RofstChild.title != previous.title
OR RofstChild.value != previous.value
)
RETURN
END
go
IF (@@Error = 0) PRINT 'TableFunction [vefn_ROFST_changes] Succeeded'
ELSE PRINT 'TableFunction [vefn_ROFST_changes] Error on Creation'
go
/****** Object: StoredProcedure [deleteDocVersionPdfsWithNewROs] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteDocVersionPdfsWithNewROs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [deleteDocVersionPdfsWithNewROs];
GO
/*
==========================================================================================================
Author: Matthew Schill
Create Date: 03/31/2026
Description: Delete all PDFs with ROs that will need re-resolved
==========================================================================================================
*/
CREATE PROCEDURE [dbo].[deleteDocVersionPdfsWithNewROs]
(
@VersionID int,
@OrigFSTid int,
@NewFSTid int
)
WITH EXECUTE AS OWNER
AS
BEGIN
DELETE [Pdfs]
WHERE [DocID] IN
(
select EE.DocID from vefn_GetVersionItems(cast(@VersionID as varchar(20))) VI
Join Entries EE ON EE.ContentID= VI.ContentID
Join DRoUsages ON DRoUsages.DocID = EE.DocID
Join dbo.vefn_ROFST_changes(@OrigFSTID, @NewFSTid, @VersionID) ROFST_changes on LEFT(DRoUsages.ROID,12) = ROFST_changes.roid
)
RETURN
END
GO
-- Display the status of Proc creation
IF (@@Error = 0) PRINT 'Procedure Creation: deleteDocVersionPdfsWithNewROs Succeeded'
ELSE PRINT 'Procedure Creation: deleteDocVersionPdfsWithNewROs Error on Creation'
GO
/****** Object: StoredProcedure [getItemsWithNewROs] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[getItemsWithNewROs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [getItemsWithNewROs];
GO
/*
==========================================================================================================
Author: Matthew Schill
Create Date: 03/31/2026
Description: Get Items with New ROs that will need resolved
==========================================================================================================
*/
CREATE PROCEDURE [dbo].[getItemsWithNewROs]
(
@VersionID int,
@OrigFSTid int,
@NewFSTid int
)
WITH EXECUTE AS OWNER
AS
BEGIN
select DISTINCT tblItems.ItemID FROM
dbo.vefn_ROFST_changes(@OrigFSTID, @NewFSTid, @VersionID) ROFST_changes
INNER JOIN RoUsages ON LEFT(RoUsages.ROID,12) = ROFST_changes.roid
INNER JOIN tblItems ON RoUsages.ContentID = tblItems.ContentID
OUTER APPLY (Select VersionID = dbo.vefn_GetVersionIDByItemID(tblItems.ItemID)) ver
INNER JOIN DocVersions DV ON DV.VersionID = ver.VersionID
INNER JOIN Associations ON Associations.VersionID = DV.VersionID
where ver.VersionID = @VersionID
RETURN
END
GO
-- Display the status of Proc creation
IF (@@Error = 0) PRINT 'Procedure Creation: getItemsWithNewROs Succeeded'
ELSE PRINT 'Procedure Creation: getItemsWithNewROs Error on Creation'
GO
/* /*
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
| ADD New Code Before this Block | | ADD New Code Before this Block |
@@ -24810,8 +24941,8 @@ BEGIN TRY -- Try Block
DECLARE @RevDate varchar(255) DECLARE @RevDate varchar(255)
DECLARE @RevDescription varchar(255) DECLARE @RevDescription varchar(255)
set @RevDate = '03/13/2026 7:00 AM' set @RevDate = '04/21/2026 7:00 AM'
set @RevDescription = 'Added Get Missing Docs by Unit for Generating Pdf table' set @RevDescription = 'Store RO Modification date/time'
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
@@ -1036,6 +1036,9 @@ namespace VEPROMS
ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst; ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst;
string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst"; string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst";
//must get id before ROFST gets updated so know what to refresh later
int origfstid = roFstInfo.ROFstID;
//if (!pathExists(rofstPath)) //if (!pathExists(rofstPath))
if (!File.Exists(rofstPath)) if (!File.Exists(rofstPath))
{ {
@@ -1064,7 +1067,7 @@ namespace VEPROMS
roFstInfo = dq.DocVersionAssociations[0].MyROFst; roFstInfo = dq.DocVersionAssociations[0].MyROFst;
} }
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, txtProcess); ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, txtProcess, roFstInfo, origfstid, roFstInfo.ROFstID);
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
} }
+1 -12
View File
@@ -83,7 +83,6 @@ namespace VEPROMS
this.lblUser = new DevComponents.DotNetBar.LabelItem(); this.lblUser = new DevComponents.DotNetBar.LabelItem();
this.lblLastChange = new DevComponents.DotNetBar.LabelItem(); this.lblLastChange = new DevComponents.DotNetBar.LabelItem();
this.btnStepRTF = new DevComponents.DotNetBar.ButtonItem(); this.btnStepRTF = new DevComponents.DotNetBar.ButtonItem();
this.btnFixMSWord = new DevComponents.DotNetBar.ButtonItem();
this.epAnnotations = new DevComponents.DotNetBar.ExpandablePanel(); this.epAnnotations = new DevComponents.DotNetBar.ExpandablePanel();
this.ctrlAnnotationDetails = new Volian.Controls.Library.AnnotationDetails(); this.ctrlAnnotationDetails = new Volian.Controls.Library.AnnotationDetails();
this.btnAnnoDetailsPushPin = new DevComponents.DotNetBar.ButtonX(); this.btnAnnoDetailsPushPin = new DevComponents.DotNetBar.ButtonX();
@@ -541,8 +540,7 @@ namespace VEPROMS
this.btnEditItem, this.btnEditItem,
this.lblUser, this.lblUser,
this.lblLastChange, this.lblLastChange,
this.btnStepRTF, this.btnStepRTF});
this.btnFixMSWord});
this.bottomBar.Location = new System.Drawing.Point(5, 573); this.bottomBar.Location = new System.Drawing.Point(5, 573);
this.bottomBar.Name = "bottomBar"; this.bottomBar.Name = "bottomBar";
this.bottomBar.Size = new System.Drawing.Size(1185, 25); this.bottomBar.Size = new System.Drawing.Size(1185, 25);
@@ -728,14 +726,6 @@ namespace VEPROMS
this.btnStepRTF.Text = "Step RTF"; this.btnStepRTF.Text = "Step RTF";
this.btnStepRTF.Click += new System.EventHandler(this.btnStepRTF_Click); 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 // epAnnotations
// //
this.epAnnotations.CanvasColor = System.Drawing.SystemColors.Control; this.epAnnotations.CanvasColor = System.Drawing.SystemColors.Control;
@@ -1775,7 +1765,6 @@ namespace VEPROMS
private DevComponents.DotNetBar.ButtonItem btnItemInfo; private DevComponents.DotNetBar.ButtonItem btnItemInfo;
private DevComponents.DotNetBar.ButtonItem btnFilter; private DevComponents.DotNetBar.ButtonItem btnFilter;
private DevComponents.DotNetBar.TextBoxItem txtFilter; private DevComponents.DotNetBar.TextBoxItem txtFilter;
private DevComponents.DotNetBar.ButtonItem btnFixMSWord;
private Volian.Controls.Library.DisplayBookMarks displayBookMarks; private Volian.Controls.Library.DisplayBookMarks displayBookMarks;
//private DevComponents.DotNetBar.LabelItem lblLocked; //private DevComponents.DotNetBar.LabelItem lblLocked;
private DevComponents.DotNetBar.ButtonItem btnShortCuts; private DevComponents.DotNetBar.ButtonItem btnShortCuts;
+42 -20
View File
@@ -1594,7 +1594,7 @@ namespace VEPROMS
displayRO.MyROFST = SelectedROFst; displayRO.MyROFST = SelectedROFst;
// B2023-021: force Load of Step Prop/RO panel RO tree by passing in // B2023-021: force Load of Step Prop/RO panel RO tree by passing in
// true to LoadTree // true to LoadTree
displayRO.LoadTree(true); if (!_WeAreExitingPROMS) displayRO.LoadTree(true);
} }
} }
@@ -2395,6 +2395,7 @@ namespace VEPROMS
tv.MySessionInfo = MySessionInfo; tv.MySessionInfo = MySessionInfo;
tv.MyUserInfo = MyUserInfo; tv.MyUserInfo = MyUserInfo;
StepTabRibbon.MySessionInfo = MySessionInfo; StepTabRibbon.MySessionInfo = MySessionInfo;
displayRO.MySessionInfo = MySessionInfo;
// Initialize Caption with Server name and Database name. // Initialize Caption with Server name and Database name.
SetCaption(tv.TopNode as VETreeNode); SetCaption(tv.TopNode as VETreeNode);
@@ -4553,6 +4554,15 @@ namespace VEPROMS
SetCaption(tv.SelectedNode as VETreeNode); SetCaption(tv.SelectedNode as VETreeNode);
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem; displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// DisplayTab was changed
// need to clear the RTB selected
// without resetting the DVI or FST
// (those will be set manually / individually)
// this will prevent DVI and FST from changing to null then back again
// which will trigger reloads
displayRO.ClearRTB();
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0) if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
{ {
displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
@@ -4562,9 +4572,24 @@ namespace VEPROMS
displayRO.MyROFST = null; displayRO.MyROFST = null;
} }
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// set the DocVersionInfo so that the FST and docversion are in sync
SelectedDVI = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion;
if (displayRO.MyDvi != SelectedDVI)
{
displayRO.MyDvi = SelectedDVI;
}
Application.DoEvents();
// B2022-026 RO Memory reduction coding (Jakes Merge) // B2022-026 RO Memory reduction coding (Jakes Merge)
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures. (Added True for the forceLoad parameter) // B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures. (Added True for the forceLoad parameter)
displayRO.LoadTree(true); //C2026-008 Re-Architect RO.FST to include RO Modification date/time
// if ROFST got updated,
// set the Selected FST so it is in sync
if (!_WeAreExitingPROMS && displayRO.LoadTree(true))
{
SelectedROFst = displayRO.MyROFST;
}
lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole; lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole;
@@ -4628,8 +4653,6 @@ namespace VEPROMS
if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus) if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus)
return; return;
btnFixMSWord.Visible = (args != null && (args.MyItemInfo != null && args.MyEditItem == null));
if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed) if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed)
_LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged); _LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged);
@@ -4767,7 +4790,13 @@ namespace VEPROMS
// B2022-026 RO Memory reduction coding (Jakes Merge) // B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.ProgressBar = bottomProgBar; displayRO.ProgressBar = bottomProgBar;
displayRO.MyRTB = args.MyEditItem.MyStepRTB; displayRO.MyRTB = args.MyEditItem.MyStepRTB;
displayRO.LoadTree(); //C2026-008 Re-Architect RO.FST to include RO Modification date/time
// if ROFST got updated,
// set the Selected FST so it is in sync
if (!_WeAreExitingPROMS && displayRO.LoadTree())
{
SelectedROFst = displayRO.MyROFST;
}
displayBookMarks.MyEditItem = args.MyEditItem; displayBookMarks.MyEditItem = args.MyEditItem;
displayHistory.MyEditItem = args.MyEditItem; displayHistory.MyEditItem = args.MyEditItem;
@@ -4797,7 +4826,7 @@ namespace VEPROMS
// B2022-026 RO Memory reduction coding (Jakes Merge) // B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.SetFindDocROButton(false); displayRO.SetFindDocROButton(false);
displayRO.LoadTree(); if (!_WeAreExitingPROMS) displayRO.LoadTree();
//C2019-036 View Only mode work with Checked Out Procedures //C2019-036 View Only mode work with Checked Out Procedures
//In View Only Mode - Step Properties should be disabled //In View Only Mode - Step Properties should be disabled
@@ -4931,7 +4960,13 @@ namespace VEPROMS
displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo; displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo;
// B2022-026 RO Memory reduction coding (Jakes Merge) // B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.LoadTree(); //C2026-008 Re-Architect RO.FST to include RO Modification date/time
// if ROFST got updated,
// set the Selected FST so it is in sync
if (displayRO.LoadTree())
{
SelectedROFst = displayRO.MyROFST;
}
} }
#endregion #endregion
@@ -5241,19 +5276,6 @@ namespace VEPROMS
Clipboard.SetDataObject(mydo); 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) private void epAnnotations_Resize(object sender, EventArgs e)
{ {
@@ -1527,6 +1527,9 @@ namespace VEPROMS
Cursor = Cursors.WaitCursor; Cursor = Cursors.WaitCursor;
//must get id before ROFST gets updated so know what to refresh later
int origfstid = SelectedROFst.ROFstID;
// RO changes placed in file in the Documents\VEPROMS folder // RO changes placed in file in the Documents\VEPROMS folder
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(_DocVersionConfig.MyDocVersion.MyDocVersionInfo)); swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(_DocVersionConfig.MyDocVersion.MyDocVersionInfo));
DocVersion dv = _DocVersionConfig.MyDocVersion; DocVersion dv = _DocVersionConfig.MyDocVersion;
@@ -1540,7 +1543,7 @@ namespace VEPROMS
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
SelectedROFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); SelectedROFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFst newrofst = ROFstInfo.RefreshROFst(_DocVersionConfig.MyDocVersion, SelectedROFst, DoProgressBarRefresh, null); ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, null, SelectedROFst, origfstid, SelectedROFst.ROFstID);
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange; ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
SelectedROFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); SelectedROFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
@@ -97,6 +97,7 @@ namespace VEPROMS.CSLA.Library
public string appid; public string appid;
public int ID; public int ID;
public int ParentID; public int ParentID;
public DateTime? ModDateTime; //C2026-008 Re-Architect RO.FST to include RO Modification date/time
public rochild[] children; public rochild[] children;
}; };
@@ -110,6 +111,7 @@ namespace VEPROMS.CSLA.Library
public string roid; // roid unique identifier public string roid; // roid unique identifier
public string appid; // accessory page id - user specified unique id public string appid; // accessory page id - user specified unique id
public string value; // return value, can be multiple values public string value; // return value, can be multiple values
public DateTime? ModDateTime; //C2026-008 Re-Architect RO.FST to include RO Modification date/time
public rochild[] children; public rochild[] children;
}; };
@@ -686,6 +688,10 @@ namespace VEPROMS.CSLA.Library
//return string.Format("{0,10:#####0.00}", TimeSpan.FromTicks(DateTime.Now.Ticks - dtStart.Ticks).TotalSeconds); //return string.Format("{0,10:#####0.00}", TimeSpan.FromTicks(DateTime.Now.Ticks - dtStart.Ticks).TotalSeconds);
} }
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
//return new ROFstID if there is a newer ID that matches the same ROFSTDB
public int GetNewerFSTID() => RofstGetLatestID(RofstID);
#endregion #endregion
#endregion #endregion
@@ -888,7 +894,7 @@ namespace VEPROMS.CSLA.Library
} }
} }
private void RofstChildInsert(int rofstID, int id, int parentID, int dbiID, int type, string title, string roid, string appid, string value) private void RofstChildInsert(int rofstID, int id, int parentID, int dbiID, int type, string title, string roid, string appid, string value, DateTime? dt = null)
{ {
try try
{ {
@@ -917,6 +923,9 @@ namespace VEPROMS.CSLA.Library
if (!string.IsNullOrEmpty(this.RoMissingDefaultValue)) if (!string.IsNullOrEmpty(this.RoMissingDefaultValue))
cmd.Parameters.Add(new SqlParameter("@missingDefaultValue", SqlDbType.VarChar)).Value = this.RoMissingDefaultValue; cmd.Parameters.Add(new SqlParameter("@missingDefaultValue", SqlDbType.VarChar)).Value = this.RoMissingDefaultValue;
if (dt != null)
cmd.Parameters.Add(new SqlParameter("@ModDateTime", SqlDbType.DateTime)).Value = dt;
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
} }
@@ -1299,6 +1308,32 @@ namespace VEPROMS.CSLA.Library
} }
} }
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
//return new ROFstID if there is a newer ID that matches the same ROFSTDB
private int RofstGetLatestID(int rofstID)
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cmd = cn.CreateCommand())
{
cmd.CommandTimeout = 0;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT ISNULL((SELECT TOP 1 ROFsts.ROFstID FROM ROFsts INNER JOIN ROFsts curFST ON curFST.RODbID = ROFsts.RODbID WHERE curFST.ROFstID = @FSTid order by ROFsts.DTS desc),-1)";
cmd.Parameters.Add(new SqlParameter("@FSTid", SqlDbType.Int)).Value = rofstID;
return (int) cmd.ExecuteScalar();
}
}
}
catch (Exception ex)
{
throw new DbCslaException("RofstData.RofstGetLatestID", ex);
}
}
#endregion #endregion
#region (Core/Base logic for RO Values & UnitInfo RO Values) #region (Core/Base logic for RO Values & UnitInfo RO Values)
@@ -1523,6 +1558,10 @@ namespace VEPROMS.CSLA.Library
tmp.appid = tmpg.appid; tmp.appid = tmpg.appid;
tmp.roid = tableID.ToString("X4") + tmp.ID.ToString("X8"); tmp.roid = tableID.ToString("X4") + tmp.ID.ToString("X8");
tmp.children = tmpg.children; tmp.children = tmpg.children;
if (tmpg.ModDateTime != null)
{
tmp.ModDateTime = tmpg.ModDateTime;
}
int j; int j;
@@ -1542,6 +1581,12 @@ namespace VEPROMS.CSLA.Library
int slen2 = StringLength(ab, offset + 13 + slen); int slen2 = StringLength(ab, offset + 13 + slen);
myGrp.appid = Encoding.Default.GetString(ab, offset + 13 + slen, slen2); myGrp.appid = Encoding.Default.GetString(ab, offset + 13 + slen, slen2);
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
if (myGrp.value != "" && DateTime.TryParseExact(Encoding.Default.GetString(ab, offset + 14 + slen + slen2, 14), "yyyyMMddHHmmss", null, System.Globalization.DateTimeStyles.None, out DateTime dt))
{
myGrp.ModDateTime = dt;
}
_dbRoCnt++; _dbRoCnt++;
} }
@@ -1655,7 +1700,7 @@ namespace VEPROMS.CSLA.Library
private void LoadChild(int rofstID, int dbiID, ROFSTLookup.rochild child) private void LoadChild(int rofstID, int dbiID, ROFSTLookup.rochild child)
{ {
//Insert Rofst Child //Insert Rofst Child
RofstChildInsert(rofstID, child.ID, child.ParentID, dbiID, child.type, child.title, child.roid, child.appid, child.value); RofstChildInsert(rofstID, child.ID, child.ParentID, dbiID, child.type, child.title, child.roid, child.appid, child.value, child.ModDateTime);
//Increment RO Count if RoChild has a return value //Increment RO Count if RoChild has a return value
if (!string.IsNullOrEmpty(child.value)) _curRoCnt++; if (!string.IsNullOrEmpty(child.value)) _curRoCnt++;
@@ -1093,6 +1093,15 @@ namespace VEPROMS.CSLA.Library
} }
} }
} }
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
//Refresh at item level
public static void RefreshReferenceObjects(ItemInfo tmp, ROFstInfo origROFst)
{
if (tmp.MyDocVersion.DocVersionConfig.SelectedSlave <= 0)
MyRefreshReferenceObjects(tmp, null, tmp.GetSectionInfo(), tmp.MyDocVersion, origROFst);
}
// B2022-026 RO Memory Reduction code - pass in ROFstInfo // B2022-026 RO Memory Reduction code - pass in ROFstInfo
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, ROFstInfo origROFst) internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, ROFstInfo origROFst)
{ {
@@ -1219,6 +1228,22 @@ namespace VEPROMS.CSLA.Library
return true; return true;
} }
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
public static List<ItemInfo> GetItemInfoWithChangedROs(int docversionid, int origfstid, int newfstid)
{
List<ItemInfo> lst = new List<ItemInfo>();
foreach (DataRow r in Data_GetItemsWithChangedROs(docversionid, origfstid, newfstid).Rows)
{
using (ItemInfo itm = Get((int)r["ItemID"]))
{
lst.Add(itm);
}
}
return lst;
}
#region Debug Code #region Debug Code
//private static void ShowDifference(string oldText, string newText) //private static void ShowDifference(string oldText, string newText)
@@ -1890,6 +1915,40 @@ namespace VEPROMS.CSLA.Library
foreach (ItemInfo itemInfo in partInfo.MyItems) foreach (ItemInfo itemInfo in partInfo.MyItems)
itemInfo.SpinThroughChildren(); itemInfo.SpinThroughChildren();
} }
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
private static DataTable Data_GetItemsWithChangedROs(int docversionid, int origfstid, int newfstid)
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "getItemsWithNewROs";
cm.Parameters.AddWithValue("@VersionID", docversionid);
cm.Parameters.AddWithValue("@OrigFSTid", origfstid);
cm.Parameters.AddWithValue("@NewFSTid", newfstid);
cm.CommandTimeout = Database.DefaultTimeout;
using (SqlDataAdapter da = new SqlDataAdapter(cm))
{
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
}
}
}
catch (Exception ex)
{
Database.LogException("ItemInfoList.Data_GetItemsWithChangedROs", ex);
throw new DbCslaException("ItemInfoList.Data_GetItemsWithChangedROs", ex);
}
}
#endregion #endregion
#region LoadAtOnce #region LoadAtOnce
// Method to Get Item and children // Method to Get Item and children
@@ -6215,6 +6274,11 @@ namespace VEPROMS.CSLA.Library
if (!SectionHasCheckOffs()) return null; if (!SectionHasCheckOffs()) return null;
int stpCoIndx = CheckOffIndex(); // this step has a checkoff defined int stpCoIndx = CheckOffIndex(); // this step has a checkoff defined
if (stpCoIndx == -1) return null; 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 (sectCoIndx == -1) return null;
+12 -22
View File
@@ -61,35 +61,25 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Pdf.DataPortal_Delete", ex); throw new DbCslaException("Pdf.DataPortal_Delete", ex);
} }
} }
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// used to remove word section PDFs to force ROs to be updated when printed or saved // used to remove word section PDFs to force ROs to be updated when printed or saved
public static void DeleteAllDocVersion(int versionID) public static void DeleteDocVersionPDFsWithNewROs(int versionID, int origfstid, int newfstid)
{ {
if (!CanDeleteObject()) if (!CanDeleteObject())
throw new System.Security.SecurityException("User not authorized to remove a Pdf"); throw new System.Security.SecurityException("User not authorized to remove a Pdf");
try try
{ {
DataPortal.Delete(new VersionIDCriteria(versionID)); DeleteWithNewROs(versionID, origfstid, newfstid);
} }
catch (Exception ex) catch (Exception ex)
{ {
throw new DbCslaException("Error on Pdf.DeleteAllDocVersion", ex); throw new DbCslaException("Error on Pdf.DeleteAllDocVersion", ex);
} }
} }
[Serializable()]
protected class VersionIDCriteria static private void DeleteWithNewROs(int docversionID, int origfstid, int newfstid)
{ {
private int _VersionID;
public int VersionID
{ get { return _VersionID; } }
public VersionIDCriteria(int versionID)
{
_VersionID = versionID;
}
}
[Transactional(TransactionalTypes.TransactionScope)]
private void DataPortal_Delete(VersionIDCriteria criteria)
{
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Pdf.DataPortal_Delete", GetHashCode());
try try
{ {
using (SqlConnection cn = Database.VEPROMS_SqlConnection) using (SqlConnection cn = Database.VEPROMS_SqlConnection)
@@ -98,20 +88,20 @@ namespace VEPROMS.CSLA.Library
{ {
cm.CommandType = CommandType.StoredProcedure; cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout; cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteAllDocVersionPdfs"; cm.CommandText = "deleteDocVersionPdfsWithNewROs";
cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); cm.Parameters.AddWithValue("@VersionID", docversionID);
cm.Parameters.AddWithValue("@OrigFSTid", origfstid);
cm.Parameters.AddWithValue("@NewFSTid", newfstid);
cm.ExecuteNonQuery(); cm.ExecuteNonQuery();
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
if (_MyLog.IsErrorEnabled) _MyLog.Error("Pdf.DataPortal_Delete", ex); if (_MyLog.IsErrorEnabled) _MyLog.Error("Pdf.DeleteWithNewROs", ex);
_ErrorMessage = ex.Message; throw new DbCslaException("Pdf.DeleteWithNewROs", ex);
throw new DbCslaException("Pdf.DataPortal_Delete", ex);
} }
} }
} }
public partial class PdfInfo public partial class PdfInfo
{ {
+25 -221
View File
@@ -225,38 +225,51 @@ namespace VEPROMS.CSLA.Library
} }
} }
// B2022-026 RO Memory Reduction code - pass in the ROFstInfo //C2026-008 Re-Architect RO.FST to include RO Modification date/time
public static int RefreshROFst(DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus, ROFstInfo origROFst) // Refresh at item level
public static int RefreshROFstAtItemLevel(DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus, ROFstInfo localROFst, int origfstid, int newfstid)
{ {
int fixedROs = 0; int fixedROs = 0;
if (dvi.DocVersionConfig.SelectedSlave <= 0) if (dvi.DocVersionConfig.SelectedSlave <= 0)
{ {
myProgressBarRefresh(1, 100, "Update MS Word ROs"); // remove word section PDFs to force update of RO values when printed
myProgressBarRefresh(1, 100, "Updating MS Word ROs In Progress");
Pdf.DeleteDocVersionPDFsWithNewROs(dvi.VersionID, origfstid, newfstid);
Pdf.DeleteAllDocVersion(dvi.VersionID); // remove word section PDFs to force update of RO values when printed //Loop Through ROs in this docversion that are different than the previous fst
myProgressBarRefresh(50, 100, "Updating ROs In PROMS Steps In Progress");
int i = 0; int i = 0;
List<ItemInfo> list = ItemInfo.GetItemInfoWithChangedROs(dvi.VersionID, origfstid, newfstid);
foreach (ProcedureInfo proc in dvi.Procedures) foreach (ItemInfo itm in list)
{ {
DateTime start = DateTime.Now; DateTime start = DateTime.Now;
ProcedureInfo.ResetROCounters(); ItemInfo.ResetROCounters();
myProgressBarRefresh(++i, dvi.Procedures.Count, string.Format("{0} ({1}/{2} ROs {3})", proc.DisplayNumber, i, dvi.Procedures.Count, fixedROs)); myProgressBarRefresh(++i, list.Count, string.Format("{0} ({1}/{2} ROs {3})", itm.MyProcedure.DisplayNumber, i, list.Count, fixedROs));
ProcedureInfo.RefreshReferenceObjects(proc, origROFst); ItemInfo.RefreshReferenceObjects(itm, localROFst);
fixedROs += ProcedureInfo.ROFixCount; fixedROs += ItemInfo.ROFixCount;
TimeSpan ts = DateTime.Now - start; TimeSpan ts = DateTime.Now - start;
if (tbStatus != null) if (tbStatus != null)
tbStatus.AppendText(string.Format("Procedure: {1}{0}, Checked {2} Referenced Objects{0}, Fixed {3} Referenced Objects{0}, Elapsed Seconds:{4}{0}{0}", Environment.NewLine, proc.DisplayNumber, ProcedureInfo.ROCheckCount, ProcedureInfo.ROFixCount, ts.TotalSeconds)); tbStatus.AppendText(string.Format("Procedure: {1}{0}, Checked {2} Referenced Objects{0}, Fixed {3} Referenced Objects{0}, Elapsed Seconds:{4}{0}{0}", Environment.NewLine, itm.MyProcedure.DisplayNumber, ItemInfo.ROCheckCount, ItemInfo.ROFixCount, ts.TotalSeconds));
}
//Update the DocVersion Associations to link to the new RO FST id and current date/time
using (DocVersion dv = DocVersion.Get(dvi.VersionID))
{
if (dvi.DocVersionAssociations[0].MyROFst.ROFstID != newfstid)
{
dv.DocVersionAssociations[0].MyROFst = localROFst.GetJustROFst();
SetAssociationLastCompleted(dv, DateTime.Now.ToString());
}
} }
} }
return fixedROs; return fixedROs;
} }
//C2022-028 for Admin tool to check for bad RO links //C2022-028 for Admin tool to check for bad RO links
//B2022-144 we now loop through checked procedures list from Admin Tools and call this method for each procedure we want to process //B2022-144 we now loop through checked procedures list from Admin Tools and call this method for each procedure we want to process
public static int CheckROLinksInThisProcedure(ProcedureInfo proc, System.Windows.Forms.TextBox tbStatus) public static int CheckROLinksInThisProcedure(ProcedureInfo proc, System.Windows.Forms.TextBox tbStatus)
@@ -291,34 +304,6 @@ namespace VEPROMS.CSLA.Library
return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\ROUpdateReport_" + ValidFileName.FixFileName(dvi.MyFolder.Name.Replace(" ", "_") + "_" + DateTime.Now.ToString("MM-dd-yyyy_HH-mm-ss") + ".txt"); return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\ROUpdateReport_" + ValidFileName.FixFileName(dvi.MyFolder.Name.Replace(" ", "_") + "_" + DateTime.Now.ToString("MM-dd-yyyy_HH-mm-ss") + ".txt");
} }
// B2022-026 RO Memory Reduction code - moved the call to UpdateROFst() to before we call RefreshROFst
// so that we used the correct ROFstInfo which as the needed event methods set when updated RO Table types
public static ROFst RefreshROFst(DocVersion docver, ROFstInfo origROFst, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus)
{
ROFst rofst = null;
rofst = docver.DocVersionAssociations[0].MyROFst;
DocVersionInfo dvi = DocVersionInfo.Get(docver.VersionID);
SetAssociationLastCompleted(docver, string.Empty);
int fixedROs = RefreshROFst(dvi, myProgressBarRefresh, tbStatus, origROFst);
SetAssociationLastCompleted(docver, DateTime.Now.ToString()); // RO Update completed successfully and un-interrupted, save the date/time to the Doc Version Association config
myProgressBarRefresh(100, 100, "RO Update Complete"); // update the progress bar
System.Windows.Forms.Application.DoEvents();
// pop up a message window telling the user the RO Update has completed and how many ROs were updated
// If we are updating RO from the Admin Tools (from the V button) and we are updating more than on procedure set, then just append the "RO Update Complete" text
// To the MessageList. Once completed will all procedure sets, Admin Tools will display one message box with all the results in it.
if (MessageList == null)
FlexibleMessageBox.Show(fixedROs == 0 ? "No ROs Required Updating" : string.Format("{0} ROs Updated for {1}", fixedROs, dvi.MyFolder.Name), "RO Update Complete");
else
MessageList.AppendLine((fixedROs == 0 ? "No ROs Required Updating for " : string.Format("{0} ROs Updated for ", fixedROs)) + dvi.MyFolder.Name);
return rofst;
}
/// <summary> /// <summary>
/// Updates an ro.fst into a sql database. /// Updates an ro.fst into a sql database.
/// </summary> /// </summary>
@@ -670,187 +655,6 @@ namespace VEPROMS.CSLA.Library
return sb.ToString(); return sb.ToString();
} }
private static void UpdateROValuesText(ROFstInfo origROFstInfo, ROFst newROFst, DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, List<string> MyChangedFigureROIDs)
{
if (myProgressBarRefresh != null) myProgressBarRefresh(0, 100, "Update Ro Values");
string versionList = dvi.VersionID.ToString();
ROFSTLookup origLookup = new ROFSTLookup(origROFstInfo.ROFstID, dvi);
ROFSTLookup newLookup = new ROFSTLookup(newROFst.ROFstID, dvi);
List<string> delList = new List<string>();
List<string> chgList = newLookup.GetValueDifferences(origROFstInfo.ROFstID, ref delList);
// Any figures which have been changed will be included in the list of values that have changed.
if (MyChangedFigureROIDs != null)
{
foreach (string roid in MyChangedFigureROIDs)
{
if (!chgList.Contains(roid)) chgList.Add(roid);
}
}
string RoidList = GetRoidList(newROFst.RODbID, chgList);
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Getting List of ROs Used");
List<string> activeRoids = BuildActiveROIDsForRoUsages12(RoidList, versionList);
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Updating RO Values");
int iCount = 0;
if (activeRoids.Count > 0)
{
foreach (string chg in chgList)
{
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Updating RO Values");
if (activeRoids.Contains(chg.Substring(0, 12)))
{
ROFSTLookup.rochild roch = newLookup.GetRoChild(chg);
string desc = string.Format("Change in RO Values: Old value = {0}, New value = {1}", origLookup.GetRoChild(chg).value, roch.value);
// roid's are stored in database as 16 characters long in the RoUsages table. They may be stored as 12 characters in the ro.fst.
// string padroid = chg.Length <= 12 ? chg + "0000" : chg;
// B2022-088: Find Doc Ro button not working in Word Sections
string padroid = ROFSTLookup.FormatRoidKey(chg, true);
using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid, desc, "Changed", versionList))
{
foreach (RoUsageInfo roUsg in affected)
{
using (Content content = Content.Get(roUsg.MyContent.ContentID))
{
foreach (ItemInfo ii in roUsg.MyContent.ContentItems)
{
string val = newLookup.GetTranslatedRoValue(padroid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, ii.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues, false, ii);
content.FixContentText(roUsg, val, roch.type, origROFstInfo, true);
if (content.IsDirty)
{
// Update UserID and DTS when RO Value is updated.
content.UserID = Volian.Base.Library.VlnSettings.UserID;
content.DTS = DateTime.Now;
content.Save();
if (content.MyGrid != null)
{
GridInfo.Refresh(content.MyGrid);
}
}
}
}
}
}
}
}
}
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Getting List of ROs Used");
List<string> activeDRoids = BuildActiveROIDsForDRoUsages12(RoidList, versionList);
iCount = 0;
if (activeDRoids.Count > 0)
{
foreach (string chg in chgList)
{
// B2022-088: Find Doc Ro button not working in Word Sections
// string padroid = chg.Length <= 12 ? chg + "0000" : chg;
string padroid = ROFSTLookup.FormatRoidKey(chg, true);
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Updating RO Values");
if (activeDRoids.Contains(chg.Substring(0, 12)))
{
ROFSTLookup.rochild roch = newLookup.GetRoChild(chg);
string desc = string.Format("Change in RO Values: Old value = {0}, New value = {1}", origLookup.GetRoChild(chg).value, roch.value);
// roid's are stored in database as 16 characters long in the rousages table. They may be stored as 12 characters in the ro.fst.
using (DROUsageInfoList affected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid, desc, "Changed", versionList))
{
foreach (DROUsageInfo droUsg in affected)
{
Pdf.DeleteAll(droUsg.DocID);
}
}
}
}
}
iCount = 0;
string RoidDelList = GetRoidList(newROFst.RODbID, delList);
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Getting List of ROs Used");
activeRoids = BuildActiveROIDsForRoUsages12(RoidDelList, versionList);
if (activeRoids.Count > 0)
{
foreach (string del in delList)
{
// B2022-088: Find Doc Ro button not working in Word Sections
//string padroiddel = del.Length <= 12 ? del + "0000" : del;
string padroiddel = ROFSTLookup.FormatRoidKey(del, true);
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values");
string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoChild(del).value);
if (activeRoids.Contains(del.Substring(0, 12).ToUpper()))
{
using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroiddel, desc, "Deleted", versionList))
{
foreach (RoUsageInfo roUsg in affected)
{
using (Content content = Content.Get(roUsg.MyContent.ContentID))
{
content.FixContentText(roUsg, "?", 0, origROFstInfo);
if (content.IsDirty)
{
// Update UserID and DTS when RO Value is updated.
content.UserID = Volian.Base.Library.VlnSettings.UserID;
content.DTS = DateTime.Now;
content.Save();
}
}
}
}
}
}
}
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Getting List of ROs Used");
activeDRoids = BuildActiveROIDsForDRoUsages12(RoidDelList, versionList);
iCount = 0;
if (activeDRoids.Count > 0)
{
foreach (string del in delList)
{
// B2022-088: Find Doc Ro button not working in Word Sections
string padroiddel = ROFSTLookup.FormatRoidKey(del, true);
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values");
string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoChild(del).value);
// If there's an issue then maybe try getting the RoChild with the Padded roid instead
//string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoChild(padroiddel).value);
if (activeDRoids.Contains(del.Substring(0, 12).ToUpper()))
{
using (DROUsageInfoList Daffected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroiddel, desc, "Deleted", versionList))
{
foreach (DROUsageInfo droUsg in Daffected)
{
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values");
Pdf.DeleteAll(droUsg.DocID);
}
}
}
}
}
if (myProgressBarRefresh != null) myProgressBarRefresh(100, 100, "RO Values Updated");
}
private static DateTime ShowDuration(DateTime dtLast, string message) private static DateTime ShowDuration(DateTime dtLast, string message)
{ {
DateTime dtNext = DateTime.Now; DateTime dtNext = DateTime.Now;
@@ -293,41 +293,6 @@ namespace Volian.Controls.Library
// B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel // B2018-070 Use InDSOTabPanel to determine if the word panel should be activated - Activate MS Word Panel
_InDSOTabPanel = false; _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));
}
}
}
private void InitializeWordDocument(LBDocumentClass doc) private void InitializeWordDocument(LBDocumentClass doc)
{ {
+108 -24
View File
@@ -89,6 +89,9 @@ namespace Volian.Controls.Library
(_myRTB != null && (_myRTB.IsRoTable != lastRTBwasROTable || _myRTB.IsRoFigure != lastRTBwasROFigure)); } (_myRTB != null && (_myRTB.IsRoTable != lastRTBwasROTable || _myRTB.IsRoFigure != lastRTBwasROFigure)); }
} }
//This flag will be set when the docversion gets updated to let it know that the full tree needs a refresh
private bool changedDocVersion = false;
public ROFstInfo MyROFST public ROFstInfo MyROFST
{ {
get { return _myROFST; } get { return _myROFST; }
@@ -128,6 +131,12 @@ namespace Volian.Controls.Library
// B2022-135 Submitted for Admin Tools (Check RO Links tool) // B2022-135 Submitted for Admin Tools (Check RO Links tool)
if (_docVersionInfo == null || _docVersionInfo != value || _docVersionInfo.VersionID != value.VersionID) if (_docVersionInfo == null || _docVersionInfo != value || _docVersionInfo.VersionID != value.VersionID)
{ {
//Set flag for modified the docversion - should check for new ROs
if (_docVersionInfo?.VersionID != value?.VersionID)
{
changedDocVersion = true;
}
_docVersionInfo = value; _docVersionInfo = value;
if (_myRTB != null && (_docVersionInfo == null || _docVersionInfo.VersionID != _myRTB.MyDVI.VersionID)) if (_myRTB != null && (_docVersionInfo == null || _docVersionInfo.VersionID != _myRTB.MyDVI.VersionID))
@@ -201,6 +210,10 @@ namespace Volian.Controls.Library
// B2022-098: [JPR] ROs not being resolved in Word Sections // B2022-098: [JPR] ROs not being resolved in Word Sections
CurROLink = null; CurROLink = null;
_savCurROLink = null; _savCurROLink = null;
//Clear flag for modified the docversion (if should check for new ROs)
//clearing this flag here prevents it from checking twice
changedDocVersion = false;
} }
else if(_myRTB != value) else if(_myRTB != value)
{ {
@@ -251,6 +264,8 @@ namespace Volian.Controls.Library
set { _myUserInfo = value; } set { _myUserInfo = value; }
} }
public SessionInfo MySessionInfo { get; set; }
#endregion #endregion
#region Constructors #region Constructors
@@ -277,47 +292,61 @@ namespace Volian.Controls.Library
// Initialize the DisplayTags object // Initialize the DisplayTags object
displayTags = new DisplayTags(); displayTags = new DisplayTags();
_progressBar = null;
} }
#endregion #endregion
#region Event Handlers #region Event Handlers
#region (Progress Bar) #region (Progress Bar)
private void ProgressBar_Initialize(int max, string desc) private string InitialProgressBarMessage
{ {
if (_progressBar != null) set
{ {
_progressBar.Maximum = max; if (ProgressBar == null) return;
_progressBar.Text = desc; ProgressBar.Value = 0;
_progressBar.TextVisible = true; ProgressBar.Maximum = 100;
ProgressBar.Text = value;
Application.DoEvents();
} }
} }
private string FinalProgressBarMessage
private void ProgressBar_SetValue(int curval)
{ {
if (_progressBar != null) set
{ {
_progressBar.Value = curval; if (ProgressBar == null) return;
ProgressBar.Value = 100;
ProgressBar.Maximum = 100;
ProgressBar.Text = value;
Application.DoEvents();
} }
} }
private void DoProgressBarRefresh(int value, int max, string text)
private void ProgressBar_Clear()
{ {
if (_progressBar != null) if (ProgressBar == null) return;
{ ProgressBar.Maximum = max;
_progressBar.Text = string.Empty; ProgressBar.Value = value;
_progressBar.Maximum = 0; ProgressBar.Text = text;
_progressBar.Value = 0; Application.DoEvents();
}
} }
#endregion #endregion
#region (RTB) #region (RTB)
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// DisplayTab was changed
// need to clear the RTB selected
// without resetting the DVI or FST
// (those will be set manually / individually)
// this will prevent DVI and FST from changing to null then back again
// which will trigger reloads
public void ClearRTB()
{
_myRTB = null;
CurROLink = null;
_savCurROLink = null;
}
public void MyRTB_LinkChanged(object sender, StepPanelLinkEventArgs args) public void MyRTB_LinkChanged(object sender, StepPanelLinkEventArgs args)
{ {
CurROLink = null; CurROLink = null;
@@ -575,21 +604,65 @@ namespace Volian.Controls.Library
#endregion #endregion
#region (ROUpdate)
public List<string> roFstInfo_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args)
{
return VlnFlexGrid.ROTableUpdate(sender, args);
}
#endregion
#endregion #endregion
#region Public Methods #region Public Methods
public void LoadTree(bool forceReload = false) //C2026-008 Re-Architect RO.FST to include RO Modification date/time
// changed to return true if the RO FST got updated
public bool LoadTree(bool forceReload = false)
{ {
bool updatedROs = false;
if (MyROFST == null) if (MyROFST == null)
{ {
tvROFST.Nodes.Clear(); tvROFST.Nodes.Clear();
lbFound.Visible = false; lbFound.Visible = false;
return; return updatedROs;
} }
if (forceReload || RoTreeNeedsReloaded || tvROFST.Nodes == null || tvROFST.Nodes.Count <= 0) if (changedDocVersion || forceReload || RoTreeNeedsReloaded || tvROFST.Nodes == null || tvROFST.Nodes.Count <= 0)
{ {
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
//check if newer data - if there is, check if user wants to update data
int fstid = MyROFSTLookup.GetNewerFSTID();
int origfstid = MyROFSTLookup.RofstID;
if (_docVersionInfo != null && fstid != -1 && fstid != MyROFSTLookup.RofstID)
{
string message = string.Empty;
if (!MySessionInfo.CanCheckOutItem(_docVersionInfo.VersionID, CheckOutType.DocVersion, ref message))
{
FlexibleMessageBox.Show(this, message, "Working Draft Has Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
FinalProgressBarMessage = "Cannot check-out Working Draft";
}
else if (changedDocVersion && MessageBox.Show($"There exists a newer ROFST for this RO database that was loaded for other sets.\r\n\r\nDo you want to update this set's ROs to be consistent/use the latest loaded ROFST?", "Load ROs", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
InitialProgressBarMessage = "Updating ROs";
ROFstInfo roFstInfo = ROFstInfo.Get(fstid);
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFstInfo.RefreshROFstAtItemLevel(_docVersionInfo, DoProgressBarRefresh, null, roFstInfo, origfstid, fstid);
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
Application.DoEvents();
FinalProgressBarMessage = "ROs values updated";
MyROFST = roFstInfo;
updatedROs = true;
}
}
//B2025-008 //B2025-008
//in cases where a RO table is clicked on //in cases where a RO table is clicked on
//it will refresh the list //it will refresh the list
@@ -597,13 +670,15 @@ namespace Volian.Controls.Library
//so can go to it after the refresh //so can go to it after the refresh
string tmpROID = CurROLink?.ROID; string tmpROID = CurROLink?.ROID;
ROFSTLookup.rodbi[] dbs = MyROFSTLookup.GetRODatabaseList(true); ROFSTLookup.rodbi[] dbs = MyROFSTLookup?.GetRODatabaseList(true);
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures. // B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures.
// Added optional parameter "forceReload" and cleared out any existing nodes before reloading the tree // Added optional parameter "forceReload" and cleared out any existing nodes before reloading the tree
// the clear nodes code below has to be after the GetRODatabaseList database call because of races conditions in the code // the clear nodes code below has to be after the GetRODatabaseList database call because of races conditions in the code
tvROFST.Nodes.Clear(); tvROFST.Nodes.Clear();
ResetSearch(); //B2023-050 need to reset the SaveRO, and any RO info that was selected last time the tree was loaded ResetSearch(); //B2023-050 need to reset the SaveRO, and any RO info that was selected last time the tree was loaded
if (dbs != null)
{
for (int i = 0; i < dbs.Length; i++) for (int i = 0; i < dbs.Length; i++)
{ {
ROFSTLookup.rodbi db = dbs[i]; ROFSTLookup.rodbi db = dbs[i];
@@ -613,6 +688,7 @@ namespace Volian.Controls.Library
tvROFST.Nodes.Add(tn); tvROFST.Nodes.Add(tn);
AddDummyGroup(db, tn); AddDummyGroup(db, tn);
}
} }
_currRofstID = (IsRofstValid) ? (int?)_myROFST.ROFstID : null; _currRofstID = (IsRofstValid) ? (int?)_myROFST.ROFstID : null;
@@ -621,6 +697,12 @@ namespace Volian.Controls.Library
if(_docVersionInfo != null) _currDocVersionID = (int?)_docVersionInfo.VersionID; if(_docVersionInfo != null) _currDocVersionID = (int?)_docVersionInfo.VersionID;
if (tmpROID != null) ExpandNode(ROFSTLookup.FormatRoidKey(tmpROID, true)); if (tmpROID != null) ExpandNode(ROFSTLookup.FormatRoidKey(tmpROID, true));
//doc version would have updated (if needed) so reset flag
if (_progressBar?.Text != "Cannot check-out Working Draft")
{
changedDocVersion = false;
}
} }
var unitInfoNode = tvROFST.Nodes.Cast<TreeNode>().Where(x => x.Text == "Unit Information").FirstOrDefault(); var unitInfoNode = tvROFST.Nodes.Cast<TreeNode>().Where(x => x.Text == "Unit Information").FirstOrDefault();
@@ -672,6 +754,8 @@ namespace Volian.Controls.Library
} }
_curROTypeFilter = _roTypeFilter; _curROTypeFilter = _roTypeFilter;
return updatedROs;
} }
public void SetFindDocROButton(bool enabled) public void SetFindDocROButton(bool enabled)
@@ -3556,6 +3556,9 @@ namespace Volian.Controls.Library
MyEditItem.SaveContents(); MyEditItem.SaveContents();
using (DocVersion dv = DocVersion.Get(Mydvi.VersionID)) using (DocVersion dv = DocVersion.Get(Mydvi.VersionID))
{ {
//must get id before ROFST gets updated so know what to refresh later
int origfstid = roFstInfo.ROFstID;
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(Mydvi)); swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(Mydvi));
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo // B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
if (dv.ROfstLoadingFigures || dv.NewerRoFst) // B2017-125 see if loading figures was completed if (dv.ROfstLoadingFigures || dv.NewerRoFst) // B2017-125 see if loading figures was completed
@@ -3566,7 +3569,7 @@ namespace Volian.Controls.Library
} }
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, null); ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, null, roFstInfo, origfstid, roFstInfo.ROFstID);
swROUpdate.Close(); swROUpdate.Close();
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange; ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
+5 -1
View File
@@ -2465,6 +2465,10 @@ namespace Volian.Controls.Library
} }
Cursor = Cursors.WaitCursor; // C2023-002: move wait cursor after check out error Cursor = Cursors.WaitCursor; // C2023-002: move wait cursor after check out error
int ownerid = MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion); int ownerid = MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion);
//must get id before ROFST gets updated so know what to refresh later
int origfstid = roFstInfo.ROFstID;
using (DocVersion dv = DocVersion.Get(MyDVI.VersionID)) using (DocVersion dv = DocVersion.Get(MyDVI.VersionID))
{ {
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(MyDVI)); // RO changes placed in file in the Documents\VEPROMS folder swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(MyDVI)); // RO changes placed in file in the Documents\VEPROMS folder
@@ -2477,7 +2481,7 @@ namespace Volian.Controls.Library
} }
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, null); ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, null, roFstInfo, origfstid, roFstInfo.ROFstID);
swROUpdate.Close(); swROUpdate.Close();
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange; ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
@@ -960,6 +960,8 @@ namespace Volian.Print.Library
OnStatusChanged("After NewPage", PromsPrinterStatusType.NewPage); OnStatusChanged("After NewPage", PromsPrinterStatusType.NewPage);
if (myProcedure.Sections == null) if (myProcedure.Sections == null)
{ {
// 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); MessageBox.Show("This procedure has no content and will not be printed.", "Empty Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
ProfileTimer.Pop(profileDepth); ProfileTimer.Pop(profileDepth);
// B2024-062 Added check for EmptyProcedure. This is to prevent the Try Again message // B2024-062 Added check for EmptyProcedure. This is to prevent the Try Again message
+10 -5
View File
@@ -2,13 +2,14 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
using System.Drawing;
using System.Drawing.Printing;
using System.Drawing.Imaging;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Printing;
using System.IO; using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using VG; using VG;
//using XYPlots; //using XYPlots;
@@ -21,6 +22,10 @@ namespace XYPlots
public frmXYPlot(string title,string xyPlot) public frmXYPlot(string title,string xyPlot)
{ {
InitializeComponent(); InitializeComponent();
title = Regex.Replace(title, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); // C2022-003 RO Symbols. Convert unicode to character.
xyPlot = Regex.Replace(xyPlot, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); // C2022-003 RO Symbols. Convert unicode to character.
int pstart = xyPlot.IndexOf("<<G"); // find the starting Plot Command int pstart = xyPlot.IndexOf("<<G"); // find the starting Plot Command
xyPlot = xyPlot.Substring(pstart); // set val to the start of the plot commands xyPlot = xyPlot.Substring(pstart); // set val to the start of the plot commands
_XYPlot =xyPlot; _XYPlot =xyPlot;