Compare commits

...

58 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
jjenko 1ce1a45ca6 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. 2026-03-27 15:26:06 -04:00
plarsen b6da13a653 Development 2026-03-26 11:49:54 -04:00
jjenko 604b4d1751 Merge pull request 'C2026-031 - BNPP Cover Page Consolidation' (#748) from BNPP_CoverPage_Consolidation into Development
good for testing phase
2026-03-26 09:28:07 -04:00
mschill 874aaf2857 Merge branch 'Development' into BNPP_CoverPage_Consolidation 2026-03-26 09:15:23 -04:00
mschill 17a28def4e Update Copyright date 2026-03-26 09:17:13 -04:00
jjenko e72a1aa9e7 Merge pull request 'B2026-018_The_Disable_Initial_Line_check_box' (#747) from B2026-018_The_Disable_Initial_Line_check_box into Development
good for testing phase
2026-03-26 09:11:20 -04:00
mschill 7b96ef1b4c BNPP Cover Page Consolidation 2026-03-26 09:02:14 -04:00
plarsen ea048e6d82 B2026-018_The_Disable_Initial_Line_check_box 2026-03-26 07:55:27 -04:00
plarsen 109abfb4ad Merge branch 'Development' into B2026-018_The_Disable_Initial_Line_check_box 2026-03-26 07:53:21 -04:00
plarsen 3f662ab19d B2026-018_The_Disable_Initial_Line_check_box 2026-03-25 22:55:52 -04:00
jjenko b0de38909a Merge pull request 'B2026-023-Adding-RO-Editor-symbols-to-RO-X_Y_plots' (#746) from B2026-023-Adding-RO-Editor-symbols-to-RO-X_Y_plots into Development
good for testing phase
2026-03-25 13:26:02 -04:00
plarsen 267de44103 Merge branch 'Development' into B2026-023-Adding-RO-Editor-symbols-to-RO-X_Y_plots 2026-03-25 11:54:12 -04:00
plarsen b7b0e55d94 B2026-023-Adding-RO-Editor-symbols-to-RO-X_Y_plots 2026-03-25 11:41:39 -04:00
plarsen c0d12f5721 B2026-023-Adding-RO-Editor-symbols-to-RO-X_Y_plots 2026-03-25 11:34:58 -04:00
mschill 27a945485f Merge pull request 'B2026-034 Fixed issue where import of procedure set failed when it was deleting the temporary folders that are created during the process, preventing the importing code to try and fix transitions and foldout information (link).' (#745) from B2026-034 into Development
Looks Good. Ready for QA.
2026-03-25 06:04:23 -04:00
jjenko d76c81a9d8 B2026-034 Fixed issue where import of procedure set failed when it was deleting the temporary folders that are created during the process, preventing the importing code to try and fix transitions and foldout information (link). 2026-03-24 16:27:22 -04:00
jjenko 143a3622dd Merge pull request 'C2026-007_B2026-027' (#744) from C2026-007_B2026-027 into Development
good for continued  testing
2026-03-24 08:56:31 -04:00
mschill 75992293c6 Merge branch 'Development' into C2026-007_B2026-027 2026-03-24 08:45:28 -04:00
mschill 0e004828b3 Merge branch 'C2026-007_B2026-027' of https://git.volian.com/Volian/SourceCode into C2026-007_B2026-027 2026-03-24 08:46:04 -04:00
mschill 714751f404 C2026-007 Admin Tool Generate Word Attachments 2026-03-24 08:45:55 -04:00
jjenko 27576e946e Merge pull request 'C2026-007 - Handle case for Step Progress when all switchboxes are turned off and then Regen Word Attachments is turned back on.' (#743) from C2026-007_B2026-027 into Development
good for testing
2026-03-23 08:13:48 -04:00
mschill e548dddcbd Merge branch 'Development' into C2026-007_B2026-027 2026-03-23 08:04:33 -04:00
mschill 8cbc8c497e C2026-007 - Handle case for Step Progress when all switchboxes are turned off and then Regen Word Attachments is turned back on. 2026-03-23 06:30:41 -04:00
jjenko c328140441 Merge pull request 'B2026-033 Tooltip for Generate Word Attachments' (#742) from B2026-033 into Development
good for testing
2026-03-20 15:37:05 -04:00
mschill a10798c983 B2026-033 Tooltip for Generate Word Attachments 2026-03-20 15:30:51 -04:00
jjenko 06909e260f Merge pull request 'B2026-030 GoTo sometimes requires being pressed twice for ROs' (#741) from B2026-030 into Development
good for testing
2026-03-18 14:47:28 -04:00
mschill 5eca8a5150 B2026-030 GoTo sometimes requires being pressed twice for ROs 2026-03-18 14:44:45 -04:00
jjenko 88a13f9864 Merge pull request 'C2026-028 Update Tooltip for “Set All at Level” in Applicability.' (#740) from C2026-028 into Development
good for testing
2026-03-18 08:21:01 -04:00
mschill e03ae6195a C2026-028 Update Tooltip for “Set All at Level” in Applicability. 2026-03-18 07:53:17 -04:00
jjenko c3cacaf407 Merge pull request 'B2026-022-Adding-RO-Editor-symbols-to-RO-Tables' (#738) from B2026-022-Adding-RO-Editor-symbols-to-RO-Tables into Development
good for testing
2026-03-17 16:09:54 -04:00
plarsen 4b479b3ceb B2026-022-Adding-RO-Editor-symbols-to-RO-Tables 2026-03-17 15:30:35 -04:00
jjenko c78cb805fb Merge pull request 'C2026-030 corrected the Alarm format cover page' (#739) from C2026-030_BNPP_CoverAdjustments into Development
format only change. good for tesing
2026-03-17 11:25:24 -04:00
plarsen fd59b9d5f0 Merge branch 'Development' into B2026-022-Adding-RO-Editor-symbols-to-RO-Tables 2026-03-17 08:39:28 -04:00
jjenko 0e71c9f5f5 Merge pull request 'C2026-007 Upgrade - Generate Missing Word Attachments/B2026-027 Update Refresh Tables For Search Tooltip' (#737) from C2026-007_B2026-027 into Development
good for testing phase
2026-03-16 14:55:39 -04:00
mschill bc3c14589e C2026-007 Upgrade - Generate Missing Word Attachments/B2026-027 Update Refresh Tables For Search Tooltip 2026-03-16 14:45:04 -04:00
jjenko 4331f49f6f Merge pull request 'C2026-030 Barakah asked that the white space between the procedure number and procedure title be reduced when the KEPCO number is not printed' (#736) from C2026-030_BNPP_CoverAdjustments into Development
Format only changes -ready for testing
2026-03-16 14:33:07 -04:00
plarsen ed615dbb31 B2026-022-Adding-RO-Editor-symbols-to-RO-Tables 2026-03-16 13:30:36 -04:00
plarsen e9ad57f588 B2026-022-Adding-RO-Editor-symbols-to-RO-Tables 2026-03-16 12:44:04 -04:00
plarsen 7636fe7686 B2026-022-Adding-RO-Editor-symbols-to-RO-Tables 2026-03-11 20:26:01 -04:00
plarsen 7b649c4a62 B2026-018_The_Disable_Initial_Line_check_box 2026-03-10 08:24:28 -04:00
34 changed files with 2386 additions and 1711 deletions
+118 -40
View File
@@ -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)
/// <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.
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;
}
/// <summary>
/// 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
/// <param name="list"></param>
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);
}
/// <summary>
/// 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)
+1 -253
View File
@@ -422,150 +422,6 @@ namespace LBWordLibrary
return true;
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>
/// Checks to see if the document contains symbol characters
@@ -601,86 +457,7 @@ namespace LBWordLibrary
}
}
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>
/// Get the Range Text with error handling. myRange.Text sometimes will get a null reference exception.
/// </summary>
@@ -737,35 +514,6 @@ namespace LBWordLibrary
return myRange.Start - problem.Index;
}
/// <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
/// </summary>
/// <param name="str"></param>
@@ -418,7 +418,7 @@ namespace ROEditor
// NOTE: not doing the "Using System.Threading;" statement at beginning of file because it conflicts with the declaration of the "Timer" variable
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
// The data path the was passed in.
// The data path the was passed in.
DbConnectPath = PassedInPath;
// Setup the context menu
@@ -2844,7 +2844,8 @@ namespace ROEditor
}
else
{
newt=null;
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;
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
}
@@ -116,12 +116,12 @@ namespace ROEditor
public uint thisoff;
public string title;
public FstTmpSTRC(ushort type, uint offset, string tl)
public FstTmpSTRC(ushort type, uint offset, string tl)
{
thistype = type;
thisoff = offset;
title = tl;
}
}
void WriteString(BinaryWriter bw, string str)
{
@@ -150,7 +150,7 @@ namespace ROEditor
bw.Write(thisoff);
bw.Write(thistype);
WriteString(bw,title);
}
}
}
// The Sorted Array was not sorting via the ASCII value of each character in a given string.
@@ -565,8 +565,8 @@ namespace ROEditor
string RecIdStr = elem.GetAttribute("RecID");
curRecID = System.Convert.ToUInt32(RecIdStr,16);
// Get the current node's parent id
string ParIdStr = elem.GetAttribute("ParentID");
// Get the current node's parent id
string ParIdStr = elem.GetAttribute("ParentID");
elemParentID = Convert.ToUInt32(ParIdStr,16);
string HasKids = elem.GetAttribute("HasChild");
@@ -771,8 +771,8 @@ namespace ROEditor
private ushort SaveROToFST(XmlNode RONode,ArrayList InUseList,string RtnValTmplate, string AccPageIDTplate)
{
ushort RtnVal;
uint startFST = (uint)fhFST.BaseStream.Position;
uint RORecID;
uint startFST = (uint)fhFST.BaseStream.Position;
uint RORecID;
uint ParID;
byte nullbyte=0;
@@ -844,8 +844,12 @@ namespace ROEditor
AccPageID = " ";
WriteString(AccPageID);
// Save the ID and offset entry for the current ID
IdsAndOffsets.Add(RORecID,startFST);
//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
IdsAndOffsets.Add(RORecID, startFST);
// Save the RecID and Accessory Page id
IdsAndAccPgIds[AccPageID] = RORecID;
@@ -322,9 +322,9 @@ namespace RODBInterface
get { return _PCChildList; }
set { _PCChildList = value; }
}
#endregion
#region abstracts // need these for each method that must be defined for each database type
public abstract string RODB_GetNextGroupTable();
#endregion
#region abstracts // need these for each method that must be defined for each database type
public abstract string RODB_GetNextGroupTable();
public abstract string RODB_GetNextRecId(string table);
public abstract bool RODB_GetRootGroups(VlnXmlElement root);
public abstract bool RODB_DeleteGroup(XmlNode group, string tbname, string toprecid);
@@ -355,9 +355,10 @@ namespace RODBInterface
public abstract string RODB_GetDBServerForAbout();
public abstract string RODB_HasBeenConverted();
public abstract bool RODB_WriteSqlConnectToAccess(string newConectStr);
#endregion
public abstract string RODB_GetModDateTime(string Recid, string table);
#endregion
public RODB()
public RODB()
{
}
@@ -2382,9 +2383,9 @@ namespace RODBInterface
RecID = DBE.GetString(0);
MyRecID = RecID;
Info = DBE.GetString(1);
// it's defined in the local table if the first character is "<" which starts
// the schema definition string.
if ("<" == Info.Substring(0, 1))
// it's defined in the local table if the first character is "<" which starts
// the schema definition string.
if ("<" == Info.Substring(0, 1))
{
name = ParseEleName(Info);
if (name != null)
@@ -2425,7 +2426,7 @@ namespace RODBInterface
return retlist;
}
public override string RODB_GetSchemaPiece(string Recid, string table)
public override string RODB_GetSchemaPiece(string Recid, string table)
{
string strGetSchemaPiece;
string Info;
@@ -2659,6 +2660,7 @@ namespace RODBInterface
}
StatMsgWindow.StatusMessage = echild.GetAttribute("MenuTitle");
StringBuilder tinfo2Tmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly.
str = "UPDATE " + echild.GetAttribute("Table") + " SET Info = '" + tinfo2 + "'";
char[] chrAry = tinfo2.ToCharArray();
foreach (int chr in chrAry)
{
@@ -3081,7 +3083,28 @@ namespace RODBInterface
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();
}
}
}
}
}
@@ -1803,9 +1803,9 @@ namespace RODBInterface
RecID = reader.GetString(0);
MyRecID = RecID;
Info = reader.GetString(1);
// it's defined in the local table if the first character is "<" which starts
// the schema definition string.
if ("<" == Info.Substring(0, 1))
// it's defined in the local table if the first character is "<" which starts
// the schema definition string.
if ("<" == Info.Substring(0, 1))
{
name = ParseEleName(Info);
if (name != null)
@@ -1859,9 +1859,9 @@ namespace RODBInterface
RecID = reader.GetString(0);
MyRecID = RecID;
Info = reader.GetString(1);
// it's defined in the local table if the first character is "<" which starts
// the schema definition string.
if ("<" == Info.Substring(0, 1))
// it's defined in the local table if the first character is "<" which starts
// the schema definition string.
if ("<" == Info.Substring(0, 1))
{
name = ParseEleName(Info);
if (name != null)
@@ -2653,8 +2653,36 @@ namespace RODBInterface
}
return GrpCnt;
}
#endregion
public static bool TestConnect(string constring)
//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
public static bool TestConnect(string constring)
{
bool success = false;
using (SqlConnection connection = new SqlConnection(constring))
@@ -0,0 +1,147 @@
/*****************************************************************************
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
Copyright 2026 - Volian Enterprises, Inc. All rights reserved.
*****************************************************************************/
-- =============================================
-- Author: Matthew Schill
-- Create date: 03/20/2026
-- Description: Script to consolidate Cover Pages for Barakah
-- by Converting multi-unit procedures with Cover Pages
-- to use 1 Library Document Cover Page
-- =============================================
select Contents.ContentID
, Contenttext = Contents.Text
, Items.ItemID
, tblDocuments.DocID
, ParentContentID
, ParentItemID
, LibTitle = ISNULL(LibTitle,'')
, numLibCP
, numCP
,BaseFlag = 0
INTO #tmpUpdate
from Contents
inner join Entries on Contents.ContentID = Entries.ContentID
inner join tblDocuments on tblDocuments.DocID = Entries.DocID
inner join Items on Items.ContentID = Contents.ContentID
outer apply
(select ParentContentID=ContentID, ParentItemID = PItm.ItemID
FROM dbo.vefn_ParentItems(Items.ItemID) PItm
where PItm.ItemID <> Items.ItemID
) parent
outer apply
(select numLibCP = Count(*)
FROM dbo.vefn_ChildItems(ParentItemID) PItm
INNER JOIN Contents on Contents.ContentID = PItm.ContentID
INNER JOIN Entries on Contents.ContentID = Entries.ContentID
INNER JOIN tblDocuments on tblDocuments.DocID = Entries.DocID
where PItm.ItemID <> ParentItemID
AND Contents.text like 'Cover Page%' and ISNULL(tblDocuments.LibTitle,'') <> ''
) childWithLibTitle
outer apply
(select numCP = Count(*)
FROM dbo.vefn_ChildItems(ParentItemID) PItm
INNER JOIN Contents on Contents.ContentID = PItm.ContentID
where PItm.ItemID <> ParentItemID
AND Contents.text like 'Cover Page%'
) child
where Contents.text like 'Cover Page%'
order by ParentContentID asc, CASE WHEN ISNULL(LibTitle,'') <> '' THEN 1 ELSE 2 END asc, Contents.Text asc
UPDATE #tmpUpdate SET BaseFlag = 1 where LibTitle <> '' and numLibCP = 1
UPDATE #tmpUpdate SET BaseFlag = CASE WHEN tU.LibTitle <> '' THEN 1 ELSE 2 END FROM #tmpUpdate tU
where BaseFlag = 0 AND tU.ContentID IN
(
Select ContentID FROM
(SELECT sub.ContentID,
row_number() OVER(PARTITION BY sub.ParentContentID ORDER BY CASE WHEN ISNULL(sub.LibTitle,'') <> '' THEN 1 ELSE 2 END asc, sub.Contenttext asc) as pos
FROM #tmpUpdate sub
) x
WHERE x.pos = 1
)
declare @Cont TABLE
(
ContentID int,
ItemID int,
xConfig xml
)
insert into @Cont
SELECT tU.ContentID, ItemID, xConfig = CAST(tblContents.config AS xml) FROM
tblContents
INNER JOIN
#tmpUpdate tU ON tU.ContentID = tblContents.ContentID
where tU.BaseFlag > 0
Update @Cont Set xConfig.modify('delete //MasterSlave') From @Cont;
Update tblContents SET Text = 'Cover Page', Config = CAST(xConfig AS varchar(max)),
DTS = GETDATE(), UserID = 'CPVolian2026'
FROM
@Cont CNT INNER JOIN
tblContents ON CNT.ContentID = tblContents.ContentID;
--Update items PreviousIds
UPDATE tblItems Set PreviousID = IdToSwapTO.ItemID
FROM
tblItems
INNER JOIN
#tmpUpdate tU ON tblItems.PreviousID = tU.ItemID AND tU.BaseFlag = 0
INNER JOIN #tmpUpdate IdToSwapTO ON IdToSwapTO.ParentContentID = tU.ParentContentID AND IdToSwapTO.BaseFlag IN (1,2)
UPDATE tblItems Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026'
FROM
#tmpUpdate tU INNER JOIN
tblItems ON tU.ContentID = tblItems.ContentID
WHERE tU.BaseFlag = 0;
UPDATE tblContents Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026'
FROM
#tmpUpdate tU INNER JOIN
tblContents ON tU.ContentID = tblContents.ContentID
WHERE tU.BaseFlag = 0;
DELETE FROM
tblEntries
FROM
tblEntries
INNER JOIN
#tmpUpdate tU ON tU.ContentID = tblEntries.ContentID
WHERE tU.BaseFlag in (0,2);
INSERT INTO [dbo].[tblEntries]
([ContentID]
,[DocID]
,[DTS]
,[UserID]
,[DeleteStatus])
SELECT
DISTINCT tU.ContentID,
766, -- docid 766 "Cover Page 1"
GETDATE(),
'CPVolian2026',
0
FROM
#tmpUpdate tU
INNER JOIN
@Cont CNT ON tU.ContentID = CNT.ContentID
WHERE tU.BaseFlag = 2;
drop table #tmpUpdate;
IF (@@Error = 0) SELECT '[Barakah Cover Page Consolidation] Succeeded'
ELSE SELECT '[Barakah Cover Page Consolidation] Error'
go
@@ -0,0 +1,263 @@
-- =============================================
-- Author: Matthew Schill
-- Create date: 03/20/2026
-- Description: Script to consolidate Cover Pages for Barakah
-- by Converting multi-unit procedures with Cover Pages
-- to use 1 Library Document Cover Page
-- =============================================
----@isTest = 0 will change data
----@isTest = 1 for internal testing (no data will be changed)
DECLARE @isTest bit = 1;
----Per Cover Page, pull how many cover pages
----Each Cover Page's procedure has
----and how many of those are library documents
select Contents.ContentID
, Contenttext = Contents.Text
, Items.ItemID
, tblDocuments.DocID
, ParentContentID
, ParentItemID
, LibTitle = ISNULL(LibTitle,'')
, numLibCP
, numCP
,BaseFlag = 0
INTO #tmpUpdate
from Contents
inner join Entries on Contents.ContentID = Entries.ContentID
inner join tblDocuments on tblDocuments.DocID = Entries.DocID
inner join Items on Items.ContentID = Contents.ContentID
outer apply
(select ParentContentID=ContentID, ParentItemID = PItm.ItemID
FROM dbo.vefn_ParentItems(Items.ItemID) PItm
where PItm.ItemID <> Items.ItemID
) parent
outer apply
(select numLibCP = Count(*)
FROM dbo.vefn_ChildItems(ParentItemID) PItm
INNER JOIN Contents on Contents.ContentID = PItm.ContentID
INNER JOIN Entries on Contents.ContentID = Entries.ContentID
INNER JOIN tblDocuments on tblDocuments.DocID = Entries.DocID
where PItm.ItemID <> ParentItemID
AND Contents.text like 'Cover Page%' and ISNULL(tblDocuments.LibTitle,'') <> ''
) childWithLibTitle
outer apply
(select numCP = Count(*)
FROM dbo.vefn_ChildItems(ParentItemID) PItm
INNER JOIN Contents on Contents.ContentID = PItm.ContentID
where PItm.ItemID <> ParentItemID
AND Contents.text like 'Cover Page%'
) child
where Contents.text like 'Cover Page%'
order by ParentContentID asc, CASE WHEN ISNULL(LibTitle,'') <> '' THEN 1 ELSE 2 END asc, Contents.Text asc
--BaseFlag
-- 0 = a Cover Page that will be deleted
-- 1 = is base item (Cover Page will get renamed and applicability set to all)
-- 2 = would be base item but not linked to Lib document (Cover Page will get renamed and applicability set to all + will need linked to library doc)
---- If only 1 Library Doc CP for the CP's procedure and this is it, then mark this CP as the one we will keep
UPDATE #tmpUpdate SET BaseFlag = 1 where LibTitle <> '' and numLibCP = 1
---- If multiple Library Document CPs, pick the first one as the one we will keep (BaseFlag = 1)
---- If no Library Document CPs, pick the first one as the one we will repurpose (BaseFlag = 2)
UPDATE #tmpUpdate SET BaseFlag = CASE WHEN tU.LibTitle <> '' THEN 1 ELSE 2 END FROM #tmpUpdate tU
where BaseFlag = 0 AND tU.ContentID IN
(
Select ContentID FROM
(SELECT sub.ContentID,
row_number() OVER(PARTITION BY sub.ParentContentID ORDER BY CASE WHEN ISNULL(sub.LibTitle,'') <> '' THEN 1 ELSE 2 END asc, sub.Contenttext asc) as pos
FROM #tmpUpdate sub
) x
WHERE x.pos = 1
)
----BEGIN TESTS--
if(@isTest = 1)
BEGIN
select Count(*), 'Should be Zero - not exactly one BaseFlag set to non 0 for each Parent Item' FROM #tmpUpdate TU
OUTER APPLY
(select numBaseFlagSet = SUM(CASE WHEN sub.BaseFlag > 0 THEN 1 ELSE 0 END)
FROM #tmpUpdate sub
where sub.ParentContentID = TU.ParentContentID
) sub
where numBaseFlagSet <> 1
select Count(*), 'Should be Zero - 0 Lib Docs, BaseFlag is 1' FROM #tmpUpdate TU
where numLibCP = 0 and BaseFlag = 1
select Count(*), 'Should be Zero - at least 1 Lib Docs, BaseFlag is 2' FROM #tmpUpdate TU
where numLibCP > 0 and BaseFlag = 2
select Count(*), 'Should be Zero - 1 Lib Docs, BaseFlag not 1 for that Lib doc' FROM #tmpUpdate TU
where numLibCP = 1 and LibTitle <> '' and BaseFlag <> 1
select Count(*), 'Should be Zero - 1 Lib Docs, BaseFlag not 0 for ones without Lib Doc' FROM #tmpUpdate TU
where numLibCP = 1 and LibTitle = '' and BaseFlag <> 0
select Count(*), 'Should be Zero - 1 CP, no Lib Docs, BaseFlag not 2' FROM #tmpUpdate TU
where numLibCP = 0 and numCP = 1 and BaseFlag <> 2
select Count(*), 'Should be Zero - more than 1 Lib Docs, BaseFlag is 1' FROM #tmpUpdate TU
where numLibCP = 0 and BaseFlag = 1
select Count(*), 'Should be Zero - not exactly one BaseFlag set to non 0 for each Parent Item' FROM #tmpUpdate TU
OUTER APPLY
(select numBaseFlagSet = SUM(CASE WHEN sub.BaseFlag > 0 THEN 1 ELSE 0 END)
FROM #tmpUpdate sub
where sub.ParentContentID = TU.ParentContentID
) sub
where numBaseFlagSet <> 1
select Count(*), 'Should be Zero - 0 Lib Docs, BaseFlag is 1' FROM #tmpUpdate TU
where numLibCP = 0
and BaseFlag = 1
--all Parents should have exactly 1 Baseflag=1 or BaseFlage = 2
select 'Should be No Records where not a BaseFlag 1 or 2'
select NumNotBaseFlag12 = Count(*)
FROM #tmpUpdate TU
Group by ParentContentID
HAVING SUM(CASE WHEN BaseFlag in (1,2) THEN 1 ELSE 0 END) <> 1
select 'Should be No Records where with both a BaseFlag 1 and 2'
select NumBothBaseFlag12 = Count(*)
FROM #tmpUpdate TU
Group by ParentContentID
HAVING SUM(BaseFlag) > 2
END
--END TESTS--
--BaseFlag
-- 0 = a Cover Page that will be deleted
-- 1 = is base item (Cover Page will get renamed and applicability set to all)
-- 2 = would be base item but not linked to Lib document (Cover Page will get renamed and applicability set to all + will need linked to library doc)
----Update config for Coverpage 1 to remove <MasterSlave Applicability="1" />
----from that config
----cover page 1s
declare @Cont TABLE
(
ContentID int,
ItemID int,
xConfig xml
)
insert into @Cont
SELECT tU.ContentID, ItemID, xConfig = CAST(tblContents.config AS xml) FROM
tblContents
INNER JOIN
#tmpUpdate tU ON tU.ContentID = tblContents.ContentID
where tU.BaseFlag > 0
if(@isTest = 1)
BEGIN
select WRD='Have Masterslave in xconfig', NumwithMasterSlave = Count(*) FROM @Cont CNT
INNER JOIN
tblContents ON CNT.ContentID = tblContents.ContentID
where CAST(xConfig AS varchar(max)) like '%MasterSlave%'
END
Update @Cont Set xConfig.modify('delete //MasterSlave') From @Cont;
if(@isTest = 1)
BEGIN
select WRD='None should have Masterslave Removed in xconfig', NumwithMasterSlave = Count(*) FROM @Cont CNT
INNER JOIN
tblContents ON CNT.ContentID = tblContents.ContentID
where CAST(xConfig AS varchar(max)) like '%MasterSlave%'
select 'Show Records and how the ids will be re-linked'
Select tblItems.ItemID, tblItems.ContentID, tblItems.PreviousID, tblContents.Text,
PreviousItemID = tU.ItemID, PreviousContentID = tU.ContentID, PreviousText = tUCont.Text,
RelinkToItemID = IdToSwapTO.ItemID, RelinkToContentID = IdToSwapTO.ContentID, RelinkToText = IdToSwapTOCont.Text
FROM
tblItems
INNER JOIN
tblContents on tblContents.ContentID = tblItems.ContentID
INNER JOIN
#tmpUpdate tU ON tblItems.PreviousID = tU.ItemID AND tU.BaseFlag = 0
INNER JOIN
tblContents tUCont on tUCont.ContentID = tU.ContentID
LEFT OUTER JOIN #tmpUpdate IdToSwapTO ON IdToSwapTO.ParentContentID = tU.ParentContentID AND IdToSwapTO.BaseFlag IN (1,2)
LEFT OUTER JOIN tblContents IdToSwapTOCont on IdToSwapTOCont.ContentID = IdToSwapTO.ContentID
END
ELSE
BEGIN
--Update Config for Contents and set Text = 'Cover Page'
Update tblContents SET Text = 'Cover Page', Config = CAST(xConfig AS varchar(max)),
DTS = GETDATE(), UserID = 'CPVolian2026'
FROM
@Cont CNT INNER JOIN
tblContents ON CNT.ContentID = tblContents.ContentID;
--Update items PreviousIds
UPDATE tblItems Set PreviousID = IdToSwapTO.ItemID
FROM
tblItems
INNER JOIN
#tmpUpdate tU ON tblItems.PreviousID = tU.ItemID AND tU.BaseFlag = 0
INNER JOIN #tmpUpdate IdToSwapTO ON IdToSwapTO.ParentContentID = tU.ParentContentID AND IdToSwapTO.BaseFlag IN (1,2)
--delete where BaseFlag = 0 ---Items,Content,Entries, --set DeleteStatus = 1
--these are ones that will be replaced by a library document
UPDATE tblItems Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026'
FROM
#tmpUpdate tU INNER JOIN
tblItems ON tU.ContentID = tblItems.ContentID
WHERE tU.BaseFlag = 0;
UPDATE tblContents Set DeleteStatus = 1, DTS = GETDATE(), UserID = 'CPVolian2026'
FROM
#tmpUpdate tU INNER JOIN
tblContents ON tU.ContentID = tblContents.ContentID
WHERE tU.BaseFlag = 0;
--delete entries where Baseflag = 2
--create new entries where Baseflag = 2
DELETE FROM
tblEntries
FROM
tblEntries
INNER JOIN
#tmpUpdate tU ON tU.ContentID = tblEntries.ContentID
WHERE tU.BaseFlag in (0,2);
INSERT INTO [dbo].[tblEntries]
([ContentID]
,[DocID]
,[DTS]
,[UserID]
,[DeleteStatus])
SELECT
DISTINCT tU.ContentID,
766, -- docid 766 "Cover Page 1"
GETDATE(),
'CPVolian2026',
0
FROM
#tmpUpdate tU
INNER JOIN
@Cont CNT ON tU.ContentID = CNT.ContentID
WHERE tU.BaseFlag = 2;
END;
drop table #tmpUpdate;
+203 -32
View File
@@ -13540,35 +13540,7 @@ GO
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteAllDocVersionPdfs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [deleteAllDocVersionPdfs];
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] ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[addFiguresByROFstIDandImageIDs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [addFiguresByROFstIDandImageIDs];
@@ -17169,6 +17141,7 @@ GO
[roid] [varchar](50) NOT NULL,
[appid] [varchar](max) NULL,
[value] [varchar](max) NULL,
[moddatetime] [datetime] NULL,
CONSTRAINT [PK_RofstChild] PRIMARY KEY CLUSTERED
(
[RofstChildID] ASC
@@ -17303,6 +17276,23 @@ GO
End -- Rofst Tables
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),
@appid VarChar(Max) = null,
@value VarChar(Max) = null,
@ModDateTime DateTime = null,
@missingDefaultValue VarChar(Max) = null
)
With Execute as Owner
@@ -19722,8 +19713,8 @@ GO
Set @missingDefaultValue = '[TBD]';
-- Create Rofst Child/Group Record --> [Roid = (12) Digits]
Insert Into RofstChild (RofstID, ID, ParentID, dbiID, [type], title, roid, appid, [value])
Values (@RofstID, @ID, @ParentID, @dbiID, @type, @title, @roid, @appid, REPLACE(REPLACE(@value, '&123;', '{'), '&125;', '}'));
Insert Into RofstChild (RofstID, ID, ParentID, dbiID, [type], title, roid, appid, moddatetime, [value])
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
@@ -24736,6 +24727,186 @@ GO
==========================================================================================================
*/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[GetMissingDocsByUnit]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [GetMissingDocsByUnit];
GO
-- =============================================
-- Author: Matthew Schill
-- Create date: 02/27/2026
-- Description: Get Missing Docs by Unit for Generating Pdf table
-- =============================================
CREATE PROCEDURE [dbo].[GetMissingDocsByUnit]
AS
BEGIN
select Docs.DocID, UnitID, SectionID = MIN(SectionID)
FROM
(SELECT DISTINCT [DocID]
FROM [tblDocuments]) Docs
INNER JOIN Entries on Docs.DocID = Entries.DocID
INNER JOIN Contents on Entries.ContentID = Contents.ContentID
inner join Items on Items.ContentID = Contents.ContentID
outer apply
(Select UnitID = ID FROM dbo.vefn_SplitInt([dbo].[ve_GetItemDerivedApplicability](Items.ItemID),',')) Unit
outer apply
(Select TOP 1 SectionID = ItemID FROM Contents SecC where SecC.ContentID = Contents.ContentID
AND (SecC.Type / 10000) = 1
AND dbo.vefn_GetVersionIDByItemID(ItemID) IS NOT NULL
) Section
left outer join Pdfs on Pdfs.DocID = Docs.DocID AND Pdfs.DebugStatus = CASE WHEN UNITID IS NULL THEN 0 ELSE UnitID * 10 END
WHERE Pdfs.DocID IS NULL
AND SectionID IS NOT NULL
Group by Docs.DocID, UnitID
order by Docs.DocID, UnitID
RETURN
END
IF (@@Error = 0) PRINT 'Procedure Creation: [GetMissingDocsByUnit] Succeeded'
ELSE PRINT 'Procedure Creation: [GetMissingDocsByUnit] Error on Creation'
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
/*
---------------------------------------------------------------------------
@@ -24770,8 +24941,8 @@ BEGIN TRY -- Try Block
DECLARE @RevDate varchar(255)
DECLARE @RevDescription varchar(255)
set @RevDate = '03/12/2026 11:00 AM'
set @RevDescription = 'Update to Purge Change History Tool'
set @RevDate = '04/21/2026 7:00 AM'
set @RevDescription = 'Store RO Modification date/time'
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
@@ -947,14 +947,16 @@ namespace VEPROMS
pi = AddProcedure(xd.DocumentElement, dvi, pi);
GC.Collect(); // need to cleanup memory after importing each procedure due to use of Regular Expressions in processing RO and Transition links
}
DirectoryInfo di = new DirectoryInfo(PEIPath);
DirectoryInfo[] dis = di.GetDirectories();
for (int d = 0; d < dis.Length; d++)
dis[d].Delete(true);
lblImportStatus.Text = "Updating Transitions";
AddTransitions();
FixFloatingFoldouts();
SaveTransitionAndItemContentIDs();
// B2026-034 remove the folders created from un-ziping the import set file - this was done prior to updating transitions
// so if there was an issue deleting these temporay folders and files, the actual importing will be completed
DirectoryInfo di = new DirectoryInfo(PEIPath);
DirectoryInfo[] dis = di.GetDirectories();
for (int d = 0; d < dis.Length; d++)
dis[d].Delete(true);
return true;
}
}
+46 -8
View File
@@ -113,6 +113,8 @@
this.lblAdmToolProgressType = new DevComponents.DotNetBar.LabelX();
this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem();
this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip();
this.swRegenWordAttmts = new DevComponents.DotNetBar.Controls.SwitchButton();
this.labelX1 = new DevComponents.DotNetBar.LabelX();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
@@ -902,6 +904,8 @@
//
// sideNavPanel2
//
this.sideNavPanel2.Controls.Add(this.swRegenWordAttmts);
this.sideNavPanel2.Controls.Add(this.labelX1);
this.sideNavPanel2.Controls.Add(this.swRefreshTblsForSrch);
this.sideNavPanel2.Controls.Add(this.lblRefreshTblForSrch);
this.sideNavPanel2.Controls.Add(this.warningBox4);
@@ -930,11 +934,11 @@
//
//
this.swRefreshTblsForSrch.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.swRefreshTblsForSrch.Location = new System.Drawing.Point(10, 153);
this.swRefreshTblsForSrch.Location = new System.Drawing.Point(10, 178);
this.swRefreshTblsForSrch.Name = "swRefreshTblsForSrch";
this.swRefreshTblsForSrch.Size = new System.Drawing.Size(91, 22);
this.swRefreshTblsForSrch.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.superTooltip1.SetSuperTooltip(this.swRefreshTblsForSrch, new DevComponents.DotNetBar.SuperTooltipInfo("Refresh Word Attachments", "", resources.GetString("swRefreshTblsForSrch.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 200)));
this.superTooltip1.SetSuperTooltip(this.swRefreshTblsForSrch, new DevComponents.DotNetBar.SuperTooltipInfo("Refesh Tables For Search", "", resources.GetString("swRefreshTblsForSrch.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 125)));
this.swRefreshTblsForSrch.SwitchClickTogglesValue = true;
this.swRefreshTblsForSrch.TabIndex = 32;
this.swRefreshTblsForSrch.Value = true;
@@ -949,10 +953,10 @@
//
this.lblRefreshTblForSrch.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.lblRefreshTblForSrch.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblRefreshTblForSrch.Location = new System.Drawing.Point(107, 153);
this.lblRefreshTblForSrch.Location = new System.Drawing.Point(107, 178);
this.lblRefreshTblForSrch.Name = "lblRefreshTblForSrch";
this.lblRefreshTblForSrch.Size = new System.Drawing.Size(186, 22);
this.superTooltip1.SetSuperTooltip(this.lblRefreshTblForSrch, new DevComponents.DotNetBar.SuperTooltipInfo("Refresh Word Attachments", "", resources.GetString("lblRefreshTblForSrch.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 200)));
this.superTooltip1.SetSuperTooltip(this.lblRefreshTblForSrch, new DevComponents.DotNetBar.SuperTooltipInfo("Refresh Tables For Search", "", resources.GetString("lblRefreshTblForSrch.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 125)));
this.lblRefreshTblForSrch.TabIndex = 31;
this.lblRefreshTblForSrch.Text = "Refresh Tables For Search";
//
@@ -961,7 +965,7 @@
this.warningBox4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(219)))), ((int)(((byte)(249)))));
this.warningBox4.CloseButtonVisible = false;
this.warningBox4.Image = ((System.Drawing.Image)(resources.GetObject("warningBox4.Image")));
this.warningBox4.Location = new System.Drawing.Point(12, 264);
this.warningBox4.Location = new System.Drawing.Point(12, 287);
this.warningBox4.Margin = new System.Windows.Forms.Padding(4);
this.warningBox4.Name = "warningBox4";
this.warningBox4.OptionsButtonVisible = false;
@@ -974,7 +978,7 @@
this.warningBox2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(219)))), ((int)(((byte)(249)))));
this.warningBox2.CloseButtonVisible = false;
this.warningBox2.Image = ((System.Drawing.Image)(resources.GetObject("warningBox2.Image")));
this.warningBox2.Location = new System.Drawing.Point(12, 302);
this.warningBox2.Location = new System.Drawing.Point(12, 325);
this.warningBox2.Margin = new System.Windows.Forms.Padding(4);
this.warningBox2.Name = "warningBox2";
this.warningBox2.OptionsButtonVisible = false;
@@ -1128,7 +1132,7 @@
// line2
//
this.line2.BackColor = System.Drawing.Color.Transparent;
this.line2.Location = new System.Drawing.Point(4, 237);
this.line2.Location = new System.Drawing.Point(4, 260);
this.line2.Name = "line2";
this.line2.Size = new System.Drawing.Size(281, 12);
this.line2.TabIndex = 20;
@@ -1140,7 +1144,7 @@
this.btnRunRepair.Checked = true;
this.btnRunRepair.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnRunRepair.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnRunRepair.Location = new System.Drawing.Point(5, 198);
this.btnRunRepair.Location = new System.Drawing.Point(5, 221);
this.btnRunRepair.Name = "btnRunRepair";
this.btnRunRepair.Size = new System.Drawing.Size(280, 23);
this.btnRunRepair.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@@ -1303,6 +1307,38 @@
this.superTooltip1.DefaultTooltipSettings = new DevComponents.DotNetBar.SuperTooltipInfo("", "", "", null, null, DevComponents.DotNetBar.eTooltipColor.Gray);
this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
//
// swRegenWordAttmts
//
//
//
//
this.swRegenWordAttmts.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.swRegenWordAttmts.Location = new System.Drawing.Point(10, 150);
this.swRegenWordAttmts.Name = "swRegenWordAttmts";
this.swRegenWordAttmts.Size = new System.Drawing.Size(91, 22);
this.swRegenWordAttmts.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.superTooltip1.SetSuperTooltip(this.swRegenWordAttmts, new DevComponents.DotNetBar.SuperTooltipInfo("Generate Word Attachments", "", resources.GetString("swRegenWordAttmts.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 250)));
this.swRegenWordAttmts.SwitchClickTogglesValue = true;
this.swRegenWordAttmts.TabIndex = 34;
this.swRegenWordAttmts.Value = true;
this.swRegenWordAttmts.ValueObject = "Y";
this.swRegenWordAttmts.ValueChanged += new System.EventHandler(this.swCk_ValueChanged);
//
// labelX1
//
this.labelX1.BackColor = System.Drawing.Color.Transparent;
//
//
//
this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelX1.Location = new System.Drawing.Point(107, 150);
this.labelX1.Name = "labelX1";
this.labelX1.Size = new System.Drawing.Size(186, 22);
this.superTooltip1.SetSuperTooltip(this.labelX1, new DevComponents.DotNetBar.SuperTooltipInfo("Generate Word Attachments", "", resources.GetString("labelX1.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(300, 250)));
this.labelX1.TabIndex = 33;
this.labelX1.Text = "Generate Missing Word Attachments";
//
// frmBatchRefresh
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -1430,6 +1466,8 @@
private DevComponents.DotNetBar.PanelEx itemPanel2;
private DevComponents.DotNetBar.PanelEx itemPanel3;
private DevComponents.DotNetBar.ButtonX btnROsNotUsed;
private DevComponents.DotNetBar.Controls.SwitchButton swRegenWordAttmts;
private DevComponents.DotNetBar.LabelX labelX1;
}
}
+126 -12
View File
@@ -62,6 +62,8 @@ namespace VEPROMS
swRmObsoleteROData.Enabled = false;
swRmOrphanDataRecs.Enabled = false;
swRefreshWordAttmts.Enabled = false;
swRegenWordAttmts.Enabled = false;
swRefreshTblsForSrch.Enabled = false;
swStandardHypenChars.Enabled = false;
//if not full admin, disable Purge Change History
@@ -648,11 +650,111 @@ namespace VEPROMS
this.Cursor = Cursors.Default;
}
// B2022-047 - refresh the Content/Text field for table, i.e. Grid, Data so that search will find text in the Grid
// NOTE that an out of memeory error occurs when having to process alot of tables. A config flag is used on the
// grid record to flag that this operation has been run. And a message is placed in the result window stating to
// rerun until all tables/text fields are completed.
private void RefreshTablesForSearch()
private int RegenCounter = 0;
private int RegenTotal = 0;
private const int TicksToupdate = 300000; //5 minutes(300 seconds).
// C2026-007 - Generate Missing PDFs
// regenerates the saved attachment PDFs from the database
// so that this is not needed the next time the procedures are printed. This also forces ROs to be refreshed in the attachments
private void RegenPDFs()
{
this.Cursor = Cursors.WaitCursor;
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Generating missing Word Attachments");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText("Gathering data for Word Attachments that need generated.");
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
//get data of missing Docs by Unit that will need regenerated
DataTable dt = Maintenance.GetMissingDocsByUnit();
RegenCounter = 0;
RegenTotal = dt.Rows.Count;
txtProcess.AppendText($"Word Attachments to be generated: {RegenTotal}");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText($"Note that this will provide updates approximately every {TicksToupdate/60000} minutes. Some attachments may take longer than others due to size/number of pages/number of ROs. If PROMS is in the middle of generating a large attachment, it may delay the update message until generation of that attachment completes (in that case taking more than 5 minutes between updates).");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
txtResults.AppendText($"{RegenTotal} Word Attachments to be generated.");
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
//generate as if not debug
int debugstatus = MSWordToPDF.DebugStatus;
MSWordToPDF.DebugStatus = 0;
MSWordToPDF.OverrideColor = Color.Transparent;
Timer timer1 = new Timer();
timer1.Tick += new EventHandler(UpdateRegenProgress);
timer1.Interval = TicksToupdate;
timer1.Start();
foreach (DataRow dr in dt.Rows)
{
//Do Generation
using (Section sect = Section.Get((int)dr["SectionID"]))
{
using (DocumentInfo docInfo = DocumentInfo.Get((int)dr["DocID"]))
{
if (!dr.IsNull("UnitID")) sect.MyItemInfo.MyDocVersion.DocVersionConfig.SelectedSlave = (int)dr["UnitID"];
MSWordToPDF.SetDocPdf(docInfo, sect.MyItemInfo);
}
}
//Increment - message every _ minutes
RegenCounter++;
}
//done with loop - stop timer and destroy it
timer1.Stop();
timer1.Dispose();
//Change DebugStatus Back to what it was
if (debugstatus == 1)
{
MSWordToPDF.DebugStatus = 1;
MSWordToPDF.OverrideColor = Color.Red;
}
else
{
MSWordToPDF.DebugStatus = 0;
MSWordToPDF.OverrideColor = Color.Transparent;
}
//end messaging
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText($"Word Attachments Generated: {RegenTotal}");
txtProcess.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText($"{RegenTotal} Word Attachments generated.");
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
txtProcess.AppendText($"Completed: {DateTime.Now:G}");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
this.Cursor = Cursors.Default;
}
//Outputs the Progress of Regenerating the PDFs every __ minutes
private void UpdateRegenProgress(Object myObject, EventArgs myEventArgs)
{
string progress_str = $"Generated {RegenCounter} of {RegenTotal} ({(decimal)RegenCounter / RegenTotal * 100M:F2}%): {DateTime.Now:G}";
txtProcess.AppendText(progress_str);
txtProcess.AppendText(Environment.NewLine);
txtResults.AppendText(progress_str);
txtResults.AppendText(Environment.NewLine);
}
// B2022-047 - refresh the Content/Text field for table, i.e. Grid, Data so that search will find text in the Grid
// NOTE that an out of memeory error occurs when having to process alot of tables. A config flag is used on the
// grid record to flag that this operation has been run. And a message is placed in the result window stating to
// rerun until all tables/text fields are completed.
private void RefreshTablesForSearch()
{
this.Cursor = Cursors.WaitCursor;
DateTime pStart = DateTime.Now;
@@ -934,8 +1036,11 @@ namespace VEPROMS
ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst;
string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst";
//if (!pathExists(rofstPath))
if (!File.Exists(rofstPath))
//must get id before ROFST gets updated so know what to refresh later
int origfstid = roFstInfo.ROFstID;
//if (!pathExists(rofstPath))
if (!File.Exists(rofstPath))
{
ProgressBar.ColorTable = eProgressBarItemColor.Error;
FinalProgressBarMessage = "No existing RO.FST";
@@ -962,8 +1067,8 @@ namespace VEPROMS
roFstInfo = dq.DocVersionAssociations[0].MyROFst;
}
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, txtProcess);
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, txtProcess, roFstInfo, origfstid, roFstInfo.ROFstID);
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
}
Cursor = Cursors.Default;
@@ -1305,7 +1410,8 @@ namespace VEPROMS
DevComponents.DotNetBar.StepItem siObsoleteROData = new DevComponents.DotNetBar.StepItem("siObsoleteROData", "Obsolete RO Data");
DevComponents.DotNetBar.StepItem siStandardHyphens = new DevComponents.DotNetBar.StepItem("siStandardHyphens", "Standardize Hyphens");
DevComponents.DotNetBar.StepItem siRefreshAttmts = new DevComponents.DotNetBar.StepItem("siRefreshAttmts", "Refresh Word Attachments");
DevComponents.DotNetBar.StepItem siRefreshTblsSrchTxt = new DevComponents.DotNetBar.StepItem("siRefreshTblsSrchTxt", "Refresh Tables For Search");
DevComponents.DotNetBar.StepItem siRegenAttmts = new DevComponents.DotNetBar.StepItem("siRegenAttmts", "Regenerate Word Attachments");
DevComponents.DotNetBar.StepItem siRefreshTblsSrchTxt = new DevComponents.DotNetBar.StepItem("siRefreshTblsSrchTxt", "Refresh Tables For Search");
// this will update/rebuild the progress bar in the bottom panel of Admin Tools
private void setupProgessSteps1()
{
@@ -1323,7 +1429,9 @@ namespace VEPROMS
progressSteps1.Items.Add(siStandardHyphens);
if (swRefreshWordAttmts.Value)
progressSteps1.Items.Add(siRefreshAttmts);
if (swRefreshTblsForSrch.Value)
if (swRegenWordAttmts.Value)
progressSteps1.Items.Add(siRegenAttmts);
if (swRefreshTblsForSrch.Value)
progressSteps1.Items.Add(siRefreshTblsSrchTxt);
splitContainer3.Panel2Collapsed = false;
progressSteps1.Visible = true;
@@ -1487,7 +1595,13 @@ namespace VEPROMS
DeletePDFs(); // refresh word attachments
StepProgress(prgStpIdx, 100);
}
if (swRefreshTblsForSrch.Value)
if (swRegenWordAttmts.Value)
{
StepProgress(++prgStpIdx, 50);
RegenPDFs(); // generate missing pdfs
StepProgress(prgStpIdx, 100);
}
if (swRefreshTblsForSrch.Value)
{
StepProgress(++prgStpIdx, 50);
RefreshTablesForSearch();
+102 -95
View File
@@ -117,108 +117,30 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnPurgeChange.Tooltip" xml:space="preserve">
<value>Purges all audit information and change history older than the above date.
It is recommended that you perform a database backup before performing this action.
Note after purging the information, this will automatically perform the Index
Maintenance function to realign indexes with the cut down audit data.
Only Full PROMS Administrator Users can perform this action.</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="warningBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F
k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk
/IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC
eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG
h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ
ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ
Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY
wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0
rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E
CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY
FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC
dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N
ud8AKwnMnBpmYFAAAAAASUVORK5CYII=
</value>
</data>
<data name="warningBox6.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F
k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk
/IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC
eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG
h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ
ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ
Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY
wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0
rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E
CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY
FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC
dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N
ud8AKwnMnBpmYFAAAAAASUVORK5CYII=
</value>
</data>
<data name="btnIndexMaint.Tooltip" xml:space="preserve">
<value>This will perform Index Maintenance to realign indexes to optimize performance.
This function will cause no change to data or records in PROMS.
It should however be performed when other users are not in PROMS, as it could
cause slowdown or errors for other users while it is running.</value>
</data>
<data name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing">
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</data>
<data name="swDeleteFolder.SuperTooltip" xml:space="preserve">
<value>This allows the user to remove folders and sub folders as well as their contents.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</metadata>
<data name="swRegenWordAttmts.SuperTooltip" xml:space="preserve">
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time.
This function will generate (and save) any missing saved attachment PDFs stored in the database (not the PDFs of the entire procedure that you had previous printed). This will cause printing to be faster when you print after this as the PDFs will be pre-genrated in those cases (and thus not require regeneration unless changes were made to the Word Sections or ROs after running this).
</value>
</data>
<data name="labelX13.SuperTooltip" xml:space="preserve">
<value>This allows the user to remove folders and sub folders as well as their contents.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
<data name="labelX1.SuperTooltip" xml:space="preserve">
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time.
This function will generate (and save) any missing saved attachment PDFs stored in the database (not the PDFs of the entire procedure that you had previous printed). This will cause printing to be faster when you print after this as the PDFs will be pre-genrated in those cases (and thus not require regeneration unless changes were made to the Word Sections or ROs after running this).
</value>
</data>
<data name="swDeleteAnnotations.SuperTooltip" xml:space="preserve">
<value>This function will allow the user to remove annotations from the selected working drafts.
Be sure a current backup of the database exists prior to running this function.
If more than one working draft is selected, it is recommended that this be performed during off hours.</value>
</data>
<data name="labelX14.SuperTooltip" xml:space="preserve">
<value>This function will allow the user to remove annotations from the selected working drafts.
Be sure a current backup of the database exists prior to running this function.
If more than one working draft is selected, it is recommended that this be performed during off hours.</value>
</data>
<data name="btnDeleteItems.SuperTooltip" xml:space="preserve">
<value>This will allow for the deletion of groups of annotations and allow for deleting entire folders within PROMS. Use the tree nodes to select which items to delete.
Click on the on/off switches to turn on/off each tool.
Note that only one of these tools can be run at a time.</value>
</data>
<data name="swRefreshTblsForSrch.SuperTooltip" xml:space="preserve">
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents.
This function will remove all of the saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed.
<value>To allow for a quicker search of the contents within a PROMS Step editor table, a text version of the table is stored separately. If the PROMS Search function is not finding something in a table, this tool will refresh the content of that separately stored table text. Another search should then be performed for the content that was not originally found.
</value>
</data>
<data name="lblRefreshTblForSrch.SuperTooltip" xml:space="preserve">
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents.
This function will remove all of the saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed.
<value>To allow for a quicker search of the contents within a PROMS Step editor table, a text version of the table is stored separately. If the PROMS Search function is not finding something in a table, this tool will refresh the content of that separately stored table text. Another search should then be performed for the content that was not originally found.
</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="warningBox4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F
@@ -261,7 +183,7 @@ RO paths, ROFST versions, and the contents of RO figures are stored in the datab
Be sure a current backup exists prior to running this function!!</value>
</data>
<data name="swRefreshWordAttmts.SuperTooltip" xml:space="preserve">
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents.
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents.
This function will remove all of the saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed.
</value>
@@ -280,9 +202,9 @@ RO paths, ROFST versions, and the contents of RO figures are stored in the datab
Be sure a current backup exists prior to running this function!!</value>
</data>
<data name="labelX5.SuperTooltip" xml:space="preserve">
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents.
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents.
This function will remove all of the saved attachment PDFS stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed.
This function will remove all of the saved attachment PDFs stored in the database (not the PDFs of the entire procedure that you had previous printed). This will force PROMS to regenerate (and save) the word attachment PDFs the next time the procedure is printed.
</value>
</data>
<data name="labelX9.SuperTooltip" xml:space="preserve">
@@ -302,6 +224,53 @@ Should an item become orphaned (disconnected) from the rest of the data, it will
Should an item become orphaned (disconnected) from the rest of the data, it will no longer be accessible. This tool removes any orphaned items from the database.
</value>
</data>
<data name="btnPurgeChange.Tooltip" xml:space="preserve">
<value>Purges all audit information and change history older than the above date.
It is recommended that you perform a database backup before performing this action.
Note after purging the information, this will automatically perform the Index
Maintenance function to realign indexes with the cut down audit data.
Only Full PROMS Administrator Users can perform this action.</value>
</data>
<data name="warningBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F
k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk
/IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC
eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG
h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ
ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ
Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY
wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0
rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E
CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY
FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC
dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N
ud8AKwnMnBpmYFAAAAAASUVORK5CYII=
</value>
</data>
<data name="warningBox6.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F
k11Ik1Ecxv9zouJ2E4TWnR8V5tAppJmYsLnNlaLTxAoiKIQiibpYSmEEmSSa0IVGISMUw7rpE+yiQiuk
/IhROssPyjanpL4udeq29z3nCdcH+Wb1g+fq/zzP+R8Oh+gvPK4kNWujp1IrPek8S5Hy+X9hbXSN9aVC
eq1FwEYN8vk/mWqiDPZwI+NOHbhLj8CdDaK7npLlvnWpO0AKqZV62YgO/GMquDMN0rAevkbqlHvXZdlG
h6Rn8eATu4GJncB0Fvh8HnwPYuGpJ4vcvwZbGYWJrcpPzGXG8ngGtsZFQJOggrS0B9J0MbwNIR9uHqRQ
ee4XPhuVSy814IIB/lk9QkIIanUomFgIzkux0qHB/CUqk+eCtB2jCLEl1M1mLcBSLthKHlQqJaKjw8FZ
Mbi/ENKXEizUKD/f2k9h8jz5mumk2K0F9xUAUgE4K0JUVDji4yLBvflgMyYwlxFL9zSYq6ITa8I3DlNY
wKZ0soVSgFkAXgwuFSEmJhJJiWqwCR3YSCbY2x0QB4zwnFc6W4p+22KxiY4EXiQF74kf6/L5vdi+TYV0
rRpsMB2sPxWsRwvpTTq87QmYOUNHg+HqQlL4ryscbK4UPGD5vu60CWw8G7evbkN7bSykXm0w/FMBew6E
CsXQFQMpaLKezP6OLeDL+8AFM5hLBzaciennKcFXUCgI7o7ENQWSfRcWmmPgPEW5tNJIj8QxM9hkDthY
FthAGlh/SvAPXC7fjOrjmyC+Sl5TsCpfdzYEK92llUbllDiaD3HEDPG9CaLDCGnI9IdEhwnioBHiOwMC
dj38fYbVglHy1FGJt57uL9ZS10IN9cxfJPvXCzTgqSKH5xwNzVXSkFBBDsFKA4KV7IKVegQrda2e7j5N
ud8AKwnMnBpmYFAAAAAASUVORK5CYII=
</value>
</data>
<data name="btnIndexMaint.Tooltip" xml:space="preserve">
<value>This will perform Index Maintenance to realign indexes to optimize performance.
This function will cause no change to data or records in PROMS.
It should however be performed when other users are not in PROMS, as it could
cause slowdown or errors for other users while it is running.</value>
</data>
<data name="swCheckROLinks.SuperTooltip" xml:space="preserve">
<value>This allows the user to check referenced object links in procedure step data for multiple working drafts in a batch mode.
@@ -388,8 +357,46 @@ If more than one procedure is selected, it is recommended that this be performed
ud8AKwnMnBpmYFAAAAAASUVORK5CYII=
</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.TrayHeight" type="System.Int32, mscorlib">
<value>25</value>
<data name="swDeleteFolder.SuperTooltip" xml:space="preserve">
<value>This allows the user to remove folders and sub folders as well as their contents.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</value>
</data>
<data name="labelX13.SuperTooltip" xml:space="preserve">
<value>This allows the user to remove folders and sub folders as well as their contents.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</value>
</data>
<data name="swDeleteAnnotations.SuperTooltip" xml:space="preserve">
<value>This function will allow the user to remove annotations from the selected working drafts.
Be sure a current backup of the database exists prior to running this function.
If more than one working draft is selected, it is recommended that this be performed during off hours.</value>
</data>
<data name="labelX14.SuperTooltip" xml:space="preserve">
<value>This function will allow the user to remove annotations from the selected working drafts.
Be sure a current backup of the database exists prior to running this function.
If more than one working draft is selected, it is recommended that this be performed during off hours.</value>
</data>
<data name="btnDeleteItems.SuperTooltip" xml:space="preserve">
<value>This will allow for the deletion of groups of annotations and allow for deleting entire folders within PROMS. Use the tree nodes to select which items to delete.
Click on the on/off switches to turn on/off each tool.
Note that only one of these tools can be run at a time.</value>
</data>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>25</value>
</metadata>
</root>
+1 -12
View File
@@ -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;
+56 -34
View File
@@ -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
if (!_WeAreExitingPROMS) displayRO.LoadTree(true);
}
}
@@ -2395,9 +2395,10 @@ namespace VEPROMS
tv.MySessionInfo = MySessionInfo;
tv.MyUserInfo = MyUserInfo;
StepTabRibbon.MySessionInfo = MySessionInfo;
displayRO.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 +4553,17 @@ namespace VEPROMS
SetCaption(tv.SelectedNode as VETreeNode);
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
//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)
{
displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
}
@@ -4562,9 +4572,24 @@ namespace VEPROMS
displayRO.MyROFST = null;
}
// 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)
displayRO.LoadTree(true);
//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-123: RO Tab Treeview not showing correct RO values when switching between procedures. (Added True for the forceLoad parameter)
//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;
@@ -4628,8 +4653,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 +4790,15 @@ namespace VEPROMS
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.ProgressBar = bottomProgBar;
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;
lblEditView.Text = args.MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? "Edit" : "View";
@@ -4797,7 +4826,7 @@ namespace VEPROMS
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.SetFindDocROButton(false);
displayRO.LoadTree();
if (!_WeAreExitingPROMS) displayRO.LoadTree();
//C2019-036 View Only mode work with Checked Out Procedures
//In View Only Mode - Step Properties should be disabled
@@ -4930,9 +4959,15 @@ namespace VEPROMS
displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo;
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.LoadTree();
}
// B2022-026 RO Memory reduction coding (Jakes Merge)
//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
@@ -5241,19 +5276,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)
{
@@ -1527,8 +1527,11 @@ namespace VEPROMS
Cursor = Cursors.WaitCursor;
// RO changes placed in file in the Documents\VEPROMS folder
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(_DocVersionConfig.MyDocVersion.MyDocVersionInfo));
//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
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(_DocVersionConfig.MyDocVersion.MyDocVersionInfo));
DocVersion dv = _DocVersionConfig.MyDocVersion;
// 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
@@ -1540,9 +1543,9 @@ namespace VEPROMS
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
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);
swROUpdate.Close();
@@ -97,7 +97,8 @@ namespace VEPROMS.CSLA.Library
public string appid;
public int ID;
public int ParentID;
public rochild[] children;
public DateTime? ModDateTime; //C2026-008 Re-Architect RO.FST to include RO Modification date/time
public rochild[] children;
};
[Serializable]
@@ -110,7 +111,8 @@ namespace VEPROMS.CSLA.Library
public string roid; // roid unique identifier
public string appid; // accessory page id - user specified unique id
public string value; // return value, can be multiple values
public rochild[] children;
public DateTime? ModDateTime; //C2026-008 Re-Architect RO.FST to include RO Modification date/time
public rochild[] children;
};
public class RoExtension
@@ -686,15 +688,19 @@ namespace VEPROMS.CSLA.Library
//return string.Format("{0,10:#####0.00}", TimeSpan.FromTicks(DateTime.Now.Ticks - dtStart.Ticks).TotalSeconds);
}
#endregion
//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
#region Private Methods
#endregion
#region (Database Calls)
#region Private Methods
private bool RofstDataExists(int rofstID)
#region (Database Calls)
private bool RofstDataExists(int rofstID)
{
int headerStatusID = RofstDataGetHeaderLoadStatus(rofstID);
@@ -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
{
@@ -917,7 +923,10 @@ namespace VEPROMS.CSLA.Library
if (!string.IsNullOrEmpty(this.RoMissingDefaultValue))
cmd.Parameters.Add(new SqlParameter("@missingDefaultValue", SqlDbType.VarChar)).Value = this.RoMissingDefaultValue;
cmd.ExecuteNonQuery();
if (dt != null)
cmd.Parameters.Add(new SqlParameter("@ModDateTime", SqlDbType.DateTime)).Value = dt;
cmd.ExecuteNonQuery();
}
}
}
@@ -1299,11 +1308,37 @@ namespace VEPROMS.CSLA.Library
}
}
#endregion
//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)";
#region (Core/Base logic for RO Values & UnitInfo RO Values)
cmd.Parameters.Add(new SqlParameter("@FSTid", SqlDbType.Int)).Value = rofstID;
private ROFSTLookup.rochild RofstDataGetChildByRoid(int rofstID, string roid, bool loadChildren = false, bool loadAllChildren = false)
return (int) cmd.ExecuteScalar();
}
}
}
catch (Exception ex)
{
throw new DbCslaException("RofstData.RofstGetLatestID", ex);
}
}
#endregion
#region (Core/Base logic for RO Values & UnitInfo RO Values)
private ROFSTLookup.rochild RofstDataGetChildByRoid(int rofstID, string roid, bool loadChildren = false, bool loadAllChildren = false)
{
try
{
@@ -1512,10 +1547,10 @@ namespace VEPROMS.CSLA.Library
int slen = StringLength(ab, myOffset + 6);
tmp.title = Encoding.Default.GetString(ab, myOffset + 6, slen);
myOffset += (7 + slen);
ROFSTLookup.rogrp tmpg = LoadGroup(ab, childOffset, tableID);
ROFSTLookup.rogrp tmpg = LoadGroup(ab, childOffset, tableID);
tmp.ID = tmpg.ID;
tmp.ParentID = tmpg.ParentID;
@@ -1523,8 +1558,12 @@ namespace VEPROMS.CSLA.Library
tmp.appid = tmpg.appid;
tmp.roid = tableID.ToString("X4") + tmp.ID.ToString("X8");
tmp.children = tmpg.children;
if (tmpg.ModDateTime != null)
{
tmp.ModDateTime = tmpg.ModDateTime;
}
int j;
int j;
for (j = i - 1; j >= 0 && tmp.ID < myGrp.children[j].ID; j--)
{
@@ -1542,7 +1581,13 @@ namespace VEPROMS.CSLA.Library
int slen2 = StringLength(ab, offset + 13 + slen);
myGrp.appid = Encoding.Default.GetString(ab, offset + 13 + slen, slen2);
_dbRoCnt++;
//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++;
}
return myGrp;
@@ -1655,7 +1700,7 @@ namespace VEPROMS.CSLA.Library
private void LoadChild(int rofstID, int dbiID, ROFSTLookup.rochild 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
if (!string.IsNullOrEmpty(child.value)) _curRoCnt++;
@@ -1003,40 +1003,34 @@ namespace VEPROMS.CSLA.Library
if (pdfTmp == null) return false;
FileInfo pdfFile = new FileInfo(pdfTmp);
FileStream fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
Byte[] buf = new byte[pdfFile.Length];
fs.Read(buf, 0, buf.Length);
fs.Close();
Byte[] buf = new byte[pdfFile.Length];
// B2023-022 & B2023-023 commented out the deletion of the temporary Word section PDF file
// These files are deleted when the procedure pdf file is closed after being generated.
// PROMS was crashing because it could not find these temporary files to delete.
//try
//{
// pdfFile.Delete();
//}
//catch { }
using (Document doc = docInfo.Get())
using (FileStream fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave;
if (sc != null && sc.Section_WordMargin == "Y")
{
using (Pdf myPdf = Pdf.MakePdf(doc, ss * 10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)sect.MSWordPageCount, buf)) {; }
}
else
{
using (Pdf myPdf1 = Pdf.MakePdf(doc, ss * 10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)sect.MSWordPageCount, buf)) {; }
}
doc.UpdateDRoUsages(roids);
doc.Save();
fs.Read(buf, 0, buf.Length);
fs.Close();
}
using (Document doc = docInfo.Get())
{
DocStyle myDocStyle = sect.ActiveSection.MyDocStyle;
SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig;
int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave;
if (sc != null && sc.Section_WordMargin == "Y")
{
using (Pdf myPdf = Pdf.MakePdf(doc, ss * 10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)sect.MSWordPageCount, buf)) {; }
}
else
{
using (Pdf myPdf1 = Pdf.MakePdf(doc, ss * 10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength,
(int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)sect.MSWordPageCount, buf)) {; }
}
doc.UpdateDRoUsages(roids);
doc.Save();
}
docInfo.RefreshConfig();
return true;
@@ -1482,12 +1476,22 @@ namespace VEPROMS.CSLA.Library
}
catch { }
if (CloseWordWhenDone)
try
{
if (CloseWordWhenDone)
{
CloseAppAfterWait();
}
}
catch (Exception ex)
{
CloseAppAfterWait();
}
System.Windows.Forms.Application.DoEvents();
_MyLog.Error("Failed to close Microsoft Word. Collecting reclaimable memory.", ex);
GC.Collect();
_MyLog.Warn("Finished collecting reclaimable memory.");
}
if (statusChange != null) statusChange(VolianStatusType.Complete, 0, string.Empty);
if (statusChange != null) statusChange(VolianStatusType.Complete, 0, string.Empty);
if (Volian.Base.Library.BaselineMetaFile.IsOpen && Volian.Base.Library.BaselineMetaFile.IncludeWordSecText) Volian.Base.Library.BaselineMetaFile.WriteLine("++EndTxt++");
// [jpr 2022.07.26] - For memory optimization
+93 -29
View File
@@ -1093,8 +1093,17 @@ namespace VEPROMS.CSLA.Library
}
}
}
// B2022-026 RO Memory Reduction code - pass in ROFstInfo
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, ROFstInfo origROFst)
//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
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, ROFstInfo origROFst)
{
if (itemInfo.MyContent.ContentPartCount > 0)
{
@@ -1219,31 +1228,47 @@ namespace VEPROMS.CSLA.Library
return true;
}
#region Debug Code
//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>();
//private static void ShowDifference(string oldText, string newText)
//{
// string nt = newText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
// string ot = oldText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
// ShowText("OldText", ot);
// ShowText("NewText", nt);
//}
//private static void ShowText(string title, string newText)
//{
// StringBuilder sb = new StringBuilder();
// foreach (char c in newText)
// {
// if(c<' ' || c> '\x7F')
// sb.Append(string.Format("\\x{0:X2}",((int) c)));
// else
// sb.Append(c);
// }
// Console.WriteLine("{0}='{1}'",title,sb.ToString());
//}
foreach (DataRow r in Data_GetItemsWithChangedROs(docversionid, origfstid, newfstid).Rows)
{
using (ItemInfo itm = Get((int)r["ItemID"]))
{
lst.Add(itm);
}
}
#endregion // debug
return lst;
}
internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
#region Debug Code
//private static void ShowDifference(string oldText, string newText)
//{
// string nt = newText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
// string ot = oldText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
// ShowText("OldText", ot);
// ShowText("NewText", nt);
//}
//private static void ShowText(string title, string newText)
//{
// StringBuilder sb = new StringBuilder();
// foreach (char c in newText)
// {
// if(c<' ' || c> '\x7F')
// sb.Append(string.Format("\\x{0:X2}",((int) c)));
// else
// sb.Append(c);
// }
// Console.WriteLine("{0}='{1}'",title,sb.ToString());
//}
#endregion // debug
internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
{
if (itemInfo.MyContent.ContentPartCount > 0)
{
@@ -1890,10 +1915,44 @@ namespace VEPROMS.CSLA.Library
foreach (ItemInfo itemInfo in partInfo.MyItems)
itemInfo.SpinThroughChildren();
}
#endregion
#region LoadAtOnce
// Method to Get Item and children
public static ItemInfo GetItemAndChildren(int? itemID, int? parentID)
//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
#region LoadAtOnce
// Method to Get Item and children
public static ItemInfo GetItemAndChildren(int? itemID, int? parentID)
{
try
{
@@ -6215,8 +6274,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()))
+40 -50
View File
@@ -61,57 +61,47 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Pdf.DataPortal_Delete", ex);
}
}
// used to remove word section PDFs to force ROs to be updated when printed or saved
public static void DeleteAllDocVersion(int versionID)
{
if (!CanDeleteObject())
throw new System.Security.SecurityException("User not authorized to remove a Pdf");
try
{
DataPortal.Delete(new VersionIDCriteria(versionID));
}
catch (Exception ex)
{
throw new DbCslaException("Error on Pdf.DeleteAllDocVersion", ex);
}
}
[Serializable()]
protected class VersionIDCriteria
{
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
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteAllDocVersionPdfs";
cm.Parameters.AddWithValue("@VersionID", criteria.VersionID);
cm.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("Pdf.DataPortal_Delete", ex);
_ErrorMessage = ex.Message;
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
public static void DeleteDocVersionPDFsWithNewROs(int versionID, int origfstid, int newfstid)
{
if (!CanDeleteObject())
throw new System.Security.SecurityException("User not authorized to remove a Pdf");
try
{
DeleteWithNewROs(versionID, origfstid, newfstid);
}
catch (Exception ex)
{
throw new DbCslaException("Error on Pdf.DeleteAllDocVersion", ex);
}
}
static private void DeleteWithNewROs(int docversionID, int origfstid, int newfstid)
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteDocVersionPdfsWithNewROs";
cm.Parameters.AddWithValue("@VersionID", docversionID);
cm.Parameters.AddWithValue("@OrigFSTid", origfstid);
cm.Parameters.AddWithValue("@NewFSTid", newfstid);
cm.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("Pdf.DeleteWithNewROs", ex);
throw new DbCslaException("Pdf.DeleteWithNewROs", ex);
}
}
}
public partial class PdfInfo
{
+41 -237
View File
@@ -225,41 +225,54 @@ namespace VEPROMS.CSLA.Library
}
}
// B2022-026 RO Memory Reduction code - pass in the ROFstInfo
public static int RefreshROFst(DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus, ROFstInfo origROFst)
{
int fixedROs = 0;
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
// 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;
if (dvi.DocVersionConfig.SelectedSlave <= 0)
{
myProgressBarRefresh(1, 100, "Update MS Word ROs");
if (dvi.DocVersionConfig.SelectedSlave <= 0)
{
// 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
int i = 0;
//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;
List<ItemInfo> list = ItemInfo.GetItemInfoWithChangedROs(dvi.VersionID, origfstid, newfstid);
foreach (ItemInfo itm in list)
{
DateTime start = DateTime.Now;
foreach (ProcedureInfo proc in dvi.Procedures)
{
DateTime start = DateTime.Now;
ItemInfo.ResetROCounters();
myProgressBarRefresh(++i, list.Count, string.Format("{0} ({1}/{2} ROs {3})", itm.MyProcedure.DisplayNumber, i, list.Count, fixedROs));
ItemInfo.RefreshReferenceObjects(itm, localROFst);
fixedROs += ItemInfo.ROFixCount;
ProcedureInfo.ResetROCounters();
myProgressBarRefresh(++i, dvi.Procedures.Count, string.Format("{0} ({1}/{2} ROs {3})", proc.DisplayNumber, i, dvi.Procedures.Count, fixedROs));
ProcedureInfo.RefreshReferenceObjects(proc, origROFst);
fixedROs += ProcedureInfo.ROFixCount;
TimeSpan ts = DateTime.Now - start;
TimeSpan ts = DateTime.Now - start;
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, itm.MyProcedure.DisplayNumber, ItemInfo.ROCheckCount, ItemInfo.ROFixCount, ts.TotalSeconds));
}
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));
}
}
//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
//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)
//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
public static int CheckROLinksInThisProcedure(ProcedureInfo proc, System.Windows.Forms.TextBox tbStatus)
{
int FoundBadROLinks = 0;
DocVersionInfo dvi = DocVersionInfo.Get(proc.MyDocVersion.VersionID);
@@ -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");
}
// 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>
/// Updates an ro.fst into a sql database.
/// </summary>
@@ -670,188 +655,7 @@ namespace VEPROMS.CSLA.Library
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;
Console.WriteLine("{0,10:#####0.00},'{1}'", TimeSpan.FromTicks(dtNext.Ticks - dtLast.Ticks).TotalSeconds, message);
+12 -9
View File
@@ -522,19 +522,22 @@ namespace VEPROMS.CSLA.Library
}
public static Pdf MakePdf(Document myDocument, int debugStatus, int topRow, int pageLength, int leftMargin, int pageWidth, double pageCount, byte[] docPdf)
{
Pdf tmp = Pdf.New(myDocument, debugStatus, topRow, pageLength, leftMargin, pageWidth, pageCount, docPdf);
if (tmp.IsSavable)
tmp = tmp.Save();
else
using (Pdf tmp = Pdf.New(myDocument, debugStatus, topRow, pageLength, leftMargin, pageWidth, pageCount, docPdf))
{
Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules();
tmp._ErrorMessage = "Failed Validation:";
foreach (Csla.Validation.BrokenRule br in brc)
if (tmp.IsSavable)
return tmp.Save();
else
{
tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName;
Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules();
tmp._ErrorMessage = "Failed Validation:";
foreach (Csla.Validation.BrokenRule br in brc)
{
tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName;
}
return tmp;
}
}
return tmp;
}
public static Pdf Get(int docID, int debugStatus, int topRow, int pageLength, int leftMargin, int pageWidth)
{
@@ -86,7 +86,38 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error in vesp_GetOtherActiveSessions: retrieving data failed", ex);
}
}
#endregion
#endregion
}
#region Get Docs by Unit
//C2026-007 Get Missing Docs by Unit
// for Generating/Regenerating Pdf table
// can be ran overnight to assist with Printing when RO Updates
// and large Word Sections conatining ROs
public static DataTable GetMissingDocsByUnit()
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "GetMissingDocsByUnit";
cm.CommandTimeout = Database.DefaultTimeout;
using (SqlDataAdapter da = new SqlDataAdapter(cm))
{
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
}
}
}
catch (Exception ex)
{
throw new DbCslaException("Error in GetMissingDocsByUnit: retrieving data failed", ex);
}
}
#endregion
}
}
File diff suppressed because it is too large Load Diff
@@ -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.", 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 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.btnApplicabilitychg.TabIndex = 0;
this.btnApplicabilitychg.Text = "Set All at Level";
this.btnApplicabilitychg.ColorTable = DevComponents.DotNetBar.eButtonColor.BlueOrb;
+178 -85
View File
@@ -59,11 +59,11 @@ namespace Volian.Controls.Library
private DisplayTags displayTags;
#endregion
#endregion
#region Properties
#region Properties
public ProgressBarItem ProgressBar
public ProgressBarItem ProgressBar
{
get { return _progressBar; }
set { _progressBar = value; }
@@ -89,7 +89,10 @@ namespace Volian.Controls.Library
(_myRTB != null && (_myRTB.IsRoTable != lastRTBwasROTable || _myRTB.IsRoFigure != lastRTBwasROFigure)); }
}
public ROFstInfo MyROFST
//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
{
get { return _myROFST; }
set
@@ -128,16 +131,22 @@ namespace Volian.Controls.Library
// B2022-135 Submitted for Admin Tools (Check RO Links tool)
if (_docVersionInfo == null || _docVersionInfo != value || _docVersionInfo.VersionID != value.VersionID)
{
_docVersionInfo = value;
//Set flag for modified the docversion - should check for new ROs
if (_docVersionInfo?.VersionID != value?.VersionID)
{
changedDocVersion = true;
}
_docVersionInfo = value;
if (_myRTB != null && (_docVersionInfo == null || _docVersionInfo.VersionID != _myRTB.MyDVI.VersionID))
{
_docVersionInfo = _myRTB.MyDVI;
}
}
}
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures.
_currDocVersionID = (_docVersionInfo != null) ? (int?)_docVersionInfo.VersionID : null;
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures.
_currDocVersionID = (_docVersionInfo != null) ? (int?)_docVersionInfo.VersionID : null;
}
}
@@ -201,7 +210,11 @@ namespace Volian.Controls.Library
// B2022-098: [JPR] ROs not being resolved in Word Sections
CurROLink = 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)
{
if (_myRTB != null)
@@ -221,9 +234,9 @@ namespace Volian.Controls.Library
CurROLink = null;
_savCurROLink = null;
}
// B2023-004 assign the doc version info associated with the current RTB (rich text box)
// this fixes an issue where unit designators could not be linked in the step edit (BNPP data)
MyDvi = _myRTB.MyItemInfo.MyDocVersion;
// B2023-004 assign the doc version info associated with the current RTB (rich text box)
// this fixes an issue where unit designators could not be linked in the step edit (BNPP data)
MyDvi = _myRTB.MyItemInfo.MyDocVersion;
MyROFST = (_myRTB.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0) ? _myRTB.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst : null;
}
@@ -251,11 +264,13 @@ namespace Volian.Controls.Library
set { _myUserInfo = value; }
}
#endregion
public SessionInfo MySessionInfo { get; set; }
#region Constructors
#endregion
public DisplayRO()
#region Constructors
public DisplayRO()
{
InitializeComponent();
@@ -277,48 +292,62 @@ namespace Volian.Controls.Library
// Initialize the DisplayTags object
displayTags = new DisplayTags();
_progressBar = null;
}
#endregion
#endregion
#region Event Handlers
#region (Progress Bar)
#region Event Handlers
private string InitialProgressBarMessage
{
set
{
if (ProgressBar == null) return;
ProgressBar.Value = 0;
ProgressBar.Maximum = 100;
ProgressBar.Text = value;
Application.DoEvents();
}
}
private string FinalProgressBarMessage
{
set
{
if (ProgressBar == null) return;
ProgressBar.Value = 100;
ProgressBar.Maximum = 100;
ProgressBar.Text = value;
Application.DoEvents();
}
}
private void DoProgressBarRefresh(int value, int max, string text)
{
if (ProgressBar == null) return;
ProgressBar.Maximum = max;
ProgressBar.Value = value;
ProgressBar.Text = text;
Application.DoEvents();
}
#region (Progress Bar)
#endregion
private void ProgressBar_Initialize(int max, string desc)
{
if (_progressBar != null)
{
_progressBar.Maximum = max;
_progressBar.Text = desc;
_progressBar.TextVisible = true;
}
}
#region (RTB)
private void ProgressBar_SetValue(int curval)
{
if (_progressBar != null)
{
_progressBar.Value = curval;
}
}
//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;
}
private void ProgressBar_Clear()
{
if (_progressBar != null)
{
_progressBar.Text = string.Empty;
_progressBar.Maximum = 0;
_progressBar.Value = 0;
}
}
#endregion
#region (RTB)
public void MyRTB_LinkChanged(object sender, StepPanelLinkEventArgs args)
public void MyRTB_LinkChanged(object sender, StepPanelLinkEventArgs args)
{
CurROLink = null;
if (MyRTB.MyLinkText != null) CurROLink = args.MyLinkText.MyRoUsageInfo;
@@ -565,55 +594,102 @@ namespace Volian.Controls.Library
}
}
private void lbFound_SelectedValueChanged(object sender, EventArgs e)
private void lbFound_SelectedValueChanged(object sender, EventArgs e)
{
if (lbFound.Visible && lbFound.SelectedIndex >= 0 && lbFound.SelectedValue != null)
{
ExpandNode(Convert.ToString(lbFound.SelectedValue));
}
}
#endregion
#region (ROUpdate)
public List<string> roFstInfo_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args)
{
return VlnFlexGrid.ROTableUpdate(sender, args);
}
#endregion
#endregion
#region Public Methods
//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)
{
if (lbFound.Visible && lbFound.SelectedIndex >= 0 && lbFound.SelectedValue != null)
{
ExpandNode(Convert.ToString(lbFound.SelectedValue));
}
}
bool updatedROs = false;
#endregion
#endregion
#region Public Methods
public void LoadTree(bool forceReload = false)
{
if (MyROFST == null)
{
tvROFST.Nodes.Clear();
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)
{
//B2025-008
//in cases where a RO table is clicked on
//it will refresh the list
//temp store what the ROID was before the list refreshes
//so can go to it after the refresh
string tmpROID = CurROLink?.ROID;
//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;
ROFSTLookup.rodbi[] dbs = MyROFSTLookup.GetRODatabaseList(true);
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
//in cases where a RO table is clicked on
//it will refresh the list
//temp store what the ROID was before the list refreshes
//so can go to it after the refresh
string tmpROID = CurROLink?.ROID;
ROFSTLookup.rodbi[] dbs = MyROFSTLookup?.GetRODatabaseList(true);
// 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
// the clear nodes code below has to be after the GetRODatabaseList database call because of races conditions in the code
tvROFST.Nodes.Clear();
ResetSearch(); //B2023-050 need to reset the SaveRO, and any RO info that was selected last time the tree was loaded
for (int i = 0; i < dbs.Length; i++)
if (dbs != null)
{
ROFSTLookup.rodbi db = dbs[i];
for (int i = 0; i < dbs.Length; i++)
{
ROFSTLookup.rodbi db = dbs[i];
TreeNode tn = new TreeNode(db.dbiTitle);
tn.Tag = db;
tvROFST.Nodes.Add(tn);
TreeNode tn = new TreeNode(db.dbiTitle);
tn.Tag = db;
tvROFST.Nodes.Add(tn);
AddDummyGroup(db, tn);
}
AddDummyGroup(db, tn);
}
}
_currRofstID = (IsRofstValid) ? (int?)_myROFST.ROFstID : null;
_currDocVersionID = null;
@@ -621,7 +697,13 @@ namespace Volian.Controls.Library
if(_docVersionInfo != null) _currDocVersionID = (int?)_docVersionInfo.VersionID;
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();
@@ -672,7 +754,9 @@ namespace Volian.Controls.Library
}
_curROTypeFilter = _roTypeFilter;
}
return updatedROs;
}
public void SetFindDocROButton(bool enabled)
{
@@ -1164,12 +1248,21 @@ namespace Volian.Controls.Library
tbROValue.Text = null;
lbROId.Text = string.Empty;
// Disable all buttons by default
btnGoToRO.Enabled = false;
// Disable all buttons by default
btnSaveRO.Enabled = false;
btnCancelRO.Enabled = false;
btnPreviewRO.Enabled = false;
}
//B2026-030 GoTo sometimes requires being pressed twice
if (MyUserInfo != null && MyDvi != null && selectedChld.value != null)
{
btnGoToRO.Enabled = UserInfo.CanEditROs(MyUserInfo, MyDvi); // Writers and Reviewers cannot edit ROs (run the RO Editor)
}
else
{
btnGoToRO.Enabled = false;
}
}
#endregion
}
+4 -4
View File
@@ -215,7 +215,8 @@ namespace Volian.Controls.Library
this.groupPanelCheckoff.CanvasColor = System.Drawing.SystemColors.Control;
this.groupPanelCheckoff.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.groupPanelCheckoff.Controls.Add(this.cmbCheckoff);
this.groupPanelCheckoff.DisabledBackColor = System.Drawing.Color.Empty;
this.groupPanelCheckoff.Controls.Add(this.cbInitialLine);
this.groupPanelCheckoff.DisabledBackColor = System.Drawing.Color.Empty;
this.groupPanelCheckoff.Dock = System.Windows.Forms.DockStyle.Top;
this.groupPanelCheckoff.Location = new System.Drawing.Point(0, 231);
this.groupPanelCheckoff.Margin = new System.Windows.Forms.Padding(2);
@@ -265,8 +266,7 @@ namespace Volian.Controls.Library
this.cbInitialLine.Margin = new System.Windows.Forms.Padding(2);
this.cbInitialLine.Name = "cbInitialLine";
this.cbInitialLine.Size = new System.Drawing.Size(112, 15);
this.superTooltipTags.SetSuperTooltip(this.cbInitialLine, new DevComponents.DotNetBar.SuperTooltipInfo("Manual Page Break", "", "When set, starts this step at the top of a page.\r\n\r\nkeyboard command: <Ctrl><Ente" +
"r>", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.superTooltipTags.SetSuperTooltip(this.cbInitialLine, new DevComponents.DotNetBar.SuperTooltipInfo("Disable Initial Line", "", "When set, The initial line will be removed from this step.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.cbInitialLine.TabIndex = 1;
this.cbInitialLine.Text = "Disable Initial Line";
this.cbInitialLine.Visible = false;
@@ -276,7 +276,6 @@ namespace Volian.Controls.Library
//
this.groupPanelcmbShwRplWds.CanvasColor = System.Drawing.SystemColors.Control;
this.groupPanelcmbShwRplWds.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
this.groupPanelcmbShwRplWds.Controls.Add(this.cbInitialLine);
this.groupPanelcmbShwRplWds.Controls.Add(this.cmbShwRplWds);
this.groupPanelcmbShwRplWds.DisabledBackColor = System.Drawing.Color.Empty;
this.groupPanelcmbShwRplWds.Dock = System.Windows.Forms.DockStyle.Top;
@@ -880,3 +879,4 @@ namespace Volian.Controls.Library
private System.Windows.Forms.Button btnSaveChangeID;
}
}
+11 -1
View File
@@ -1400,15 +1400,25 @@ namespace Volian.Controls.Library
if (SelectionLength > 0)HandleDeleteKeyWithSelectedText(new KeyEventArgs(Keys.None), null);
int position = SelectionStart;
SelectionLength = 0;
// B2026-036 fixed issue where numbers after a dash character (in an RO return value) were trucated
// Needed to add a space after the \f0 in the string replace below. RTF was getting confused
// when there are number right after the \f0. Note also remove the space charcter after
// the \f1 command, as it is not needed since the \u commdn follows it.
// Here is the old code prior to when the foreach loop was added to handle symbols in RO value:
//
// linkValue = linkValue.Replace("\\u8209?", "\\f1\\u8209?\\f0 "); // dash character
// linkValue = linkValue.Replace("\\u9586?", "\\f1\\u9586?\\f0 "); // backslash symbol
// linkValue = linkValue.Replace("\\u916?", "\\f1\\u916?\\f0 "); // delta symbol
var pattern = @"\\u([0-9]{1,4})\?"; // RO Editor add symbols C2022 - 003
foreach (Match match in Regex.Matches(linkValue, pattern, RegexOptions.IgnoreCase))
{
linkValue = linkValue.Replace(match.Value, "\\f1 " + match.Value + "\\f0");
linkValue = linkValue.Replace(match.Value, "\\f1" + match.Value + "\\f0 ");
}
linkValue = linkValue.Replace(@"{", @"\{");
linkValue = linkValue.Replace(@"}", @"\}");
SelectedRtf = @"{\rtf1\ansi" + FontTable + @"{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}\v" + FontSize + @" <START]\v0\cf1 " + linkValue + @"\cf0\v " + linkUrl + @"[END>\v0 }";
this.SelectionLength = 0;
this.SelectionStart = position;
@@ -3556,7 +3556,10 @@ namespace Volian.Controls.Library
MyEditItem.SaveContents();
using (DocVersion dv = DocVersion.Get(Mydvi.VersionID))
{
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(Mydvi));
//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));
// 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
{
@@ -3566,8 +3569,8 @@ namespace Volian.Controls.Library
}
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, null);
swROUpdate.Close();
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, null, roFstInfo, origfstid, roFstInfo.ROFstID);
swROUpdate.Close();
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST");
@@ -2473,6 +2473,17 @@ namespace Volian.Controls.Library
private string ConvertTableText(string str)
{
string rtn = str;
string pattern = @"\\u([0-9]{1,4})\?";
string mValue, mValue2 = "";
foreach (Match match in Regex.Matches(rtn, pattern, RegexOptions.IgnoreCase))
{
mValue = match.Value;
mValue2 = $"\\f1 {mValue}\\f0";
rtn = rtn.Replace(match.Value, mValue2);
}
//ShowRawString(str, "ConvertTableText IN");
rtn = rtn.Replace(@"START]\v0", @"START]\cf1\v0");
rtn = rtn.Replace(@"\v #Link:", @"\cf0\v #Link:");
+7 -3
View File
@@ -2465,7 +2465,11 @@ namespace Volian.Controls.Library
}
Cursor = Cursors.WaitCursor; // C2023-002: move wait cursor after check out error
int ownerid = MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion);
using (DocVersion dv = DocVersion.Get(MyDVI.VersionID))
//must get id before ROFST gets updated so know what to refresh later
int origfstid = roFstInfo.ROFstID;
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
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
@@ -2477,8 +2481,8 @@ namespace Volian.Controls.Library
}
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, null);
swROUpdate.Close();
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, null, roFstInfo, origfstid, roFstInfo.ROFstID);
swROUpdate.Close();
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
OnTabDisplay(this, new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST"));
+3 -1
View File
@@ -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
+3
View File
@@ -491,10 +491,12 @@ namespace XYPlots
// remove an extra spaces between ><
//Buff = Regex.Replace(Buff, @"[ ]+<", "<");
Buff = Buff.Replace(">\r ", ">\r\n ");
Buff = Buff.Replace(">\n ", ">\r\n "); // C2022-003 if RO has symbols
Buff = Regex.Replace(Buff, @"[ ]+<", "<");
// some data only had carriage return, replace these with cr/nl so that following code
// will work
Buff = Buff.Replace(">\r<", ">\r\n<");
Buff = Buff.Replace(">\n<", ">\r\n<"); // C2022-003 if RO has symbols
Buff = Buff.Replace("><", ">\r\n<");
// some data had cr/cr/nl, change to cr/nl
Buff = Buff.Replace("\r\r\n", "\r\n");
@@ -520,6 +522,7 @@ namespace XYPlots
Buff = Buff.Substring(0, Buff.Length - 2) + " \r\n\0x00"; // needs to end with null
else if (Buff.EndsWith(">")) // doesn't end with return chars...
Buff = Buff.Substring(0, Buff.Length - 1) + " \r\n\0x00"; // needs to end with null
Buff = Regex.Replace(Buff, @"\\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.
Buff = Regex.Replace(Buff, @"([0-9])\r\n([0-9])", "$1 $2");
}
private void CloseGraph()
+10 -5
View File
@@ -2,13 +2,14 @@ using System;
using System.Collections.Generic;
using System.ComponentModel;
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.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Printing;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using VG;
//using XYPlots;
@@ -21,6 +22,10 @@ namespace XYPlots
public frmXYPlot(string title,string xyPlot)
{
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
xyPlot = xyPlot.Substring(pstart); // set val to the start of the plot commands
_XYPlot =xyPlot;