Compare commits
215
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c3e4bb3e9 | ||
|
|
23a296df86 | ||
|
|
dbea4abafb | ||
|
|
57622931a5 | ||
|
|
75368c2fe0 | ||
|
|
5e071bd35a | ||
|
|
77639318c6 | ||
|
|
1a890b11cb | ||
|
|
f2e01803bc | ||
|
|
752d30ba8f | ||
|
|
795f21f04b | ||
|
|
b1427f4997 | ||
|
|
c95e86c2a6 | ||
|
|
18d2aa3b51 | ||
|
|
7ba3ea8b13 | ||
|
|
30b34c3a50 | ||
|
|
6a42800d2c | ||
|
|
70f132540f | ||
|
|
cd9eaaaba1 | ||
|
|
70aa1f4024 | ||
|
|
1d634d96fe | ||
|
|
6d7d127b63 | ||
|
|
6f0fcdded2 | ||
|
|
4eb5254d96 | ||
|
|
6c2eee0cbc | ||
|
|
3c5265cecf | ||
|
|
9c97394f5e | ||
|
|
478d35890d | ||
|
|
1b9b63412c | ||
|
|
3bb8fff3a1 | ||
|
|
694bc0ead4 | ||
|
|
cfc324d31e | ||
|
|
43b63e2843 | ||
|
|
f2ec510a70 | ||
|
|
453edbb28e | ||
|
|
e492f12602 | ||
|
|
bc9407f52f | ||
|
|
954cc5918f | ||
|
|
4ef16e7856 | ||
|
|
1eb3c3e725 | ||
|
|
a89c2d3d22 | ||
|
|
914837a5a2 | ||
|
|
9643a71ba5 | ||
|
|
aa7e0528f8 | ||
|
|
57bd8d569e | ||
|
|
b49d8871a2 | ||
|
|
b90d419bc5 | ||
|
|
1f48d498e1 | ||
|
|
da6139c932 | ||
|
|
be744b40a3 | ||
|
|
780ce657ca | ||
|
|
464be0f803 | ||
|
|
58a6cb9a24 | ||
|
|
9bf7b2ffde | ||
|
|
cde1f28215 | ||
|
|
db198cb7d0 | ||
|
|
99fe567e78 | ||
|
|
f67d37801a | ||
|
|
2261c8f0f5 | ||
|
|
f93b16fc52 | ||
|
|
7c3a43749c | ||
|
|
ecec7b9f1a | ||
|
|
1aca7335f7 | ||
|
|
ba5aee6640 | ||
|
|
06c3136566 | ||
|
|
abaf55e9b1 | ||
|
|
3a2dd0b0aa | ||
|
|
9486b37300 | ||
|
|
0fed1acfd8 | ||
|
|
d7c2300021 | ||
|
|
fca333299d | ||
|
|
a13b03a136 | ||
|
|
48054f5bf1 | ||
|
|
51f2897a33 | ||
|
|
7a3a07b0da | ||
|
|
7c3cfca86c | ||
|
|
352af15984 | ||
|
|
2c42933d58 | ||
|
|
2e68362836 | ||
|
|
c6736db7ea | ||
|
|
c005f03af8 | ||
|
|
459aabcc86 | ||
|
|
ad33097d5e | ||
|
|
8d7735735e | ||
|
|
25bbc46925 | ||
|
|
5a26b0ee35 | ||
|
|
09a397bed2 | ||
|
|
a33039bcae | ||
|
|
0ebd125266 | ||
|
|
fd16a6b6c3 | ||
|
|
cf19f764c7 | ||
|
|
88850d6c25 | ||
|
|
b173c61575 | ||
|
|
3b866f0952 | ||
|
|
94db524a11 | ||
|
|
f27616ce1f | ||
|
|
7f75af7119 | ||
|
|
05ab48cdc5 | ||
|
|
38e42723af | ||
|
|
f4ec60c9e0 | ||
|
|
fd51c209a3 | ||
|
|
01394b1978 | ||
|
|
9b7db08fcf | ||
|
|
6d7cdef223 | ||
|
|
d9c35fe02a | ||
|
|
250b3fa406 | ||
|
|
a5a3f16177 | ||
|
|
ffa7e21c18 | ||
|
|
4608c05df0 | ||
|
|
56ff5a0213 | ||
|
|
014fde301c | ||
|
|
0080a42423 | ||
|
|
2035a4c855 | ||
|
|
4dc6a190fa | ||
|
|
e0db322262 | ||
|
|
8f1bb45e42 | ||
|
|
f39aefd28f | ||
|
|
2cfc43dbfd | ||
|
|
f4168b5202 | ||
|
|
2d93b652e8 | ||
|
|
70782cd655 | ||
|
|
768fcc4f05 | ||
|
|
727491f99b | ||
|
|
c5f1c3a340 | ||
|
|
a78311104a | ||
|
|
4b5b06210c | ||
|
|
333645b044 | ||
|
|
23173074aa | ||
|
|
be8bb9c4e1 | ||
|
|
d07e132216 | ||
|
|
401fa12851 | ||
|
|
194ca84d38 | ||
|
|
7bbf62d735 | ||
|
|
3924e2fca5 | ||
|
|
2e39102e7c | ||
|
|
2a0849fae5 | ||
|
|
9f4e8f6eef | ||
|
|
d0fe36f86e | ||
|
|
10da22cd77 | ||
|
|
6dacc2d515 | ||
|
|
7baa9628d6 | ||
|
|
ec5229101f | ||
|
|
a0e0b1e788 | ||
|
|
f1e04396de | ||
|
|
d0cae8c2fc | ||
|
|
90c215d4c1 | ||
|
|
1b1dc78548 | ||
|
|
a112163f85 | ||
|
|
2a9f2e188d | ||
|
|
652e0cb06f | ||
|
|
123b1b08c2 | ||
|
|
b321bc354b | ||
|
|
03d7397242 | ||
|
|
45e78ef184 | ||
|
|
fe7c5893bb | ||
|
|
2b57c552d1 | ||
|
|
7f0d39b684 | ||
|
|
7273a8b13b | ||
|
|
a544a5cd4f | ||
|
|
ff9ade75d4 | ||
|
|
cfd5498521 | ||
|
|
9b7c30e1cd | ||
|
|
670e5d7fa9 | ||
|
|
8258235611 | ||
|
|
4d97f29943 | ||
|
|
ab8d59eb2d | ||
|
|
c324fa69b2 | ||
|
|
1cdb9b4cc2 | ||
|
|
f47fa49b80 | ||
|
|
6ade96c7ef | ||
|
|
61d31a3c67 | ||
|
|
014509ea30 | ||
|
|
1ce1a45ca6 | ||
|
|
b6da13a653 | ||
|
|
604b4d1751 | ||
|
|
874aaf2857 | ||
|
|
17a28def4e | ||
|
|
e72a1aa9e7 | ||
|
|
7b96ef1b4c | ||
|
|
ea048e6d82 | ||
|
|
109abfb4ad | ||
|
|
3f662ab19d | ||
|
|
b0de38909a | ||
|
|
267de44103 | ||
|
|
b7b0e55d94 | ||
|
|
c0d12f5721 | ||
|
|
27a945485f | ||
|
|
d76c81a9d8 | ||
|
|
143a3622dd | ||
|
|
75992293c6 | ||
|
|
0e004828b3 | ||
|
|
714751f404 | ||
|
|
27576e946e | ||
|
|
e548dddcbd | ||
|
|
8cbc8c497e | ||
|
|
c328140441 | ||
|
|
a10798c983 | ||
|
|
06909e260f | ||
|
|
5eca8a5150 | ||
|
|
88a13f9864 | ||
|
|
e03ae6195a | ||
|
|
c3cacaf407 | ||
|
|
4b479b3ceb | ||
|
|
c78cb805fb | ||
|
|
d17688fc9d | ||
|
|
fd59b9d5f0 | ||
|
|
0e71c9f5f5 | ||
|
|
bc3c14589e | ||
|
|
4331f49f6f | ||
|
|
294d19e9d1 | ||
|
|
7fee639b53 | ||
|
|
c2a5a8ec7d | ||
|
|
ec823cab97 | ||
|
|
83f88b6df3 | ||
|
|
7b649c4a62 |
@@ -402,3 +402,4 @@ FodyWeavers.xsd
|
|||||||
/fmtall
|
/fmtall
|
||||||
/genmacall
|
/genmacall
|
||||||
*AssemblyInfo.cs
|
*AssemblyInfo.cs
|
||||||
|
/PROMS/Baseline/Baseline.sln
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@@ -35,31 +33,7 @@ namespace AdjustBuildRevision
|
|||||||
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.4.yyMM.dHH") + "\")");
|
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.4.yyMM.dHH") + "\")");
|
||||||
else
|
else
|
||||||
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.3.yyMM.dHH") + "\")");
|
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.3.yyMM.dHH") + "\")");
|
||||||
// if (outline != line)
|
|
||||||
// {
|
|
||||||
// Console.WriteLine("Before: '{0}'", line);
|
|
||||||
// Console.WriteLine("After: '{0}'", outline);
|
|
||||||
// lines[i] = outline;
|
|
||||||
// changed = true;
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// Console.WriteLine("No change: '{0}'", line);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//if (changed)
|
|
||||||
//{
|
|
||||||
// if (!fi.IsReadOnly) fi.IsReadOnly = false;
|
|
||||||
// StreamWriter sw = fi.CreateText();
|
|
||||||
// foreach (string line in lines)
|
|
||||||
// sw.WriteLine(line);
|
|
||||||
// sw.Close();
|
|
||||||
// string line = lines[i];
|
|
||||||
// string outline = line;
|
|
||||||
// if (line.Contains("AssemblyVersion") || line.Contains("AssemblyFileVersion"))
|
|
||||||
// {
|
|
||||||
//outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("1.1.yyMM.dHH") + "\")");
|
|
||||||
if (outline != line)
|
if (outline != line)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Before: '{0}'", line);
|
Console.WriteLine("Before: '{0}'", line);
|
||||||
@@ -84,7 +58,7 @@ namespace AdjustBuildRevision
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageBox.Show("File " + fi.FullName + " does not exist");
|
MessageBox.Show($"File {fi.FullName} does not exist");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -93,10 +67,6 @@ namespace AdjustBuildRevision
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//private static DateTime GetLatestDateTime(string path)
|
|
||||||
//{
|
|
||||||
// return GetLatestDateTime(new DirectoryInfo(path));
|
|
||||||
//}
|
|
||||||
private static DateTime GetLatestDateTime(DirectoryInfo di, DateTime dtCheck)
|
private static DateTime GetLatestDateTime(DirectoryInfo di, DateTime dtCheck)
|
||||||
{
|
{
|
||||||
DateTime dtMax = dtCheck;
|
DateTime dtMax = dtCheck;
|
||||||
@@ -104,24 +74,14 @@ namespace AdjustBuildRevision
|
|||||||
foreach(FileInfo myFile in myFiles)
|
foreach(FileInfo myFile in myFiles)
|
||||||
{
|
{
|
||||||
DateTime dt = myFile.LastWriteTime;
|
DateTime dt = myFile.LastWriteTime;
|
||||||
//if (dt > dtCheck)
|
|
||||||
//{
|
|
||||||
//Console.WriteLine("\"File\"\t\"{0}\"\t\"{1}\"\t{2}\t{3}",myFile.FullName,dt.ToString("1.1.yyMM.dHH"),dt,dtCheck);
|
|
||||||
if(dtMax < dt) dtMax = dt;
|
if(dtMax < dt) dtMax = dt;
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
DirectoryInfo[] myFolders = di.GetDirectories();
|
DirectoryInfo[] myFolders = di.GetDirectories();
|
||||||
foreach (DirectoryInfo diChild in myFolders)
|
foreach (DirectoryInfo diChild in myFolders)
|
||||||
{
|
{
|
||||||
DateTime dtChild = GetLatestDateTime(diChild,dtCheck);
|
DateTime dtChild = GetLatestDateTime(diChild,dtCheck);
|
||||||
//if (dtChild > dtCheck)
|
|
||||||
//{
|
|
||||||
//Console.WriteLine("\"SubFolder\"\t\"{0}\"\t\"{1}\"\t{2}\t{3}", diChild.FullName, dtChild.ToString("1.1.yyMM.dHH"),dtChild,dtCheck);
|
|
||||||
if(dtChild > dtMax) dtMax = dtChild;
|
if(dtChild > dtMax) dtMax = dtChild;
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
//if(dtMax > dtCheck)
|
|
||||||
// Console.WriteLine("\"Folder\"\t\"{0}\"\t\"{1}\"", di.FullName, dtMax.ToString("1.1.yyMM.dHH"));
|
|
||||||
return dtMax;
|
return dtMax;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,7 @@
|
|||||||
<Compile Include="frmSettings.Designer.cs">
|
<Compile Include="frmSettings.Designer.cs">
|
||||||
<DependentUpon>frmSettings.cs</DependentUpon>
|
<DependentUpon>frmSettings.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="GlobalSuppressions.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<EmbeddedResource Include="frmBaseline.resx">
|
<EmbeddedResource Include="frmBaseline.resx">
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// This file is used by Code Analysis to maintain SuppressMessage
|
||||||
|
// attributes that are applied to this project.
|
||||||
|
// Project-level suppressions either have no target or are given
|
||||||
|
// a specific target and scoped to a namespace, type, member, etc.
|
||||||
|
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
|
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Not modifying Naming Styles")]
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Baseline
|
namespace Baseline
|
||||||
|
|||||||
+161
-206
@@ -43,12 +43,9 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Collections.Specialized;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
@@ -73,12 +70,7 @@ namespace Baseline
|
|||||||
}
|
}
|
||||||
public partial class frmBaseline : Form
|
public partial class frmBaseline : Form
|
||||||
{
|
{
|
||||||
private IgnoreLines _MyIgnore = new IgnoreLines();
|
public IgnoreLines MyIgnore { get; set; } = new IgnoreLines();
|
||||||
public IgnoreLines MyIgnore
|
|
||||||
{
|
|
||||||
get { return _MyIgnore; }
|
|
||||||
set { _MyIgnore = value; }
|
|
||||||
}
|
|
||||||
private LastWas myLast = LastWas.Search;
|
private LastWas myLast = LastWas.Search;
|
||||||
private Settings MySettings;
|
private Settings MySettings;
|
||||||
public string MyStatus
|
public string MyStatus
|
||||||
@@ -151,8 +143,10 @@ namespace Baseline
|
|||||||
this.WindowState = Properties.Settings.Default.WidnowState;
|
this.WindowState = Properties.Settings.Default.WidnowState;
|
||||||
if(Properties.Settings.Default.Ignore != null && Properties.Settings.Default.Ignore != "")
|
if(Properties.Settings.Default.Ignore != null && Properties.Settings.Default.Ignore != "")
|
||||||
MyIgnore = IgnoreLines.Get(Properties.Settings.Default.Ignore);
|
MyIgnore = IgnoreLines.Get(Properties.Settings.Default.Ignore);
|
||||||
MySettings= new Settings();
|
MySettings = new Settings
|
||||||
MySettings.IgnoreLines = new BindingList<string>();
|
{
|
||||||
|
IgnoreLines = new BindingList<string>()
|
||||||
|
};
|
||||||
splitContainer1.SplitterDistance = Properties.Settings.Default.Split1;
|
splitContainer1.SplitterDistance = Properties.Settings.Default.Split1;
|
||||||
splitContainer2.SplitterDistance = Properties.Settings.Default.Split2;
|
splitContainer2.SplitterDistance = Properties.Settings.Default.Split2;
|
||||||
splitContainer3.SplitterDistance = Properties.Settings.Default.Split3;
|
splitContainer3.SplitterDistance = Properties.Settings.Default.Split3;
|
||||||
@@ -240,8 +234,7 @@ namespace Baseline
|
|||||||
lbProcedures.Items.Clear();
|
lbProcedures.Items.Clear();
|
||||||
lbResults1.Items.Clear();
|
lbResults1.Items.Clear();
|
||||||
lbResults2.Items.Clear();
|
lbResults2.Items.Clear();
|
||||||
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
if (lbDifferent.SelectedItem is FindFile ff)
|
||||||
if (ff != null)
|
|
||||||
{
|
{
|
||||||
// Fill Procedure or Result ListBoxes
|
// Fill Procedure or Result ListBoxes
|
||||||
switch (myLast)
|
switch (myLast)
|
||||||
@@ -361,13 +354,6 @@ namespace Baseline
|
|||||||
lines1 = list1.AsEnumerable<string>();// Convert back to Enumerable to work with LINQ
|
lines1 = list1.AsEnumerable<string>();// Convert back to Enumerable to work with LINQ
|
||||||
return lines1;
|
return lines1;
|
||||||
}
|
}
|
||||||
private string GetProcNum(string line)
|
|
||||||
{
|
|
||||||
string retval = line.Substring(3, line.IndexOf(" | ") - 3);
|
|
||||||
if (retval.Contains("_"))
|
|
||||||
retval = retval.Substring(0, retval.IndexOf("_") - 1);
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Include lines for Procedure or Page or Search is true
|
/// Include lines for Procedure or Page or Search is true
|
||||||
/// Account for Case Insensitive CheckBox
|
/// Account for Case Insensitive CheckBox
|
||||||
@@ -450,13 +436,13 @@ namespace Baseline
|
|||||||
private void lbResults1_SelectedIndexChanged(object sender, EventArgs e)
|
private void lbResults1_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string line=null;
|
string line=null;
|
||||||
if (lbResults1.SelectedItem is string)
|
if (lbResults1.SelectedItem is string v)
|
||||||
line = (string)lbResults1.SelectedItem;
|
line = v;
|
||||||
Line myLine = lbResults1.SelectedItem as Line;
|
Line myLine = lbResults1.SelectedItem as Line;
|
||||||
switch (myLast)
|
switch (myLast)
|
||||||
{
|
{
|
||||||
case LastWas.Pagination:
|
case LastWas.Pagination:
|
||||||
line = OpenPDF(line);
|
OpenPDF(line);
|
||||||
break;
|
break;
|
||||||
case LastWas.Baseline: // TODO: Need to add code here to open matching file
|
case LastWas.Baseline: // TODO: Need to add code here to open matching file
|
||||||
OpenOnePDF(myLine,1);
|
OpenOnePDF(myLine,1);
|
||||||
@@ -472,14 +458,14 @@ namespace Baseline
|
|||||||
{
|
{
|
||||||
|
|
||||||
string line=null;
|
string line=null;
|
||||||
if(lbResults2.SelectedItem is string)
|
if(lbResults2.SelectedItem is string v)
|
||||||
line = (string)lbResults2.SelectedItem;
|
line = v;
|
||||||
Line myLine = lbResults2.SelectedItem as Line;
|
Line myLine = lbResults2.SelectedItem as Line;
|
||||||
|
|
||||||
switch (myLast)
|
switch (myLast)
|
||||||
{
|
{
|
||||||
case LastWas.Pagination:
|
case LastWas.Pagination:
|
||||||
line = OpenPDF(line);
|
OpenPDF(line);
|
||||||
break;
|
break;
|
||||||
case LastWas.Baseline: // TODO: Need to add code here to open matching file
|
case LastWas.Baseline: // TODO: Need to add code here to open matching file
|
||||||
OpenOnePDF(myLine,2);
|
OpenOnePDF(myLine,2);
|
||||||
@@ -491,34 +477,97 @@ namespace Baseline
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string exePath;
|
|
||||||
private string OpenPDF(string line)
|
/// <summary>
|
||||||
|
/// This will return the full path to the PDF file
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fi"></param>
|
||||||
|
/// <param name="patern"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private string GetPFDFileAndPath(FileInfo fi, string patern)
|
||||||
{
|
{
|
||||||
int page = int.Parse(line.Substring(0, 6));
|
string[] fileList = Directory.GetFiles(fi.DirectoryName, patern);
|
||||||
|
// sort the list of file list
|
||||||
|
Array.Sort((string[])fileList);
|
||||||
|
return fileList.FirstOrDefault(); // 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)
|
||||||
|
{
|
||||||
|
// 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
|
||||||
|
int 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
|
||||||
|
}
|
||||||
|
// 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"
|
||||||
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
||||||
line = line.Substring(8, line.IndexOf(".S") - 8).Replace("/", "_").Replace("\\", "_");
|
string rtnstr = txt.Substring(8, lidx - 8).Replace("/", "_").Replace("\\", "_");
|
||||||
|
return rtnstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
string exePath;
|
||||||
|
private void OpenPDF(string line)
|
||||||
|
{
|
||||||
|
int pageNum = int.Parse(line.Substring(0, 6));
|
||||||
|
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
||||||
|
string ProcNum = ParseOutProcedureNumberFromLine(line);
|
||||||
|
string procPatern = string.Format("*{0}*.pdf", string.IsNullOrEmpty(line) ? "noProcNumber" : ProcNum);
|
||||||
|
|
||||||
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
||||||
FileInfo fi1 = new FileInfo(ff.File1);
|
FileInfo fi1 = new FileInfo(ff.File1);
|
||||||
FileInfo fi2 = new FileInfo(ff.File2);
|
FileInfo fi2 = new FileInfo(ff.File2);
|
||||||
|
string PDFfileName1 = GetPFDFileAndPath(fi1,procPatern);
|
||||||
|
string PDFfileName2 = GetPFDFileAndPath(fi2,procPatern);
|
||||||
|
if (string.IsNullOrEmpty(PDFfileName1) || string.IsNullOrEmpty(PDFfileName2)) return;
|
||||||
|
|
||||||
// If you don't know where the Reader executable is for PDFs Open a PDF and Check to see where the path points
|
// If you don't know where the Reader executable is for PDFs Open a PDF and Check to see where the path points
|
||||||
if (exePath == null)
|
if (exePath == null)
|
||||||
{
|
{
|
||||||
System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + line + ".pdf");
|
try
|
||||||
|
{
|
||||||
|
System.Diagnostics.Process p = System.Diagnostics.Process.Start(PDFfileName1);
|
||||||
exePath = TryToGetPath(p);
|
exePath = TryToGetPath(p);
|
||||||
p.Kill(); // No need to keep it open
|
p.Kill(); // No need to keep it open
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Application.DoEvents();
|
||||||
|
string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||||
|
Console.WriteLine(msg);
|
||||||
|
MessageBox.Show(msg, "Error opening default PDF Viewer");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Open the first PDF on a Specific Page
|
// Open the first PDF on a Specific Page
|
||||||
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", page) + fi1.DirectoryName + "\\" + line + ".pdf ");
|
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format(" /A \"page={0}\" \"{1}\" ", pageNum,PDFfileName1));
|
||||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
|
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
|
||||||
// Move the PDF Reader window to 0,0
|
// Move the PDF Reader window to 0,0
|
||||||
MoveProcess(p1, 0, 0);
|
MoveProcess(p1, 0, 0);
|
||||||
// Open the first PDF on a Specific Page
|
|
||||||
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", page) + fi2.DirectoryName + "\\" + line + ".pdf ");
|
// Open the second PDF on a Specific Page
|
||||||
|
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format(" /A \"page={0}\" \"{1}\" ", pageNum, PDFfileName2));
|
||||||
System.Diagnostics.Process p2 = System.Diagnostics.Process.Start(psi2);
|
System.Diagnostics.Process p2 = System.Diagnostics.Process.Start(psi2);
|
||||||
// Move the PDF Reader window to 960,0
|
// Move the PDF Reader window to 960,0
|
||||||
// TODO: This Offset could be a Setting
|
// TODO: This Offset could be a Setting
|
||||||
MoveProcess(p2, 960, 0);
|
MoveProcess(p2, 960, 0);
|
||||||
return line;
|
return;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Try to get the location of the PDF Reader executable
|
/// Try to get the location of the PDF Reader executable
|
||||||
@@ -530,7 +579,7 @@ namespace Baseline
|
|||||||
p.WaitForInputIdle();
|
p.WaitForInputIdle();
|
||||||
while (p.MainModule == null)
|
while (p.MainModule == null)
|
||||||
{
|
{
|
||||||
Console.WriteLine("{0} - {1}", p.MainWindowTitle,p.ProcessName);
|
Console.WriteLine("{0} - {1}", p.MainWindowTitle, p.ProcessName);
|
||||||
p.WaitForInputIdle();
|
p.WaitForInputIdle();
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
}
|
}
|
||||||
@@ -551,10 +600,10 @@ namespace Baseline
|
|||||||
progname = @"C:\Program Files (x86)\IDM Computer Solutions\UltraCompare\UC.exe";
|
progname = @"C:\Program Files (x86)\IDM Computer Solutions\UltraCompare\UC.exe";
|
||||||
System.Diagnostics.ProcessStartInfo psi =
|
System.Diagnostics.ProcessStartInfo psi =
|
||||||
new System.Diagnostics.ProcessStartInfo(progname, string.Format(@" -t ""{0}"" ""{1}""", compareFile, baseFile));
|
new System.Diagnostics.ProcessStartInfo(progname, string.Format(@" -t ""{0}"" ""{1}""", compareFile, baseFile));
|
||||||
System.Diagnostics.Process prc = System.Diagnostics.Process.Start(psi);
|
_ = System.Diagnostics.Process.Start(psi);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ProcessLocationQueue myQueue= new ProcessLocationQueue();
|
private readonly ProcessLocationQueue myQueue= new ProcessLocationQueue();
|
||||||
private Timer queueTimer = null;
|
private Timer queueTimer = null;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Move a Process to a specific screen location - This is done with a timer so
|
/// Move a Process to a specific screen location - This is done with a timer so
|
||||||
@@ -567,8 +616,10 @@ namespace Baseline
|
|||||||
{
|
{
|
||||||
if (queueTimer == null)
|
if (queueTimer == null)
|
||||||
{
|
{
|
||||||
queueTimer = new Timer();
|
queueTimer = new Timer
|
||||||
queueTimer.Enabled = false;
|
{
|
||||||
|
Enabled = false
|
||||||
|
};
|
||||||
queueTimer.Tick += queueTimer_Tick;
|
queueTimer.Tick += queueTimer_Tick;
|
||||||
queueTimer.Interval = 1000;
|
queueTimer.Interval = 1000;
|
||||||
}
|
}
|
||||||
@@ -594,40 +645,54 @@ namespace Baseline
|
|||||||
/// <param name="list"></param>
|
/// <param name="list"></param>
|
||||||
private void OpenOnePDF(Line myLine, int list)
|
private void OpenOnePDF(Line myLine, int list)
|
||||||
{
|
{
|
||||||
|
if (myLine == null) return; // no PDF to open
|
||||||
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
||||||
string proc = myLine.MyProc.Number.Replace("/","_").Replace("\\","_");
|
string proc = myLine.MyProc.Number.Replace("/","_").Replace("\\","_");
|
||||||
|
|
||||||
|
// if no procedure number, PROMS creates pdf filename "NoProcNumber.pdf"
|
||||||
|
// create pattern to use to get the PDF from the directory
|
||||||
|
// add wildcards (*) to file the file if any prefix or suffix was added to the filename
|
||||||
|
string procPatern = string.Format("*{0}*.pdf", proc == string.Empty ? "noProcNumber" : proc);
|
||||||
int pagenum = myLine.MyPage.Number;
|
int pagenum = myLine.MyPage.Number;
|
||||||
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
||||||
FileInfo fi1 = new FileInfo(ff.File1);
|
string PDFfileName;
|
||||||
FileInfo fi2 = new FileInfo(ff.File2);
|
if (list == 1)
|
||||||
if (exePath == null)
|
|
||||||
{
|
{
|
||||||
System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + proc + ".pdf");
|
FileInfo fi1 = new FileInfo(ff.File1);
|
||||||
while (exePath == null)
|
PDFfileName = GetPFDFileAndPath(fi1, procPatern);
|
||||||
|
}
|
||||||
|
else // list == 2
|
||||||
|
{
|
||||||
|
FileInfo fi2 = new FileInfo(ff.File2);
|
||||||
|
PDFfileName = GetPFDFileAndPath(fi2, procPatern);
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(PDFfileName)) return; // no PDF to open
|
||||||
|
|
||||||
|
// if exePath is null, then open the found PDF with the default PDF viewer and
|
||||||
|
// capture/save the entire name and path of the default PDF viewer
|
||||||
|
if (exePath == null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
System.Diagnostics.Process tp = System.Diagnostics.Process.Start(PDFfileName);
|
||||||
exePath = p.MainModule.FileName;
|
exePath = TryToGetPath(tp);
|
||||||
|
tp.Kill();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||||
|
Console.WriteLine(msg);
|
||||||
|
MessageBox.Show(msg, "Error opening default PDF Viewer");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.Kill();
|
// open the PDF and jump to the page number
|
||||||
}
|
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A \"page={0}\" \"{1}\" ", pagenum, PDFfileName))
|
||||||
if (list == 1)
|
|
||||||
{
|
{
|
||||||
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", pagenum) + fi1.DirectoryName + "\\" + proc + ".pdf ");
|
UseShellExecute = false
|
||||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
|
};
|
||||||
}
|
_ = System.Diagnostics.Process.Start(psi1);
|
||||||
else
|
|
||||||
{
|
|
||||||
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", pagenum) + fi2.DirectoryName + "\\" + proc + ".pdf ");
|
|
||||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Perform Debug Meta file comparison for all of the folders within the automated testing folders
|
/// Perform Debug Meta file comparison for all of the folders within the automated testing folders
|
||||||
@@ -709,11 +774,11 @@ namespace Baseline
|
|||||||
private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e)
|
private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//Initialize Results List Box
|
//Initialize Results List Box
|
||||||
lbResults1.Items.Clear();
|
if (!(lbProcedures.SelectedItem is Procedure myProc)) return; // clicked on the white space (blank line) in the list of different procedures
|
||||||
Procedure myProc = lbProcedures.SelectedItem as Procedure;
|
|
||||||
//TODO: May need to consider if there are duplicate procedure numers and titles
|
//TODO: May need to consider if there are duplicate procedure numers and titles
|
||||||
Procedure myProc1 = MyProcs1.Find(x => x.Number == myProc.Number && x.Title == myProc.Title);
|
Procedure myProc1 = MyProcs1.Find(x => x.Number == myProc.Number && x.Title == myProc.Title);
|
||||||
// Build the results ListBox for the left window
|
// Build the results ListBox for the left window
|
||||||
|
lbResults1.Items.Clear();
|
||||||
if (myProc1 != null)
|
if (myProc1 != null)
|
||||||
{
|
{
|
||||||
foreach (Page myPage in myProc1.MyPages)
|
foreach (Page myPage in myProc1.MyPages)
|
||||||
@@ -758,27 +823,12 @@ namespace Baseline
|
|||||||
};
|
};
|
||||||
public class Settings
|
public class Settings
|
||||||
{
|
{
|
||||||
private BindingList<string> _IgnoreLines;
|
public BindingList<string> IgnoreLines { get; set; }
|
||||||
public BindingList<string> IgnoreLines
|
|
||||||
{
|
|
||||||
get { return _IgnoreLines; }
|
|
||||||
set { _IgnoreLines = value; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class FindFile
|
public partial class FindFile
|
||||||
{
|
{
|
||||||
private string _File1;
|
public string File1 { get; set; }
|
||||||
public string File1
|
public string File2 { get; set; }
|
||||||
{
|
|
||||||
get { return _File1; }
|
|
||||||
set { _File1 = value; }
|
|
||||||
}
|
|
||||||
private string _File2;
|
|
||||||
public string File2
|
|
||||||
{
|
|
||||||
get { return _File2; }
|
|
||||||
set { _File2 = value; }
|
|
||||||
}
|
|
||||||
public FindFile(string file1, string file2)
|
public FindFile(string file1, string file2)
|
||||||
{
|
{
|
||||||
File1 = file1;
|
File1 = file1;
|
||||||
@@ -787,11 +837,8 @@ namespace Baseline
|
|||||||
}
|
}
|
||||||
public partial class FindFiles : List<FindFile>
|
public partial class FindFiles : List<FindFile>
|
||||||
{
|
{
|
||||||
private string _FileName;
|
private readonly string _FileName;
|
||||||
public string FileName
|
public string FileName => _FileName;
|
||||||
{
|
|
||||||
get { return _FileName; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Build list of DocVersion Folders with differences
|
/// Build list of DocVersion Folders with differences
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1025,33 +1072,15 @@ namespace Baseline
|
|||||||
// Text - the line of text
|
// Text - the line of text
|
||||||
public partial class Procedure
|
public partial class Procedure
|
||||||
{
|
{
|
||||||
private string _Number;
|
public string Number { get; set; }
|
||||||
public string Number
|
public string Title { get; set; }
|
||||||
{
|
public Pages MyPages { get; set; } = new Pages();
|
||||||
get { return _Number; }
|
|
||||||
set { _Number = value; }
|
|
||||||
}
|
|
||||||
private string _Title;
|
|
||||||
public string Title
|
|
||||||
{
|
|
||||||
get { return _Title; }
|
|
||||||
set { _Title = value; }
|
|
||||||
}
|
|
||||||
private Pages _MyPages = new Pages();
|
|
||||||
public Pages MyPages
|
|
||||||
{
|
|
||||||
get { return _MyPages; }
|
|
||||||
set { _MyPages = value; }
|
|
||||||
}
|
|
||||||
public Procedure(string number, string title)
|
public Procedure(string number, string title)
|
||||||
{
|
{
|
||||||
_Number = number;
|
Number = number;
|
||||||
_Title = title;
|
Title = title;
|
||||||
}
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return string.Format("{0} - {1}", Number, Title);
|
|
||||||
}
|
}
|
||||||
|
public override string ToString() => string.Format("{0} - {1}", Number, Title);
|
||||||
}
|
}
|
||||||
public partial class Procedures : List<Procedure>
|
public partial class Procedures : List<Procedure>
|
||||||
{
|
{
|
||||||
@@ -1083,76 +1112,33 @@ namespace Baseline
|
|||||||
}
|
}
|
||||||
public partial class Page
|
public partial class Page
|
||||||
{
|
{
|
||||||
private int _Number;
|
public int Number { get; set; }
|
||||||
public int Number
|
|
||||||
{
|
|
||||||
get { return _Number; }
|
|
||||||
set { _Number = value; }
|
|
||||||
}
|
|
||||||
private Lines _MyLines = new Lines();
|
|
||||||
|
|
||||||
public Lines MyLines
|
public Lines MyLines { get; set; } = new Lines();
|
||||||
{
|
public Page(int number) => Number = number;
|
||||||
get { return _MyLines; }
|
public override string ToString() => string.Format("Page {0}", Number);
|
||||||
set { _MyLines = value; }
|
|
||||||
}
|
|
||||||
public Page(int number)
|
|
||||||
{
|
|
||||||
_Number = number;
|
|
||||||
}
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return string.Format("Page {0}", Number);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class Pages : List<Page>
|
public partial class Pages : List<Page>
|
||||||
{
|
{
|
||||||
public void Add(int number)
|
public void Add(int number) => Add(new Page(number));
|
||||||
{
|
|
||||||
Add(new Page(number));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class Line
|
public partial class Line
|
||||||
{
|
{
|
||||||
private Procedure _MyProc;
|
public Procedure MyProc { get; set; }
|
||||||
public Procedure MyProc
|
public Page MyPage { get; set; }
|
||||||
{
|
public string Text { get; set; }
|
||||||
get { return _MyProc; }
|
public Line(string text) => Text = text;
|
||||||
set { _MyProc = value; }
|
|
||||||
}
|
|
||||||
private Page _MyPage;
|
|
||||||
public Page MyPage
|
|
||||||
{
|
|
||||||
get { return _MyPage; }
|
|
||||||
set { _MyPage = value; }
|
|
||||||
}
|
|
||||||
private string _Text;
|
|
||||||
public string Text
|
|
||||||
{
|
|
||||||
get { return _Text; }
|
|
||||||
set { _Text = value; }
|
|
||||||
}
|
|
||||||
public Line(string text)
|
|
||||||
{
|
|
||||||
_Text = text;
|
|
||||||
}
|
|
||||||
public Line(string text, Procedure myProc, Page myPage)
|
public Line(string text, Procedure myProc, Page myPage)
|
||||||
{
|
{
|
||||||
_Text = text;
|
Text = text;
|
||||||
_MyProc = myProc;
|
MyProc = myProc;
|
||||||
_MyPage = myPage;
|
MyPage = myPage;
|
||||||
}
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return Text;
|
|
||||||
}
|
}
|
||||||
|
public override string ToString() => Text;
|
||||||
}
|
}
|
||||||
public partial class Lines : List<Line>
|
public partial class Lines : List<Line>
|
||||||
{
|
{
|
||||||
public void Add(string text)
|
public void Add(string text) => Add(new Line(text));
|
||||||
{
|
|
||||||
Add(new Line(text));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public partial class IgnoreLine
|
public partial class IgnoreLine
|
||||||
@@ -1191,20 +1177,11 @@ namespace Baseline
|
|||||||
public IgnoreLines()
|
public IgnoreLines()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
public void Add(string text, Relation searchType, bool active)
|
public void Add(string text, Relation searchType, bool active) => Add(new IgnoreLine(text, searchType, active));
|
||||||
{
|
|
||||||
Add(new IgnoreLine(text, searchType, active));
|
|
||||||
}
|
|
||||||
// Convert IgnoreLines to string (XML)
|
// Convert IgnoreLines to string (XML)
|
||||||
public override string ToString()
|
public override string ToString() => GenericSerializer<IgnoreLines>.StringSerialize(this);
|
||||||
{
|
|
||||||
return GenericSerializer<IgnoreLines>.StringSerialize(this);
|
|
||||||
}
|
|
||||||
// Convert string to IgnoreLines
|
// Convert string to IgnoreLines
|
||||||
public static IgnoreLines Get(string xml)
|
public static IgnoreLines Get(string xml) => GenericSerializer<IgnoreLines>.StringDeserialize(xml);
|
||||||
{
|
|
||||||
return GenericSerializer<IgnoreLines>.StringDeserialize(xml);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is a simple serializer that takes a class and converts it to and from string (XML)
|
/// This is a simple serializer that takes a class and converts it to and from string (XML)
|
||||||
@@ -1233,7 +1210,7 @@ namespace Baseline
|
|||||||
string ss = s.Replace("encoding=\"utf-16\"", "");
|
string ss = s.Replace("encoding=\"utf-16\"", "");
|
||||||
XmlSerializer xs = new XmlSerializer(typeof(T));
|
XmlSerializer xs = new XmlSerializer(typeof(T));
|
||||||
UTF8Encoding enc = new UTF8Encoding();
|
UTF8Encoding enc = new UTF8Encoding();
|
||||||
Byte[] arrBytData = enc.GetBytes(ss);
|
byte[] arrBytData = enc.GetBytes(ss);
|
||||||
using (MemoryStream ms = new MemoryStream(arrBytData))
|
using (MemoryStream ms = new MemoryStream(arrBytData))
|
||||||
{
|
{
|
||||||
t = (T)xs.Deserialize(ms);
|
t = (T)xs.Deserialize(ms);
|
||||||
@@ -1248,10 +1225,7 @@ namespace Baseline
|
|||||||
{
|
{
|
||||||
public NonXsiTextWriter(TextWriter w) : base(w) { }
|
public NonXsiTextWriter(TextWriter w) : base(w) { }
|
||||||
public NonXsiTextWriter(Stream w, Encoding encoding)
|
public NonXsiTextWriter(Stream w, Encoding encoding)
|
||||||
: base(w, encoding)
|
: base(w, encoding) => Formatting = Formatting.Indented;
|
||||||
{
|
|
||||||
this.Formatting = Formatting.Indented;
|
|
||||||
}
|
|
||||||
public NonXsiTextWriter(string filename, Encoding encoding) : base(filename, encoding) { }
|
public NonXsiTextWriter(string filename, Encoding encoding) : base(filename, encoding) { }
|
||||||
bool _skip = false;
|
bool _skip = false;
|
||||||
public override void WriteStartAttribute(string prefix, string localName, string ns)
|
public override void WriteStartAttribute(string prefix, string localName, string ns)
|
||||||
@@ -1294,32 +1268,16 @@ namespace Baseline
|
|||||||
public const short SWP_NOZORDER = 0X4;
|
public const short SWP_NOZORDER = 0X4;
|
||||||
public const int SWP_SHOWWINDOW = 0x0040;
|
public const int SWP_SHOWWINDOW = 0x0040;
|
||||||
|
|
||||||
private System.Diagnostics.Process _Process;
|
public System.Diagnostics.Process Process { get; set; }
|
||||||
|
public int X { get; set; }
|
||||||
public System.Diagnostics.Process Process
|
public int Y { get; set; }
|
||||||
{
|
|
||||||
get { return _Process; }
|
|
||||||
set { _Process = value; }
|
|
||||||
}
|
|
||||||
private int _X;
|
|
||||||
public int X
|
|
||||||
{
|
|
||||||
get { return _X; }
|
|
||||||
set { _X = value; }
|
|
||||||
}
|
|
||||||
private int _Y;
|
|
||||||
public int Y
|
|
||||||
{
|
|
||||||
get { return _Y; }
|
|
||||||
set { _Y = value; }
|
|
||||||
}
|
|
||||||
public ProcessLocation(System.Diagnostics.Process process, int x, int y)
|
public ProcessLocation(System.Diagnostics.Process process, int x, int y)
|
||||||
{
|
{
|
||||||
Process = process;
|
Process = process;
|
||||||
X = x;
|
X = x;
|
||||||
Y = y;
|
Y = y;
|
||||||
}
|
}
|
||||||
private static Boolean FoxitSettingInfo = true;
|
private static bool FoxitSettingInfo = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// MoveIt() moves the window containing the PDF viewer to the right so the two pdf viewer windows will not overlap.
|
/// MoveIt() moves the window containing the PDF viewer to the right so the two pdf viewer windows will not overlap.
|
||||||
@@ -1340,10 +1298,7 @@ namespace Baseline
|
|||||||
}
|
}
|
||||||
public class ProcessLocationQueue: Queue<ProcessLocation>
|
public class ProcessLocationQueue: Queue<ProcessLocation>
|
||||||
{
|
{
|
||||||
public void Add(System.Diagnostics.Process process, int x, int y)
|
public void Add(System.Diagnostics.Process process, int x, int y) => Enqueue(new ProcessLocation(process, x, y));
|
||||||
{
|
|
||||||
Enqueue(new ProcessLocation(process,x,y));
|
|
||||||
}
|
|
||||||
public void ProcessNext()
|
public void ProcessNext()
|
||||||
{
|
{
|
||||||
ProcessLocation pl = Dequeue();
|
ProcessLocation pl = Dequeue();
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Baseline
|
namespace Baseline
|
||||||
@@ -19,17 +12,7 @@ namespace Baseline
|
|||||||
set {
|
set {
|
||||||
_MyIgnore = value;
|
_MyIgnore = value;
|
||||||
dgv.DataSource=null;
|
dgv.DataSource=null;
|
||||||
//dgvcSearchType.ValueType = typeof(Relation);
|
|
||||||
//dgvcSearchType.ValueMember = "Value";
|
|
||||||
//dgvcSearchType.DisplayMember = "Display";
|
|
||||||
//dgvcSearchType.DataSource = new Relation[] { Relation.Contains, Relation.StartsWith, Relation.EndsWith, Relation.Regex }
|
|
||||||
//.Select(x => new { Display = x.ToString(), Value = x })
|
|
||||||
//.ToList();
|
|
||||||
dgv.DataSource=value;
|
dgv.DataSource=value;
|
||||||
//dgvcSearchType.DataSource =
|
|
||||||
//new List<Relation>((Relation[]) Enum.GetValues(typeof(Relation)))
|
|
||||||
//.Select(x => new { Display=x.ToString(), Value=(int)x })
|
|
||||||
//.ToList();;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public frmSettings(IgnoreLines myIgnore)
|
public frmSettings(IgnoreLines myIgnore)
|
||||||
@@ -46,19 +29,16 @@ namespace Baseline
|
|||||||
col.ValueType = typeof(Relation);
|
col.ValueType = typeof(Relation);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dgv_DataError(object sender, DataGridViewDataErrorEventArgs e)
|
private void dgv_DataError(object sender, DataGridViewDataErrorEventArgs e) => Console.WriteLine("Here");
|
||||||
{
|
|
||||||
Console.WriteLine("Here");
|
|
||||||
}
|
|
||||||
private void btnOK_Click(object sender, EventArgs e)
|
private void btnOK_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
this.DialogResult = System.Windows.Forms.DialogResult.OK;
|
DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
private void btnCancel_Click(object sender, EventArgs e)
|
private void btnCancel_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
@@ -15,7 +14,7 @@ namespace AT.STO.UI.Win
|
|||||||
{
|
{
|
||||||
#region Private Variable Declarations
|
#region Private Variable Declarations
|
||||||
private IDropDownAware _dropDownControl = null;
|
private IDropDownAware _dropDownControl = null;
|
||||||
private DropDownWindowHelper _dropDownHelper = null;
|
private readonly DropDownWindowHelper _dropDownHelper = null;
|
||||||
private Form _owner = null;
|
private Form _owner = null;
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor / Destructor
|
#region Constructor / Destructor
|
||||||
@@ -47,7 +46,7 @@ namespace AT.STO.UI.Win
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
protected override void OnHandleCreated(EventArgs e)
|
protected override void OnHandleCreated(EventArgs e)
|
||||||
{
|
{
|
||||||
_owner = this.FindForm();
|
_owner = FindForm();
|
||||||
_dropDownHelper.ReleaseHandle();
|
_dropDownHelper.ReleaseHandle();
|
||||||
|
|
||||||
if (_owner != null)
|
if (_owner != null)
|
||||||
@@ -66,8 +65,8 @@ namespace AT.STO.UI.Win
|
|||||||
{
|
{
|
||||||
base.OnResize(e);
|
base.OnResize(e);
|
||||||
combo.Location = new Point(0, 0);
|
combo.Location = new Point(0, 0);
|
||||||
combo.Width = this.ClientRectangle.Width;
|
combo.Width = ClientRectangle.Width;
|
||||||
this.Height = combo.Height;
|
Height = combo.Height;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Event Handler
|
#region Event Handler
|
||||||
@@ -96,7 +95,7 @@ namespace AT.STO.UI.Win
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dropDownHelper.CloseDropDown();
|
_dropDownHelper.CloseDropDown();
|
||||||
this.Focus();
|
Focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +114,7 @@ namespace AT.STO.UI.Win
|
|||||||
|
|
||||||
private void DropDownHelper_DropDownCancel(object sender, DropDownCancelEventArgs e)
|
private void DropDownHelper_DropDownCancel(object sender, DropDownCancelEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.Bounds.Contains(Parent.PointToClient(e.CursorLocation)))
|
if (Bounds.Contains(Parent.PointToClient(e.CursorLocation)))
|
||||||
{
|
{
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
}
|
}
|
||||||
@@ -138,23 +137,14 @@ namespace AT.STO.UI.Win
|
|||||||
SetValue<long>(e.Value as ILookupItem<long>);
|
SetValue<long>(e.Value as ILookupItem<long>);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.FinishEditing != null)
|
FinishEditing?.Invoke(this, e);
|
||||||
{
|
|
||||||
this.FinishEditing(this, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
_dropDownControl.FinishEditing -= new DropDownValueChangedEventHandler(DropDown_FinishEditing);
|
_dropDownControl.FinishEditing -= new DropDownValueChangedEventHandler(DropDown_FinishEditing);
|
||||||
_dropDownControl.ValueChanged -= new DropDownValueChangedEventHandler(DropDown_ValueChanged);
|
_dropDownControl.ValueChanged -= new DropDownValueChangedEventHandler(DropDown_ValueChanged);
|
||||||
_dropDownHelper.CloseDropDown();
|
_dropDownHelper.CloseDropDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DropDown_ValueChanged(object sender, DropDownValueChangedEventArgs e)
|
private void DropDown_ValueChanged(object sender, DropDownValueChangedEventArgs e) => ValueChanged?.Invoke(this, e);
|
||||||
{
|
|
||||||
if (this.ValueChanged != null)
|
|
||||||
{
|
|
||||||
this.ValueChanged(this, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -169,15 +159,12 @@ namespace AT.STO.UI.Win
|
|||||||
{
|
{
|
||||||
_dropDownControl = value;
|
_dropDownControl = value;
|
||||||
|
|
||||||
this.Controls.Add(_dropDownControl as Control);
|
Controls.Add(_dropDownControl as Control);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
public override string ToString()
|
public override string ToString() => Name;
|
||||||
{
|
|
||||||
return this.Name;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -36,9 +36,8 @@ namespace AT.STO.UI.Win
|
|||||||
public class DropDownCancelEventArgs : EventArgs
|
public class DropDownCancelEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
#region Private Variable Declarations
|
#region Private Variable Declarations
|
||||||
private bool _cancel = false;
|
|
||||||
private Point _cursorLocation;
|
private Point _cursorLocation;
|
||||||
private Form _dropDown = null;
|
private readonly Form _dropDown = null;
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor / Destructor
|
#region Constructor / Destructor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -51,34 +50,24 @@ namespace AT.STO.UI.Win
|
|||||||
{
|
{
|
||||||
_dropDown = DropDown;
|
_dropDown = DropDown;
|
||||||
_cursorLocation = CursorLocation;
|
_cursorLocation = CursorLocation;
|
||||||
_cancel = false;
|
Cancel = false;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Cancel
|
public bool Cancel { get; set; } = false;
|
||||||
{
|
|
||||||
get { return _cancel; }
|
|
||||||
set { _cancel = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Point CursorLocation
|
public Point CursorLocation => _cursorLocation;
|
||||||
{
|
|
||||||
get { return _cursorLocation; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Form DropDown
|
public Form DropDown => _dropDown;
|
||||||
{
|
|
||||||
get { return _dropDown; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +80,7 @@ namespace AT.STO.UI.Win
|
|||||||
public class DropDownClosedEventArgs : EventArgs
|
public class DropDownClosedEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
#region Private Variable Declarations
|
#region Private Variable Declarations
|
||||||
private Form _dropDown = null;
|
private readonly Form _dropDown = null;
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor / Destructor
|
#region Constructor / Destructor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -99,19 +88,13 @@ namespace AT.STO.UI.Win
|
|||||||
/// popup form.
|
/// popup form.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="DropDown">DropDown Form which is being closed.</param>
|
/// <param name="DropDown">DropDown Form which is being closed.</param>
|
||||||
public DropDownClosedEventArgs(Form DropDown)
|
public DropDownClosedEventArgs(Form DropDown) => _dropDown = DropDown;
|
||||||
{
|
|
||||||
_dropDown = DropDown;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the dropdown form which is being closed.
|
/// Gets the dropdown form which is being closed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Form DropDown
|
public Form DropDown => _dropDown;
|
||||||
{
|
|
||||||
get { return _dropDown; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +104,6 @@ namespace AT.STO.UI.Win
|
|||||||
public class DropDownValueChangedEventArgs : EventArgs
|
public class DropDownValueChangedEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
#region Private Variable Declarations
|
#region Private Variable Declarations
|
||||||
private object _value = null;
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor / Destructor
|
#region Constructor / Destructor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -135,20 +117,13 @@ namespace AT.STO.UI.Win
|
|||||||
/// Initialization with the control's value.
|
/// Initialization with the control's value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Value"></param>
|
/// <param name="Value"></param>
|
||||||
public DropDownValueChangedEventArgs(object Value)
|
public DropDownValueChangedEventArgs(object Value) => this.Value = Value;
|
||||||
{
|
|
||||||
_value = Value;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the control's value.
|
/// Gets or sets the control's value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public object Value
|
public object Value { get; set; } = null;
|
||||||
{
|
|
||||||
get { return _value; }
|
|
||||||
set { _value = value; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,16 +13,13 @@ namespace AT.STO.UI.Win
|
|||||||
internal partial class DropDownForm : Form, IDropDownAware
|
internal partial class DropDownForm : Form, IDropDownAware
|
||||||
{
|
{
|
||||||
#region Private Variable Declaration
|
#region Private Variable Declaration
|
||||||
private IDropDownAware _control = null;
|
private readonly IDropDownAware _control = null;
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor / Destructor
|
#region Constructor / Destructor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default Constructor
|
/// Default Constructor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DropDownForm()
|
public DropDownForm() => InitializeComponent();
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor to initialize the for with the control to display.
|
/// Constructor to initialize the for with the control to display.
|
||||||
@@ -41,7 +38,7 @@ namespace AT.STO.UI.Win
|
|||||||
#region Form Events
|
#region Form Events
|
||||||
protected override void OnClosing(CancelEventArgs e)
|
protected override void OnClosing(CancelEventArgs e)
|
||||||
{
|
{
|
||||||
this.Controls.Remove(_control as Control);
|
Controls.Remove(_control as Control);
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,22 +55,13 @@ namespace AT.STO.UI.Win
|
|||||||
#region Event Handler
|
#region Event Handler
|
||||||
private void Ctrl_FinishEditing(object sender, DropDownValueChangedEventArgs e)
|
private void Ctrl_FinishEditing(object sender, DropDownValueChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.FinishEditing != null)
|
FinishEditing?.Invoke(this, e);
|
||||||
{
|
|
||||||
this.FinishEditing(this, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
_control.FinishEditing -= new DropDownValueChangedEventHandler(Ctrl_FinishEditing);
|
_control.FinishEditing -= new DropDownValueChangedEventHandler(Ctrl_FinishEditing);
|
||||||
_control.ValueChanged -= new DropDownValueChangedEventHandler(Ctrl_ValueChanged);
|
_control.ValueChanged -= new DropDownValueChangedEventHandler(Ctrl_ValueChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Ctrl_ValueChanged(object sender, DropDownValueChangedEventArgs e)
|
private void Ctrl_ValueChanged(object sender, DropDownValueChangedEventArgs e) => ValueChanged?.Invoke(this, e);
|
||||||
{
|
|
||||||
if (this.ValueChanged != null)
|
|
||||||
{
|
|
||||||
this.ValueChanged(this, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region IDropDownAware Implementation
|
#region IDropDownAware Implementation
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -100,15 +88,15 @@ namespace AT.STO.UI.Win
|
|||||||
private void InitializeControl(Control Ctrl)
|
private void InitializeControl(Control Ctrl)
|
||||||
{
|
{
|
||||||
Size size = Ctrl.Size;
|
Size size = Ctrl.Size;
|
||||||
Size inner = this.ClientRectangle.Size;
|
Size inner = ClientRectangle.Size;
|
||||||
Size outer = this.Size;
|
Size outer = Size;
|
||||||
int gap = outer.Width - inner.Width;
|
int gap = outer.Width - inner.Width;
|
||||||
|
|
||||||
size.Width += gap;
|
size.Width += gap;
|
||||||
size.Height += gap;
|
size.Height += gap;
|
||||||
|
|
||||||
this.Size = size;
|
Size = size;
|
||||||
this.Controls.Add(Ctrl);
|
Controls.Add(Ctrl);
|
||||||
Ctrl.Location = new Point(0, 0);
|
Ctrl.Location = new Point(0, 0);
|
||||||
Ctrl.Visible = true;
|
Ctrl.Visible = true;
|
||||||
Ctrl.Invalidate();
|
Ctrl.Invalidate();
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
@@ -23,8 +22,7 @@ namespace AT.STO.UI.Win
|
|||||||
private const int WM_NCMBUTTONDOWN = 0x0A7;
|
private const int WM_NCMBUTTONDOWN = 0x0A7;
|
||||||
#endregion
|
#endregion
|
||||||
#region Private Variable Declarations
|
#region Private Variable Declarations
|
||||||
private Form _dropDown = null;
|
private readonly DropDownWindowHelper _owner = null;
|
||||||
private DropDownWindowHelper _owner = null;
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Event Declarations
|
#region Event Declarations
|
||||||
public event DropDownCancelEventHandler DropDownCancel;
|
public event DropDownCancelEventHandler DropDownCancel;
|
||||||
@@ -36,44 +34,34 @@ namespace AT.STO.UI.Win
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Owner">The <see cref="DropDownWindowHelper"/> object
|
/// <param name="Owner">The <see cref="DropDownWindowHelper"/> object
|
||||||
/// which owns this class.</param>
|
/// which owns this class.</param>
|
||||||
public DropDownMessageFilter(DropDownWindowHelper Owner)
|
public DropDownMessageFilter(DropDownWindowHelper Owner) => _owner = Owner;
|
||||||
{
|
|
||||||
_owner = Owner;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets/sets the dropdown form which is being displayed.
|
/// Gets/sets the dropdown form which is being displayed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Form DropDown
|
public Form DropDown { get; set; } = null;
|
||||||
{
|
|
||||||
get { return _dropDown; }
|
|
||||||
set { _dropDown = value; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
private void OnMouseDown()
|
private void OnMouseDown()
|
||||||
{
|
{
|
||||||
Point cursorPos = Cursor.Position; // Get the cursor location
|
Point cursorPos = Cursor.Position; // Get the cursor location
|
||||||
|
|
||||||
if (!_dropDown.Bounds.Contains(cursorPos)) // Check if it is within the popup form
|
if (!DropDown.Bounds.Contains(cursorPos)) // Check if it is within the popup form
|
||||||
{
|
{
|
||||||
OnDropDownCancel(new DropDownCancelEventArgs(_dropDown, cursorPos)); // If not, then call to see if it should be closed
|
OnDropDownCancel(new DropDownCancelEventArgs(DropDown, cursorPos)); // If not, then call to see if it should be closed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region DropDownCancelEvent Implementation
|
#region DropDownCancelEvent Implementation
|
||||||
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.DropDownCancel != null)
|
DropDownCancel?.Invoke(this, e);
|
||||||
{
|
|
||||||
this.DropDownCancel(this, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!e.Cancel)
|
if (!e.Cancel)
|
||||||
{
|
{
|
||||||
_owner.CloseDropDown();
|
_owner.CloseDropDown();
|
||||||
_dropDown = null; // Clear reference for GC
|
DropDown = null; // Clear reference for GC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -90,7 +78,7 @@ namespace AT.STO.UI.Win
|
|||||||
/// This implementation always returns <c>false</c>.</returns>
|
/// This implementation always returns <c>false</c>.</returns>
|
||||||
public bool PreFilterMessage(ref Message m)
|
public bool PreFilterMessage(ref Message m)
|
||||||
{
|
{
|
||||||
if (_dropDown != null)
|
if (DropDown != null)
|
||||||
{
|
{
|
||||||
switch (m.Msg)
|
switch (m.Msg)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace AT.STO.UI.Win
|
namespace AT.STO.UI.Win
|
||||||
@@ -22,7 +21,7 @@ namespace AT.STO.UI.Win
|
|||||||
|
|
||||||
private Form _dropDown = null;
|
private Form _dropDown = null;
|
||||||
private bool _dropDownShowing = false;
|
private bool _dropDownShowing = false;
|
||||||
private DropDownMessageFilter _filter = null;
|
private readonly DropDownMessageFilter _filter = null;
|
||||||
private Form _owner = null;
|
private Form _owner = null;
|
||||||
private bool _skipClose = false;
|
private bool _skipClose = false;
|
||||||
#endregion
|
#endregion
|
||||||
@@ -44,10 +43,7 @@ namespace AT.STO.UI.Win
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Event Handler
|
#region Event Handler
|
||||||
private void Popup_Cancel(object sender, DropDownCancelEventArgs e)
|
private void Popup_Cancel(object sender, DropDownCancelEventArgs e) => OnDropDownCancel(e);
|
||||||
{
|
|
||||||
OnDropDownCancel(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Responds to the <see cref="System.Windows.Forms.Form.Closed"/>
|
/// Responds to the <see cref="System.Windows.Forms.Form.Closed"/>
|
||||||
@@ -55,10 +51,7 @@ namespace AT.STO.UI.Win
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender">Popup form that has been closed.</param>
|
/// <param name="sender">Popup form that has been closed.</param>
|
||||||
/// <param name="e">Not used.</param>
|
/// <param name="e">Not used.</param>
|
||||||
private void Popup_Closed(object sender, EventArgs e)
|
private void Popup_Closed(object sender, EventArgs e) => CloseDropDown();
|
||||||
{
|
|
||||||
CloseDropDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Subclasses the owning form's existing Window Procedure to enables the
|
/// Subclasses the owning form's existing Window Procedure to enables the
|
||||||
@@ -76,7 +69,7 @@ namespace AT.STO.UI.Win
|
|||||||
{
|
{
|
||||||
if (((int)m.WParam) == 0) // Check if the title bar will made inactive:
|
if (((int)m.WParam) == 0) // Check if the title bar will made inactive:
|
||||||
{ // Note it's no good to try and consume this message; if you try to do that you'll end up with windows
|
{ // Note it's no good to try and consume this message; if you try to do that you'll end up with windows
|
||||||
UIApiCalls.SendMessage(this.Handle, UIApiCalls.WM_NCACTIVATE, 1, IntPtr.Zero); // If so reactivate it.
|
UIApiCalls.SendMessage(Handle, UIApiCalls.WM_NCACTIVATE, 1, IntPtr.Zero); // If so reactivate it.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m.Msg == UIApiCalls.WM_ACTIVATEAPP)
|
else if (m.Msg == UIApiCalls.WM_ACTIVATEAPP)
|
||||||
@@ -84,7 +77,7 @@ namespace AT.STO.UI.Win
|
|||||||
if ((int)m.WParam == 0) // Check if the application is being deactivated.
|
if ((int)m.WParam == 0) // Check if the application is being deactivated.
|
||||||
{
|
{
|
||||||
CloseDropDown(); // It is so cancel the popup:
|
CloseDropDown(); // It is so cancel the popup:
|
||||||
UIApiCalls.PostMessage(this.Handle, UIApiCalls.WM_NCACTIVATE, 0, IntPtr.Zero); // And put the title bar into the inactive state:
|
UIApiCalls.PostMessage(Handle, UIApiCalls.WM_NCACTIVATE, 0, IntPtr.Zero); // And put the title bar into the inactive state:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -173,17 +166,14 @@ namespace AT.STO.UI.Win
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicator weither the DropDown is showing.
|
/// Indicator weither the DropDown is showing.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool DropDownShowing
|
public bool DropDownShowing => _dropDownShowing;
|
||||||
{
|
|
||||||
get { return _dropDownShowing; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Event Implementation
|
#region Event Implementation
|
||||||
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.DropDownCancel != null)
|
if (DropDownCancel != null)
|
||||||
{
|
{
|
||||||
this.DropDownCancel(this, e);
|
DropDownCancel(this, e);
|
||||||
|
|
||||||
if (!e.Cancel)
|
if (!e.Cancel)
|
||||||
{
|
{
|
||||||
@@ -192,13 +182,7 @@ namespace AT.STO.UI.Win
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnPDropDownClosed(DropDownClosedEventArgs e)
|
protected virtual void OnPDropDownClosed(DropDownClosedEventArgs e) => DropDownClosed?.Invoke(this, e);
|
||||||
{
|
|
||||||
if (this.DropDownClosed != null)
|
|
||||||
{
|
|
||||||
this.DropDownClosed(this, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace AT.STO.UI.Win
|
namespace AT.STO.UI.Win
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace AT.STO.UI.Win
|
namespace AT.STO.UI.Win
|
||||||
{
|
{
|
||||||
public interface ILookupItem<T> where T: struct
|
public interface ILookupItem<T> where T: struct
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Globalization;
|
|
||||||
//using System.Linq;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
|
||||||
@@ -121,10 +119,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="text">The text.</param>
|
/// <param name="text">The text.</param>
|
||||||
/// <returns>The dialog result.</returns>
|
/// <returns>The dialog result.</returns>
|
||||||
public static DialogResult Show(string text)
|
public static DialogResult Show(string text) => FlexibleMessageBoxForm.Show(null, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||||
{
|
|
||||||
return FlexibleMessageBoxForm.Show(null, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows the specified message box.
|
/// Shows the specified message box.
|
||||||
@@ -132,10 +127,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// <param name="owner">The owner.</param>
|
/// <param name="owner">The owner.</param>
|
||||||
/// <param name="text">The text.</param>
|
/// <param name="text">The text.</param>
|
||||||
/// <returns>The dialog result.</returns>
|
/// <returns>The dialog result.</returns>
|
||||||
public static DialogResult Show(IWin32Window owner, string text)
|
public static DialogResult Show(IWin32Window owner, string text) => FlexibleMessageBoxForm.Show(owner, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||||
{
|
|
||||||
return FlexibleMessageBoxForm.Show(owner, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows the specified message box.
|
/// Shows the specified message box.
|
||||||
@@ -143,10 +135,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// <param name="text">The text.</param>
|
/// <param name="text">The text.</param>
|
||||||
/// <param name="caption">The caption.</param>
|
/// <param name="caption">The caption.</param>
|
||||||
/// <returns>The dialog result.</returns>
|
/// <returns>The dialog result.</returns>
|
||||||
public static DialogResult Show(string text, string caption)
|
public static DialogResult Show(string text, string caption) => FlexibleMessageBoxForm.Show(null, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||||
{
|
|
||||||
return FlexibleMessageBoxForm.Show(null, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows the specified message box.
|
/// Shows the specified message box.
|
||||||
@@ -155,10 +144,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// <param name="text">The text.</param>
|
/// <param name="text">The text.</param>
|
||||||
/// <param name="caption">The caption.</param>
|
/// <param name="caption">The caption.</param>
|
||||||
/// <returns>The dialog result.</returns>
|
/// <returns>The dialog result.</returns>
|
||||||
public static DialogResult Show(IWin32Window owner, string text, string caption)
|
public static DialogResult Show(IWin32Window owner, string text, string caption) => FlexibleMessageBoxForm.Show(owner, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||||
{
|
|
||||||
return FlexibleMessageBoxForm.Show(owner, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows the specified message box.
|
/// Shows the specified message box.
|
||||||
@@ -167,10 +153,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// <param name="caption">The caption.</param>
|
/// <param name="caption">The caption.</param>
|
||||||
/// <param name="buttons">The buttons.</param>
|
/// <param name="buttons">The buttons.</param>
|
||||||
/// <returns>The dialog result.</returns>
|
/// <returns>The dialog result.</returns>
|
||||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons)
|
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons) => FlexibleMessageBoxForm.Show(null, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||||
{
|
|
||||||
return FlexibleMessageBoxForm.Show(null, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows the specified message box.
|
/// Shows the specified message box.
|
||||||
@@ -180,10 +163,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// <param name="caption">The caption.</param>
|
/// <param name="caption">The caption.</param>
|
||||||
/// <param name="buttons">The buttons.</param>
|
/// <param name="buttons">The buttons.</param>
|
||||||
/// <returns>The dialog result.</returns>
|
/// <returns>The dialog result.</returns>
|
||||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons)
|
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons) => FlexibleMessageBoxForm.Show(owner, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||||
{
|
|
||||||
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows the specified message box.
|
/// Shows the specified message box.
|
||||||
@@ -193,10 +173,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// <param name="buttons">The buttons.</param>
|
/// <param name="buttons">The buttons.</param>
|
||||||
/// <param name="icon">The icon.</param>
|
/// <param name="icon">The icon.</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon) => FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
||||||
{
|
|
||||||
return FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows the specified message box.
|
/// Shows the specified message box.
|
||||||
@@ -207,10 +184,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// <param name="buttons">The buttons.</param>
|
/// <param name="buttons">The buttons.</param>
|
||||||
/// <param name="icon">The icon.</param>
|
/// <param name="icon">The icon.</param>
|
||||||
/// <returns>The dialog result.</returns>
|
/// <returns>The dialog result.</returns>
|
||||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon) => FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
||||||
{
|
|
||||||
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows the specified message box.
|
/// Shows the specified message box.
|
||||||
@@ -221,10 +195,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// <param name="icon">The icon.</param>
|
/// <param name="icon">The icon.</param>
|
||||||
/// <param name="defaultButton">The default button.</param>
|
/// <param name="defaultButton">The default button.</param>
|
||||||
/// <returns>The dialog result.</returns>
|
/// <returns>The dialog result.</returns>
|
||||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton) => FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, defaultButton);
|
||||||
{
|
|
||||||
return FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, defaultButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows the specified message box.
|
/// Shows the specified message box.
|
||||||
@@ -236,10 +207,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// <param name="icon">The icon.</param>
|
/// <param name="icon">The icon.</param>
|
||||||
/// <param name="defaultButton">The default button.</param>
|
/// <param name="defaultButton">The default button.</param>
|
||||||
/// <returns>The dialog result.</returns>
|
/// <returns>The dialog result.</returns>
|
||||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton) => FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, defaultButton);
|
||||||
{
|
|
||||||
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, defaultButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shows the specified message box.
|
/// Shows the specified message box.
|
||||||
@@ -251,10 +219,8 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// <param name="icon">The icon.</param>
|
/// <param name="icon">The icon.</param>
|
||||||
/// <param name="defaultButton">The default button.</param>
|
/// <param name="defaultButton">The default button.</param>
|
||||||
/// <returns>The dialog result.</returns>
|
/// <returns>The dialog result.</returns>
|
||||||
public static DialogResult ShowCustom(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping owner for legacy reasons")]
|
||||||
{
|
public static DialogResult ShowCustom(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon) => FlexibleMessageBoxForm.ShowCustom(null, text, caption, buttons, icon);
|
||||||
return FlexibleMessageBoxForm.ShowCustom(null, text, caption, buttons, icon);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -341,7 +307,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
this.richTextBoxMessage.TabIndex = 0;
|
this.richTextBoxMessage.TabIndex = 0;
|
||||||
this.richTextBoxMessage.TabStop = false;
|
this.richTextBoxMessage.TabStop = false;
|
||||||
this.richTextBoxMessage.Text = "<Message>";
|
this.richTextBoxMessage.Text = "<Message>";
|
||||||
this.richTextBoxMessage.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.richTextBoxMessage_LinkClicked);
|
this.richTextBoxMessage.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.RichTextBoxMessage_LinkClicked);
|
||||||
//
|
//
|
||||||
// panel1
|
// panel1
|
||||||
//
|
//
|
||||||
@@ -431,8 +397,8 @@ namespace JR.Utils.GUI.Forms
|
|||||||
#region Private constants
|
#region Private constants
|
||||||
|
|
||||||
//These separators are used for the "copy to clipboard" standard operation, triggered by Ctrl + C (behavior and clipboard format is like in a standard MessageBox)
|
//These separators are used for the "copy to clipboard" standard operation, triggered by Ctrl + C (behavior and clipboard format is like in a standard MessageBox)
|
||||||
private static readonly String STANDARD_MESSAGEBOX_SEPARATOR_LINES = "---------------------------\n";
|
private static readonly string STANDARD_MESSAGEBOX_SEPARATOR_LINES = "---------------------------\n";
|
||||||
private static readonly String STANDARD_MESSAGEBOX_SEPARATOR_SPACES = " ";
|
private static readonly string STANDARD_MESSAGEBOX_SEPARATOR_SPACES = " ";
|
||||||
|
|
||||||
//These are the possible buttons (in a standard MessageBox)
|
//These are the possible buttons (in a standard MessageBox)
|
||||||
private enum ButtonID { OK = 0, CANCEL, YES, NO, ABORT, RETRY, IGNORE, OVERWRITE, RENAME };
|
private enum ButtonID { OK = 0, CANCEL, YES, NO, ABORT, RETRY, IGNORE, OVERWRITE, RENAME };
|
||||||
@@ -440,10 +406,10 @@ namespace JR.Utils.GUI.Forms
|
|||||||
//These are the buttons texts for different languages.
|
//These are the buttons texts for different languages.
|
||||||
//If you want to add a new language, add it here and in the GetButtonText-Function
|
//If you want to add a new language, add it here and in the GetButtonText-Function
|
||||||
private enum TwoLetterISOLanguageID { en, de, es, it };
|
private enum TwoLetterISOLanguageID { en, de, es, it };
|
||||||
private static readonly String[] BUTTON_TEXTS_ENGLISH_EN = { "OK", "Cancel", "&Yes", "&No", "&Abort", "&Retry", "&Ignore", "&Overwrite", "&Rename" }; //Note: This is also the fallback language
|
private static readonly string[] BUTTON_TEXTS_ENGLISH_EN = { "OK", "Cancel", "&Yes", "&No", "&Abort", "&Retry", "&Ignore", "&Overwrite", "&Rename" }; //Note: This is also the fallback language
|
||||||
private static readonly String[] BUTTON_TEXTS_GERMAN_DE = { "OK", "Abbrechen", "&Ja", "&Nein", "&Abbrechen", "&Wiederholen", "&Ignorieren", "&Overwrite", "&Rename" };
|
private static readonly string[] BUTTON_TEXTS_GERMAN_DE = { "OK", "Abbrechen", "&Ja", "&Nein", "&Abbrechen", "&Wiederholen", "&Ignorieren", "&Overwrite", "&Rename" };
|
||||||
private static readonly String[] BUTTON_TEXTS_SPANISH_ES = { "Aceptar", "Cancelar", "&Sí", "&No", "&Abortar", "&Reintentar", "&Ignorar", "&Overwrite", "&Rename" };
|
private static readonly string[] BUTTON_TEXTS_SPANISH_ES = { "Aceptar", "Cancelar", "&Sí", "&No", "&Abortar", "&Reintentar", "&Ignorar", "&Overwrite", "&Rename" };
|
||||||
private static readonly String[] BUTTON_TEXTS_ITALIAN_IT = { "OK", "Annulla", "&Sì", "&No", "&Interrompi", "&Riprova", "&Ignora", "&Overwrite", "&Rename" };
|
private static readonly string[] BUTTON_TEXTS_ITALIAN_IT = { "OK", "Annulla", "&Sì", "&No", "&Interrompi", "&Riprova", "&Ignora", "&Overwrite", "&Rename" };
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -451,7 +417,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
|
|
||||||
private MessageBoxDefaultButton defaultButton;
|
private MessageBoxDefaultButton defaultButton;
|
||||||
private int visibleButtonsCount;
|
private int visibleButtonsCount;
|
||||||
private TwoLetterISOLanguageID languageID = TwoLetterISOLanguageID.en;
|
private readonly TwoLetterISOLanguageID languageID = TwoLetterISOLanguageID.en;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -758,9 +724,9 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
|
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
|
||||||
private void FlexibleMessageBoxForm_Shown(object sender, EventArgs e)
|
private void FlexibleMessageBoxForm_Shown(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
int buttonIndexToFocus = 1;
|
|
||||||
Button buttonToFocus;
|
Button buttonToFocus;
|
||||||
|
|
||||||
|
int buttonIndexToFocus;
|
||||||
//Set the default button...
|
//Set the default button...
|
||||||
switch (this.defaultButton)
|
switch (this.defaultButton)
|
||||||
{
|
{
|
||||||
@@ -799,7 +765,7 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender">The source of the event.</param>
|
/// <param name="sender">The source of the event.</param>
|
||||||
/// <param name="e">The <see cref="System.Windows.Forms.LinkClickedEventArgs"/> instance containing the event data.</param>
|
/// <param name="e">The <see cref="System.Windows.Forms.LinkClickedEventArgs"/> instance containing the event data.</param>
|
||||||
private void richTextBoxMessage_LinkClicked(object sender, LinkClickedEventArgs e)
|
private void RichTextBoxMessage_LinkClicked(object sender, LinkClickedEventArgs e)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -877,12 +843,14 @@ namespace JR.Utils.GUI.Forms
|
|||||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
||||||
{
|
{
|
||||||
//Create a new instance of the FlexibleMessageBox form
|
//Create a new instance of the FlexibleMessageBox form
|
||||||
var flexibleMessageBoxForm = new FlexibleMessageBoxForm();
|
var flexibleMessageBoxForm = new FlexibleMessageBoxForm
|
||||||
flexibleMessageBoxForm.ShowInTaskbar = false;
|
{
|
||||||
|
ShowInTaskbar = false,
|
||||||
|
|
||||||
//Bind the caption and the message text
|
//Bind the caption and the message text
|
||||||
flexibleMessageBoxForm.CaptionText = caption;
|
CaptionText = caption,
|
||||||
flexibleMessageBoxForm.MessageText = text;
|
MessageText = text
|
||||||
|
};
|
||||||
flexibleMessageBoxForm.FlexibleMessageBoxFormBindingSource.DataSource = flexibleMessageBoxForm;
|
flexibleMessageBoxForm.FlexibleMessageBoxFormBindingSource.DataSource = flexibleMessageBoxForm;
|
||||||
|
|
||||||
//Set the buttons visibilities and texts. Also set a default button.
|
//Set the buttons visibilities and texts. Also set a default button.
|
||||||
@@ -914,15 +882,18 @@ namespace JR.Utils.GUI.Forms
|
|||||||
/// <param name="icon">The icon.</param>
|
/// <param name="icon">The icon.</param>
|
||||||
/// <param name="defaultButton">The default button.</param>
|
/// <param name="defaultButton">The default button.</param>
|
||||||
/// <returns>The dialog result.</returns>
|
/// <returns>The dialog result.</returns>
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping buttons for legacy reasons")]
|
||||||
public static DialogResult ShowCustom(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
public static DialogResult ShowCustom(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
||||||
{
|
{
|
||||||
//Create a new instance of the FlexibleMessageBox form
|
//Create a new instance of the FlexibleMessageBox form
|
||||||
var flexibleMessageBoxForm = new FlexibleMessageBoxForm();
|
var flexibleMessageBoxForm = new FlexibleMessageBoxForm
|
||||||
flexibleMessageBoxForm.ShowInTaskbar = false;
|
{
|
||||||
|
ShowInTaskbar = false,
|
||||||
|
|
||||||
//Bind the caption and the message text
|
//Bind the caption and the message text
|
||||||
flexibleMessageBoxForm.CaptionText = caption;
|
CaptionText = caption,
|
||||||
flexibleMessageBoxForm.MessageText = text;
|
MessageText = text
|
||||||
|
};
|
||||||
flexibleMessageBoxForm.FlexibleMessageBoxFormBindingSource.DataSource = flexibleMessageBoxForm;
|
flexibleMessageBoxForm.FlexibleMessageBoxFormBindingSource.DataSource = flexibleMessageBoxForm;
|
||||||
|
|
||||||
//Set the buttons visibilities and texts. Also set a default button.
|
//Set the buttons visibilities and texts. Also set a default button.
|
||||||
|
|||||||
@@ -66,6 +66,7 @@
|
|||||||
<Compile Include="frmFormatCopy.Designer.cs">
|
<Compile Include="frmFormatCopy.Designer.cs">
|
||||||
<DependentUpon>frmFormatCopy.cs</DependentUpon>
|
<DependentUpon>frmFormatCopy.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="GlobalSuppressions.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<EmbeddedResource Include="frmFormatCopy.resx">
|
<EmbeddedResource Include="frmFormatCopy.resx">
|
||||||
@@ -179,6 +180,7 @@
|
|||||||
<Content Include="fmtall\CPL_00all.xml" />
|
<Content Include="fmtall\CPL_00all.xml" />
|
||||||
<Content Include="fmtall\CPL_01all.xml" />
|
<Content Include="fmtall\CPL_01all.xml" />
|
||||||
<Content Include="fmtall\CPL_02all.xml" />
|
<Content Include="fmtall\CPL_02all.xml" />
|
||||||
|
<Content Include="fmtall\CPL_04all.xml" />
|
||||||
<Content Include="fmtall\CPL_03all.xml" />
|
<Content Include="fmtall\CPL_03all.xml" />
|
||||||
<Content Include="fmtall\CPSAMGDataall.xml" />
|
<Content Include="fmtall\CPSAMGDataall.xml" />
|
||||||
<Content Include="fmtall\CPSAMGDEVall.xml" />
|
<Content Include="fmtall\CPSAMGDEVall.xml" />
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// This file is used by Code Analysis to maintain SuppressMessage
|
||||||
|
// attributes that are applied to this project.
|
||||||
|
// Project-level suppressions either have no target or are given
|
||||||
|
// a specific target and scoped to a namespace, type, member, etc.
|
||||||
|
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
|
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Not modifying Naming Styles")]
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Formats
|
namespace Formats
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Text;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
@@ -28,7 +23,7 @@ namespace Formats
|
|||||||
txbxPROMSFormatsPath.Text = savedFormatPath;
|
txbxPROMSFormatsPath.Text = savedFormatPath;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string curFolder = Environment.CurrentDirectory; // C:\development/PROMS/Formats/bin/debug
|
string curFolder = Environment.CurrentDirectory; // .../PROMS/Formats/bin/debug
|
||||||
int idx = curFolder.ToUpper().IndexOf(@"\PROMS\");
|
int idx = curFolder.ToUpper().IndexOf(@"\PROMS\");
|
||||||
txbxPROMSFormatsPath.Text = curFolder.Substring(0, idx);
|
txbxPROMSFormatsPath.Text = curFolder.Substring(0, idx);
|
||||||
}
|
}
|
||||||
@@ -40,8 +35,7 @@ namespace Formats
|
|||||||
DirectoryInfo di = new DirectoryInfo(path);
|
DirectoryInfo di = new DirectoryInfo(path);
|
||||||
if (di.Exists == false) //return;
|
if (di.Exists == false) //return;
|
||||||
{
|
{
|
||||||
DialogResult dlgrslt = DialogResult.No;
|
DialogResult dlgrslt = MessageBox.Show(string.Format("{0} does not exist. Create it?", path), "Create Folder?", MessageBoxButtons.YesNo);
|
||||||
dlgrslt = MessageBox.Show(string.Format("{0} does not exist. Create it?", path), "Create Folder?", MessageBoxButtons.YesNo);
|
|
||||||
if (dlgrslt == DialogResult.Yes)
|
if (dlgrslt == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
di.Create();
|
di.Create();
|
||||||
@@ -86,9 +80,10 @@ namespace Formats
|
|||||||
|
|
||||||
private void btnBrowse_Click(object sender, EventArgs e)
|
private void btnBrowse_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
FolderBrowserDialog fbd = new FolderBrowserDialog();
|
FolderBrowserDialog fbd = new FolderBrowserDialog
|
||||||
|
{
|
||||||
fbd.SelectedPath = txbxPROMSFormatsPath.Text;
|
SelectedPath = txbxPROMSFormatsPath.Text
|
||||||
|
};
|
||||||
if (fbd.ShowDialog() == DialogResult.OK)
|
if (fbd.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
if (Directory.Exists(fbd.SelectedPath)) txbxPROMSFormatsPath.Text = fbd.SelectedPath + @"\";
|
if (Directory.Exists(fbd.SelectedPath)) txbxPROMSFormatsPath.Text = fbd.SelectedPath + @"\";
|
||||||
@@ -116,9 +111,9 @@ namespace Formats
|
|||||||
if (!txbxPROMSFormatsPath.Text.EndsWith(@"\")) txbxPROMSFormatsPath.Text += @"\";
|
if (!txbxPROMSFormatsPath.Text.EndsWith(@"\")) txbxPROMSFormatsPath.Text += @"\";
|
||||||
|
|
||||||
// There should be a "fmtall" and "genmacall" folder in the delelopment project folder
|
// There should be a "fmtall" and "genmacall" folder in the delelopment project folder
|
||||||
// ex: C:\development\PROMS\Formats\fmtall and C:\development\PROMS\Formats\genmacall
|
// ex: ...\PROMS\Formats\fmtall and ...\PROMS\Formats\genmacall
|
||||||
string destFmtallPath = txbxPROMSFormatsPath.Text + @"fmtall\";
|
string destFmtallPath = $@"{txbxPROMSFormatsPath.Text}fmtall\";
|
||||||
string destGenmacallPath = txbxPROMSFormatsPath.Text + @"genmacall\";
|
string destGenmacallPath = $@"{txbxPROMSFormatsPath.Text}genmacall\";
|
||||||
string srcFmtallPath = @"..\..\"; // up to levels from startup path
|
string srcFmtallPath = @"..\..\"; // up to levels from startup path
|
||||||
|
|
||||||
// clear the destination fmtall and genmacall folders
|
// clear the destination fmtall and genmacall folders
|
||||||
@@ -156,14 +151,10 @@ namespace Formats
|
|||||||
}
|
}
|
||||||
Properties.Settings.Default.FormatPath = txbxPROMSFormatsPath.Text.Substring(0,txbxPROMSFormatsPath.Text.Length-1); // save the copy format path minus the ending backslash
|
Properties.Settings.Default.FormatPath = txbxPROMSFormatsPath.Text.Substring(0,txbxPROMSFormatsPath.Text.Length-1); // save the copy format path minus the ending backslash
|
||||||
Properties.Settings.Default.Save();
|
Properties.Settings.Default.Save();
|
||||||
//if(MessageBox.Show("Do you want to end the Format Copier?","Formats Copied.", MessageBoxButtons.YesNo, MessageBoxIcon.Question)== DialogResult.Yes)
|
|
||||||
Application.Exit();
|
Application.Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonX2_Click(object sender, EventArgs e)
|
private void buttonX2_Click(object sender, EventArgs e) => Application.Exit();
|
||||||
{
|
|
||||||
Application.Exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,8 @@
|
|||||||
|
// This file is used by Code Analysis to maintain SuppressMessage
|
||||||
|
// attributes that are applied to this project.
|
||||||
|
// Project-level suppressions either have no target or are given
|
||||||
|
// a specific target and scoped to a namespace, type, member, etc.
|
||||||
|
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
|
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Not modifying Naming Styles")]
|
||||||
+250
-820
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
|||||||
|
using Microsoft.Win32;
|
||||||
|
using Read64bitRegistryFrom32bitApp;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Microsoft.Win32;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Read64bitRegistryFrom32bitApp;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace LBWordLibrary
|
namespace LBWordLibrary
|
||||||
{
|
{
|
||||||
@@ -18,14 +18,8 @@ namespace LBWordLibrary
|
|||||||
/// <param name="Background">boolean BackGround
|
/// <param name="Background">boolean BackGround
|
||||||
/// If true - document will be printed in the background
|
/// If true - document will be printed in the background
|
||||||
/// If false - document will be printed in the foreground</param>
|
/// If false - document will be printed in the foreground</param>
|
||||||
public void PrintOut(Boolean Background)
|
public void PrintOut(bool Background) => InvokeMethod("PrintOut", Background, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
|
||||||
{
|
public void Quit(bool save) => InvokeMethod("Quit", save, Missing.Value, Missing.Value);
|
||||||
InvokeMethod("PrintOut", Background, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
|
|
||||||
}
|
|
||||||
public void Quit(bool save)
|
|
||||||
{
|
|
||||||
InvokeMethod("Quit", save, Missing.Value, Missing.Value);
|
|
||||||
}
|
|
||||||
public bool VolianPDFInstalled
|
public bool VolianPDFInstalled
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -51,63 +45,23 @@ namespace LBWordLibrary
|
|||||||
string keyPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\0E5C161912A2A6C4C93C76678926C56C";
|
string keyPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\0E5C161912A2A6C4C93C76678926C56C";
|
||||||
bool validKey = RegistryWOW6432.CheckRegKey64Valid(RegHive.HKEY_LOCAL_MACHINE, keyPath);
|
bool validKey = RegistryWOW6432.CheckRegKey64Valid(RegHive.HKEY_LOCAL_MACHINE, keyPath);
|
||||||
_WordPDFExporterInstalled = validKey;
|
_WordPDFExporterInstalled = validKey;
|
||||||
if(!validKey)
|
if (!validKey)
|
||||||
_MyLog.WarnFormat("MSWord2007 PDF Export Registry Key Missing");
|
_MyLog.WarnFormat("MSWord2007 PDF Export Registry Key Missing");
|
||||||
//RegistryKey key = Registry.LocalMachine.OpenSubKey(keyPath, RegistryKeyPermissionCheck.ReadSubTree);
|
|
||||||
//if (key == null)
|
return (bool)_WordPDFExporterInstalled;
|
||||||
//{
|
|
||||||
// RegistryKey localMachine64 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
|
|
||||||
// key = localMachine64.OpenSubKey(keystring, RegistryKeyPermissionCheck.ReadSubTree);
|
|
||||||
//}
|
|
||||||
//if (key != null)
|
|
||||||
//{
|
|
||||||
// key.Close();
|
|
||||||
// _WordPDFExporterInstalled = true;
|
|
||||||
// return (bool) _WordPDFExporterInstalled;
|
|
||||||
//}
|
|
||||||
//_WordPDFExporterInstalled = FindEXP_PDF();
|
|
||||||
return (bool) _WordPDFExporterInstalled;
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_MyLog.WarnFormat("MSWord2007 PDF Export Registry Key Failure {0} - {1}", ex.GetType().Name, ex.Message);
|
_MyLog.WarnFormat("MSWord2007 PDF Export Registry Key Failure {0} - {1}", ex.GetType().Name, ex.Message);
|
||||||
_WordPDFExporterInstalled = false;
|
_WordPDFExporterInstalled = false;
|
||||||
return (bool) _WordPDFExporterInstalled;
|
return (bool)_WordPDFExporterInstalled;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return (bool) _WordPDFExporterInstalled;
|
return (bool)_WordPDFExporterInstalled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static bool FindEXP_PDF()
|
|
||||||
{
|
|
||||||
bool retval = false;
|
|
||||||
DateTime dtStart = DateTime.Now;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//string keystr = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\0E5C161912A2A6C4C93C76678926C56C";
|
|
||||||
RegistryKey key = null;
|
|
||||||
string keystr = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components";
|
|
||||||
while (key == null && keystr != "")
|
|
||||||
{
|
|
||||||
key = Registry.LocalMachine.OpenSubKey(keystr, RegistryKeyPermissionCheck.ReadSubTree);
|
|
||||||
keystr = keystr.Substring(0, keystr.LastIndexOf("\\"));
|
|
||||||
}
|
|
||||||
if (FindKeys(key, "EXP_PDF.DLL"))
|
|
||||||
retval = true;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
AddKeyFound(string.Format("{0} - {1}", ex.GetType().Name, ex.Message));
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
DateTime dtEnd = DateTime.Now;
|
|
||||||
TimeSpan ts = TimeSpan.FromTicks(dtEnd.Ticks - dtStart.Ticks);
|
|
||||||
AddKeyFound(string.Format("{0} Seconds", ts.TotalSeconds));
|
|
||||||
}
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
private static bool FindKeys(RegistryKey key, string find)
|
private static bool FindKeys(RegistryKey key, string find)
|
||||||
{
|
{
|
||||||
string[] keyNames = key.GetSubKeyNames();
|
string[] keyNames = key.GetSubKeyNames();
|
||||||
@@ -144,10 +98,7 @@ namespace LBWordLibrary
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
private static void AddKeyFound(string str)
|
private static void AddKeyFound(string str) => _MyLog.WarnFormat("RegistryKeySearch: {0}", str);
|
||||||
{
|
|
||||||
_MyLog.WarnFormat("RegistryKeySearch: {0}",str);
|
|
||||||
}
|
|
||||||
private bool CanCreatePDFFile(string pdfFileName)
|
private bool CanCreatePDFFile(string pdfFileName)
|
||||||
{
|
{
|
||||||
System.IO.FileInfo file = new System.IO.FileInfo(pdfFileName);
|
System.IO.FileInfo file = new System.IO.FileInfo(pdfFileName);
|
||||||
@@ -178,20 +129,18 @@ namespace LBWordLibrary
|
|||||||
}
|
}
|
||||||
throw new Exception("Cannot find a name to use");
|
throw new Exception("Cannot find a name to use");
|
||||||
}
|
}
|
||||||
public string CreatePDF(string pdfFileName, bool openPDF,int DebugStatus)
|
public string CreatePDF(string pdfFileName, bool openPDF, int DebugStatus)
|
||||||
{
|
{
|
||||||
pdfFileName = CreatePDF(pdfFileName, DebugStatus);
|
pdfFileName = CreatePDF(pdfFileName, DebugStatus);
|
||||||
if (openPDF) OpenPDF(pdfFileName);
|
if (openPDF) OpenPDF(pdfFileName);
|
||||||
return pdfFileName;
|
return pdfFileName;
|
||||||
}
|
}
|
||||||
static List<System.Diagnostics.Process> _AcrobatProcesses=new List<System.Diagnostics.Process>();
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private static void OpenPDF(string pdfFileName)
|
static List<System.Diagnostics.Process> _AcrobatProcesses = new List<System.Diagnostics.Process>();
|
||||||
{
|
private static void OpenPDF(string pdfFileName) => _AcrobatProcesses.Add(System.Diagnostics.Process.Start(pdfFileName));
|
||||||
_AcrobatProcesses.Add(System.Diagnostics.Process.Start(pdfFileName));
|
|
||||||
}
|
|
||||||
public static void ClosePDFs()
|
public static void ClosePDFs()
|
||||||
{
|
{
|
||||||
foreach(System.Diagnostics.Process proc in _AcrobatProcesses)
|
foreach (System.Diagnostics.Process proc in _AcrobatProcesses)
|
||||||
if (!proc.HasExited)
|
if (!proc.HasExited)
|
||||||
KillAndWait(proc);
|
KillAndWait(proc);
|
||||||
}
|
}
|
||||||
@@ -206,7 +155,7 @@ namespace LBWordLibrary
|
|||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
}
|
}
|
||||||
Console.WriteLine("{0:yyyy-MM-dd HH:mm:ss.ffff} {1:yyyy-MM-dd HH:mm:ss.ffff} {2}", DateTime.Now, proc.ExitTime
|
Console.WriteLine("{0:yyyy-MM-dd HH:mm:ss.ffff} {1:yyyy-MM-dd HH:mm:ss.ffff} {2}", DateTime.Now, proc.ExitTime
|
||||||
,TimeSpan.FromTicks(proc.ExitTime.Ticks - tStart.Ticks).TotalMilliseconds);
|
, TimeSpan.FromTicks(proc.ExitTime.Ticks - tStart.Ticks).TotalMilliseconds);
|
||||||
}
|
}
|
||||||
public string CreatePDF(string pdfFileName, int DebugStatus)
|
public string CreatePDF(string pdfFileName, int DebugStatus)
|
||||||
{
|
{
|
||||||
@@ -223,12 +172,7 @@ namespace LBWordLibrary
|
|||||||
_MyLog.WarnFormat("Using VolianPDFWriter - MSWord Version = '{0}'", Version);
|
_MyLog.WarnFormat("Using VolianPDFWriter - MSWord Version = '{0}'", Version);
|
||||||
return CreatePDF2003BG(pdfFileName);
|
return CreatePDF2003BG(pdfFileName);
|
||||||
}
|
}
|
||||||
//else // Force PDF Export
|
|
||||||
//{
|
|
||||||
// _MyLog.WarnFormat("Force PDF Export for Michelle - MSWord Version = '{0}'", Version);
|
|
||||||
// return CreatePDF2007(pdfFileName, DebugStatus);
|
|
||||||
throw new Exception("No PDF Writer support installed for MS Word sections");
|
throw new Exception("No PDF Writer support installed for MS Word sections");
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
public string CreatePDF2003FG(string pdfFileName, bool openPDF)
|
public string CreatePDF2003FG(string pdfFileName, bool openPDF)
|
||||||
{
|
{
|
||||||
@@ -299,12 +243,9 @@ namespace LBWordLibrary
|
|||||||
if (openPDF) OpenPDF(pdfFileName);
|
if (openPDF) OpenPDF(pdfFileName);
|
||||||
return pdfFileName;
|
return pdfFileName;
|
||||||
}
|
}
|
||||||
public string CreatePDF2007(string pdfFileName,int DebugStatus)
|
public string CreatePDF2007(string pdfFileName, int DebugStatus)
|
||||||
{
|
{
|
||||||
pdfFileName = AvailableFileName(pdfFileName);
|
pdfFileName = AvailableFileName(pdfFileName);
|
||||||
// Removed to support MSWord 2010 and beyond.
|
|
||||||
//if (!WordPDFExporterInstalled)
|
|
||||||
// throw new Exception("MS Word PDF Exporter is not installed");
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ActiveDocument.ExportAsFixedFormat(pdfFileName, LBWdExportFormat.wdExportFormatPDF, DebugStatus);
|
ActiveDocument.ExportAsFixedFormat(pdfFileName, LBWdExportFormat.wdExportFormatPDF, DebugStatus);
|
||||||
@@ -318,14 +259,8 @@ namespace LBWordLibrary
|
|||||||
}
|
}
|
||||||
public partial class LBDocuments
|
public partial class LBDocuments
|
||||||
{
|
{
|
||||||
public LBDocumentClass Open(string fileName, Boolean addToRecentFiles)
|
public LBDocumentClass Open(string fileName, bool addToRecentFiles) => Open(fileName, Missing.Value, Missing.Value, addToRecentFiles);
|
||||||
{
|
private LBDocumentClass Open(params object[] myParams) => new LBDocumentClass(InvokeMethod("Open", myParams));
|
||||||
return Open(fileName, Missing.Value, Missing.Value, addToRecentFiles);
|
|
||||||
}
|
|
||||||
private LBDocumentClass Open(params object[] myParams)
|
|
||||||
{
|
|
||||||
return new LBDocumentClass(InvokeMethod("Open", myParams));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class LBDocumentClass : LBComObject
|
public partial class LBDocumentClass : LBComObject
|
||||||
{
|
{
|
||||||
@@ -345,10 +280,7 @@ namespace LBWordLibrary
|
|||||||
else
|
else
|
||||||
SaveAs2000(fileName);
|
SaveAs2000(fileName);
|
||||||
}
|
}
|
||||||
public void SaveAs2000(params object[] myParams)
|
public void SaveAs2000(params object[] myParams) => InvokeMethod("SaveAs2000", myParams);
|
||||||
{
|
|
||||||
InvokeMethod("SaveAs2000", myParams);
|
|
||||||
}
|
|
||||||
public void SaveAs(string fileName)
|
public void SaveAs(string fileName)
|
||||||
{
|
{
|
||||||
if (fileName.ToUpper().EndsWith("DOC"))
|
if (fileName.ToUpper().EndsWith("DOC"))
|
||||||
@@ -362,18 +294,9 @@ namespace LBWordLibrary
|
|||||||
else
|
else
|
||||||
SaveAs2(fileName, Missing.Value, Missing.Value, Missing.Value, false);
|
SaveAs2(fileName, Missing.Value, Missing.Value, Missing.Value, false);
|
||||||
}
|
}
|
||||||
public void SaveAs2(params object[] myParams)
|
public void SaveAs2(params object[] myParams) => InvokeMethod("SaveAs", myParams);
|
||||||
{
|
public void SaveAs(string fileName, LBWdSaveFormat format) => SaveAs2(fileName, format, Missing.Value, Missing.Value, false);
|
||||||
InvokeMethod("SaveAs", myParams);
|
public LBRange Range(int Start, int End) => new LBRange(InvokeMethod("Range", Start, End));
|
||||||
}
|
|
||||||
public void SaveAs(string fileName, LBWdSaveFormat format)
|
|
||||||
{
|
|
||||||
SaveAs2(fileName, format, Missing.Value, Missing.Value, false);
|
|
||||||
}
|
|
||||||
public LBRange Range(int Start, int End)
|
|
||||||
{
|
|
||||||
return new LBRange(InvokeMethod("Range", Start, End));
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Length is Pages and Partial Pages
|
/// Length is Pages and Partial Pages
|
||||||
/// The integral part is the number of full pages
|
/// The integral part is the number of full pages
|
||||||
@@ -393,11 +316,6 @@ namespace LBWordLibrary
|
|||||||
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToAbsolute, 0);
|
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToAbsolute, 0);
|
||||||
float mytop = myRange.PageSetup.TopMargin;
|
float mytop = myRange.PageSetup.TopMargin;
|
||||||
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
|
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
|
||||||
//float partial = (float) myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToTextBoundary);
|
|
||||||
// B2018-028 Word 2016 has a different value for the Vertical Position Relative to the Text Boundary than older version of Word.
|
|
||||||
// We now need to calculated the last row of text in the PROMS attachment differently.
|
|
||||||
// We now subtract the TopMargin the Page Setup from the Vertical Position Relative to the Page
|
|
||||||
// this works with older versions of MS Word as well.
|
|
||||||
float partial = (float)myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage) - mytop;
|
float partial = (float)myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage) - mytop;
|
||||||
partial += myRange.Font.Size;
|
partial += myRange.Font.Size;
|
||||||
retval += partial / 7200;
|
retval += partial / 7200;
|
||||||
@@ -414,7 +332,7 @@ namespace LBWordLibrary
|
|||||||
return ReplaceSymbolCharacters(GetRangeText(myRange));
|
return ReplaceSymbolCharacters(GetRangeText(myRange));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static string[] SymbolFontName = { "VolianDraw", "WingDings", "VESymb", "VESymbFix", "Symbol" };
|
private static readonly string[] SymbolFontName = { "VolianDraw", "WingDings", "VESymb", "VESymbFix", "Symbol" };
|
||||||
private static bool IsSymbolFont(string fontName)
|
private static bool IsSymbolFont(string fontName)
|
||||||
{
|
{
|
||||||
foreach (string symbolFont in SymbolFontName)
|
foreach (string symbolFont in SymbolFontName)
|
||||||
@@ -422,150 +340,6 @@ namespace LBWordLibrary
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// If document contains symbol characters, returns problem font.
|
|
||||||
/// </summary>
|
|
||||||
public string FontHasSymbolCharacters
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
LBRange myRange = Range();
|
|
||||||
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
|
|
||||||
myRange.Start = 0;
|
|
||||||
int end = myRange.End;
|
|
||||||
string myText = GetRangeText(myRange);
|
|
||||||
//return _RegFindSymbol.IsMatch(myText);
|
|
||||||
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
|
||||||
int offset = 0;
|
|
||||||
List<string> alreadyProcessed = new List<string>();
|
|
||||||
List<string> fontHasSymbols = new List<string>();
|
|
||||||
foreach (Match problem in problems)
|
|
||||||
{
|
|
||||||
if (!alreadyProcessed.Contains(problem.Value))
|
|
||||||
{
|
|
||||||
myRange.Start = problem.Index + offset;
|
|
||||||
myRange.End = problem.Index + problem.Length + offset;
|
|
||||||
int newOffset = FindRangeOffset(myRange, problem, offset, end);
|
|
||||||
string fontName = myRange.Font.Name;
|
|
||||||
if (IsSymbolFont(fontName))
|
|
||||||
{
|
|
||||||
if( !fontHasSymbols.Contains(fontName))
|
|
||||||
{
|
|
||||||
fontHasSymbols.Add(fontName);
|
|
||||||
// Found symbol font
|
|
||||||
_MyLog.InfoFormat("Font '{0}' has Symbols", fontName);
|
|
||||||
}
|
|
||||||
//Console.WriteLine("Font '{0}' has Symbols", myRange.Font.Name);
|
|
||||||
//return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return myRange.Font.Name;
|
|
||||||
offset = newOffset;
|
|
||||||
alreadyProcessed.Add(problem.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Debug Tool - Return a string containing a list of the fonts that have symbol characters.
|
|
||||||
/// </summary>
|
|
||||||
public string FontsHaveSymbolCharacters
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string sep = "";
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
List<string> fonts=new List<string>();
|
|
||||||
LBRange myRange = Range();
|
|
||||||
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
|
|
||||||
myRange.Start = 0;
|
|
||||||
int end = myRange.End;
|
|
||||||
string myText = GetRangeText(myRange);
|
|
||||||
//return _RegFindSymbol.IsMatch(myText);
|
|
||||||
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
|
||||||
int offset = 0;
|
|
||||||
foreach (Match problem in problems)
|
|
||||||
{
|
|
||||||
myRange.Start = problem.Index + offset;
|
|
||||||
myRange.End = problem.Index + problem.Length + offset;
|
|
||||||
int newOffset = FindRangeOffset(myRange, problem, offset, end);
|
|
||||||
if (!fonts.Contains(myRange.Font.Name))
|
|
||||||
{
|
|
||||||
fonts.Add(myRange.Font.Name);
|
|
||||||
sb.Append(sep + "'" + myRange.Font.Name + "'");
|
|
||||||
sep = ",";
|
|
||||||
}
|
|
||||||
offset = newOffset;
|
|
||||||
}
|
|
||||||
if (sb.Length > 0) return sb.ToString();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Debug Tool - Return a list of symbol characters using VESYMB font.
|
|
||||||
/// </summary>
|
|
||||||
public string FontsHaveSymbolCharacters2
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Dictionary<string, List<int>> fonts = new Dictionary<string, List<int>>();
|
|
||||||
LBRange myRange = Range();
|
|
||||||
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
|
|
||||||
myRange.Start = 0;
|
|
||||||
int end = myRange.End;
|
|
||||||
string myText = GetRangeText(myRange);
|
|
||||||
//return _RegFindSymbol.IsMatch(myText);
|
|
||||||
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
|
||||||
int offset = 0;
|
|
||||||
foreach (Match problem in problems)
|
|
||||||
{
|
|
||||||
myRange.Start = problem.Index + offset;
|
|
||||||
myRange.End = problem.Index + problem.Length + offset;
|
|
||||||
int newOffset = FindRangeOffset(myRange, problem, offset, end);
|
|
||||||
string sFont = myRange.Font.Name;
|
|
||||||
if (sFont.ToUpper().StartsWith("VESYM"))
|
|
||||||
{
|
|
||||||
if (!fonts.ContainsKey(sFont))
|
|
||||||
{
|
|
||||||
fonts.Add(sFont, new List<int>());
|
|
||||||
}
|
|
||||||
List<int> symbols = fonts[sFont];
|
|
||||||
string myTextSymb = GetRangeText(myRange);
|
|
||||||
foreach (char c in myTextSymb)
|
|
||||||
{
|
|
||||||
if (!symbols.Contains((int)c))
|
|
||||||
symbols.Add((int)c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
offset = newOffset;
|
|
||||||
}
|
|
||||||
if (fonts.Count > 0)
|
|
||||||
{
|
|
||||||
string sep = "";
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
foreach (string font in fonts.Keys)
|
|
||||||
{
|
|
||||||
sb.Append(sep + "'" + font + "'");
|
|
||||||
sep = ",";
|
|
||||||
foreach (int i in fonts[font])
|
|
||||||
{
|
|
||||||
sb.Append(sep);
|
|
||||||
sb.Append(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sb.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine("{0},{1},{2}", ex.GetType().Name, ex.Message, ex.StackTrace);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks to see if the document contains symbol characters
|
/// Checks to see if the document contains symbol characters
|
||||||
@@ -580,7 +354,6 @@ namespace LBWordLibrary
|
|||||||
myRange.Start = 0;
|
myRange.Start = 0;
|
||||||
int end = myRange.End;
|
int end = myRange.End;
|
||||||
string myText = GetRangeText(myRange);
|
string myText = GetRangeText(myRange);
|
||||||
//return _RegFindSymbol.IsMatch(myText);
|
|
||||||
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
foreach (Match problem in problems)
|
foreach (Match problem in problems)
|
||||||
@@ -591,7 +364,6 @@ namespace LBWordLibrary
|
|||||||
if (IsSymbolFont(myRange.Font.Name))
|
if (IsSymbolFont(myRange.Font.Name))
|
||||||
{
|
{
|
||||||
Console.WriteLine("Font '{0}' has Symbols", myRange.Font.Name);
|
Console.WriteLine("Font '{0}' has Symbols", myRange.Font.Name);
|
||||||
//return true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
@@ -600,87 +372,8 @@ namespace LBWordLibrary
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Regex _RegFindSymbol = new Regex("[\\uF020-\\uF07F]+");
|
readonly Regex _RegFindSymbol = new Regex("[\\uF020-\\uF07F]+");
|
||||||
/// <summary>
|
|
||||||
/// FixSymbolCharacters - Fix any symbol characters in the document
|
|
||||||
/// </summary>
|
|
||||||
public void FixSymbolCharacters()
|
|
||||||
{
|
|
||||||
// Set up range object to be used to process text
|
|
||||||
LBRange myRange = Range();
|
|
||||||
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
|
|
||||||
int end = myRange.End;
|
|
||||||
myRange.Start = 0;
|
|
||||||
string myText = GetRangeText(myRange);
|
|
||||||
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
|
||||||
int offset = 0;
|
|
||||||
foreach (Match problem in problems)
|
|
||||||
{
|
|
||||||
myRange.Start = problem.Index + offset;
|
|
||||||
myRange.End = problem.Index + problem.Length + offset;
|
|
||||||
int newOffset = FindRangeOffset(myRange, problem, offset, end);
|
|
||||||
if (myRange.Font.Name == "")
|
|
||||||
{
|
|
||||||
int wrdStart = myRange.Start;
|
|
||||||
int wrdEnd = myRange.End;
|
|
||||||
int wrdMiddle = wrdStart;
|
|
||||||
while (myRange.Font.Name == "")
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
myRange.End = ++wrdMiddle;
|
|
||||||
} while(myRange.Font.Name != "");
|
|
||||||
myRange.End = wrdMiddle - 1;
|
|
||||||
ReplaceSymbolCharacters(myRange);
|
|
||||||
myRange.Start = wrdMiddle -1;
|
|
||||||
myRange.End = wrdEnd;
|
|
||||||
}
|
|
||||||
ReplaceSymbolCharacters(myRange);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ReplaceSymbolCharacters(myRange);
|
|
||||||
}
|
|
||||||
offset = newOffset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Try to fix the first character in the symbol range F000 to F0FF. If it cannot be
|
|
||||||
/// fixed, it is an indicator that the font is not installed properly. Regardless of
|
|
||||||
/// whether there is success, the change is undone so that the document will not be
|
|
||||||
/// considered dirty, i.e. will not prompt user for save.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool AttemptToFixASymbolCharacter()
|
|
||||||
{
|
|
||||||
// Set up range object to be used to process text
|
|
||||||
LBRange myRange = Range();
|
|
||||||
myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100);
|
|
||||||
|
|
||||||
int end = myRange.End;
|
|
||||||
myRange.Start = 0;
|
|
||||||
string myText = GetRangeText(myRange);
|
|
||||||
MatchCollection problems = _RegFindSymbol.Matches(myText);
|
|
||||||
if (problems.Count>0)
|
|
||||||
{
|
|
||||||
Match problem = problems[0];
|
|
||||||
myRange.Start = problem.Index;
|
|
||||||
myRange.End = myRange.Start + 1;
|
|
||||||
if (IsSymbolFont(myRange.Font.Name)) return true; // if it's a symbol font already, no issue.
|
|
||||||
string before = GetRangeText(myRange);
|
|
||||||
string updated = ReplaceSymbolCharacters(before);
|
|
||||||
myRange.Text = updated;
|
|
||||||
string after = GetRangeText(myRange);
|
|
||||||
Undo(1);
|
|
||||||
//Console.WriteLine("Undo1 results = {0}", tst);
|
|
||||||
//tst = Undo(1);
|
|
||||||
//Console.WriteLine("Undo2 results = {0}", tst);
|
|
||||||
//tst = Undo(1);
|
|
||||||
//Console.WriteLine("Undo3 results = {0}", tst);
|
|
||||||
return (updated == after);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the Range Text with error handling. myRange.Text sometimes will get a null reference exception.
|
/// Get the Range Text with error handling. myRange.Text sometimes will get a null reference exception.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -688,7 +381,7 @@ namespace LBWordLibrary
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal static string GetRangeText(LBRange myRange)
|
internal static string GetRangeText(LBRange myRange)
|
||||||
{
|
{
|
||||||
string text="";
|
string text = "";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (myRange.Start == myRange.End)// If Start and End equal return an empty string.
|
if (myRange.Start == myRange.End)// If Start and End equal return an empty string.
|
||||||
@@ -737,35 +430,6 @@ namespace LBWordLibrary
|
|||||||
return myRange.Start - problem.Index;
|
return myRange.Start - problem.Index;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ReplaceSymbolCharacters Replaces any symbol characters in the specified range
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="myRange"></param>
|
|
||||||
private static void ReplaceSymbolCharacters(LBRange myRange)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (IsSymbolFont(myRange.Font.Name))
|
|
||||||
return;
|
|
||||||
string before = GetRangeText(myRange);
|
|
||||||
string updated = ReplaceSymbolCharacters(before);
|
|
||||||
myRange.Text = updated;
|
|
||||||
string after = GetRangeText(myRange);
|
|
||||||
if (after != updated) // If the Word text doesn't match try including a character before and after and do it again.
|
|
||||||
{
|
|
||||||
Console.WriteLine("'TryEntireRange Failed',{0},{1},'{2}','{3}','{4}'", myRange.Start, myRange.End, before, updated, after);
|
|
||||||
int end = myRange.End;
|
|
||||||
myRange.Start = myRange.Start - 1;
|
|
||||||
myRange.End = end + 1;
|
|
||||||
myRange.Text = ReplaceSymbolCharacters(GetRangeText(myRange));
|
|
||||||
Console.WriteLine("'TryEntireRange Failed',{0},{1},'{2}'", myRange.Start, myRange.End, GetRangeText(myRange));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine("'TryEntireRange Exception',{0},{1},'{2}'", myRange.Start, myRange.End, ex.Message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// ReplaceSymbolCharacters processes the string returned and changes any symbols (0xF0??) to normal characters
|
/// ReplaceSymbolCharacters processes the string returned and changes any symbols (0xF0??) to normal characters
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="str"></param>
|
/// <param name="str"></param>
|
||||||
@@ -786,10 +450,7 @@ namespace LBWordLibrary
|
|||||||
/// Close the document
|
/// Close the document
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="SaveChanges">Save Changes</param>
|
/// <param name="SaveChanges">Save Changes</param>
|
||||||
public void Close(bool SaveChanges)
|
public void Close(bool SaveChanges) => InvokeMethod("Close", SaveChanges, Missing.Value, Missing.Value);
|
||||||
{
|
|
||||||
InvokeMethod("Close", SaveChanges, Missing.Value, Missing.Value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class LBFind
|
public partial class LBFind
|
||||||
{
|
{
|
||||||
@@ -810,33 +471,15 @@ namespace LBWordLibrary
|
|||||||
}
|
}
|
||||||
public partial class LBRange : LBComObject
|
public partial class LBRange : LBComObject
|
||||||
{
|
{
|
||||||
public Object get_Information(LBWdInformation info)
|
public object get_Information(LBWdInformation info) => GetProperty("Information", info);
|
||||||
{
|
public LBRange GoTo(LBWdGoToItem What, LBWdGoToDirection Which, int Count) => new LBRange(InvokeMethod("GoTo", What, Which, Count, Missing.Value));
|
||||||
return GetProperty("Information", info);
|
|
||||||
}
|
|
||||||
public LBRange GoTo(LBWdGoToItem What, LBWdGoToDirection Which, int Count)
|
|
||||||
{
|
|
||||||
return new LBRange(InvokeMethod("GoTo", What, Which, Count, Missing.Value));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class LBSelection : LBComObject
|
public partial class LBSelection : LBComObject
|
||||||
{
|
{
|
||||||
public Object get_Information(LBWdInformation info)
|
public object get_Information(LBWdInformation info) => GetProperty("Information", info);
|
||||||
{
|
public int MoveStart(LBWdUnits Unit, int Count) => InvokeMethod("MoveStart", Unit, Count) as int? ?? 0;
|
||||||
return GetProperty("Information", info);
|
public int MoveEnd(LBWdUnits Unit, int Count) => InvokeMethod("MoveEnd", Unit, Count) as int? ?? 0;
|
||||||
}
|
public int EndKey(LBWdUnits Unit, bool Extend) => InvokeMethod("EndKey", Unit, Extend) as int? ?? 0;
|
||||||
public int MoveStart(LBWdUnits Unit, int Count)
|
|
||||||
{
|
|
||||||
return InvokeMethod("MoveStart", Unit, Count) as int? ?? 0;
|
|
||||||
}
|
|
||||||
public int MoveEnd(LBWdUnits Unit, int Count)
|
|
||||||
{
|
|
||||||
return InvokeMethod("MoveEnd", Unit, Count) as int? ?? 0;
|
|
||||||
}
|
|
||||||
public int EndKey(LBWdUnits Unit, bool Extend)
|
|
||||||
{
|
|
||||||
return InvokeMethod("EndKey", Unit, Extend) as int? ?? 0;
|
|
||||||
}
|
|
||||||
public bool LastWasUpper
|
public bool LastWasUpper
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -850,7 +493,7 @@ namespace LBWordLibrary
|
|||||||
string previous = LBDocumentClass.GetRangeText(myRange);
|
string previous = LBDocumentClass.GetRangeText(myRange);
|
||||||
if (Regex.IsMatch(previous, "[A-Z]")) return true;
|
if (Regex.IsMatch(previous, "[A-Z]")) return true;
|
||||||
if (Regex.IsMatch(previous, "[a-z]")) return false;
|
if (Regex.IsMatch(previous, "[a-z]")) return false;
|
||||||
start = start - 1;
|
start--;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -858,21 +501,12 @@ namespace LBWordLibrary
|
|||||||
}
|
}
|
||||||
public partial class LBInlineShapes : LBComObjectList<LBInlineShapes, LBInlineShape> /* Collection */
|
public partial class LBInlineShapes : LBComObjectList<LBInlineShapes, LBInlineShape> /* Collection */
|
||||||
{
|
{
|
||||||
public LBInlineShape AddPicture(string FileName, LBRange Range)
|
public LBInlineShape AddPicture(string FileName, LBRange Range) => new LBInlineShape(InvokeMethod("AddPicture", FileName, false, true, Range));
|
||||||
{
|
|
||||||
return new LBInlineShape(InvokeMethod("AddPicture", FileName, false, true, Range));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class LBShapes : LBComObjectList<LBShapes, LBShape> /* Collection */
|
public partial class LBShapes : LBComObjectList<LBShapes, LBShape> /* Collection */
|
||||||
{
|
{
|
||||||
public LBShape AddPicture(string FileName, float Left, float Top, LBRange Anchor)
|
public LBShape AddPicture(string FileName, float Left, float Top, LBRange Anchor) => new LBShape(InvokeMethod("AddPicture", FileName, false, true, Left, Top, Missing.Value, Missing.Value, Anchor));
|
||||||
{
|
public LBShape AddPicture(string FileName, float Left, float Top) => new LBShape(InvokeMethod("AddPicture", FileName, false, true, Left, Top, Missing.Value, Missing.Value, Missing.Value));
|
||||||
return new LBShape(InvokeMethod("AddPicture", FileName, false, true, Left, Top, Missing.Value, Missing.Value, Anchor));
|
|
||||||
}
|
|
||||||
public LBShape AddPicture(string FileName, float Left, float Top)
|
|
||||||
{
|
|
||||||
return new LBShape(InvokeMethod("AddPicture", FileName, false, true, Left, Top, Missing.Value, Missing.Value, Missing.Value));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public enum LBMsoTriState
|
public enum LBMsoTriState
|
||||||
{
|
{
|
||||||
@@ -882,25 +516,4 @@ namespace LBWordLibrary
|
|||||||
msoTriStateToggle = -3,
|
msoTriStateToggle = -3,
|
||||||
msoTrue = -1
|
msoTrue = -1
|
||||||
}
|
}
|
||||||
//public partial class ProcessKiller
|
|
||||||
//{
|
|
||||||
// System.Diagnostics.Process _MyProcess;
|
|
||||||
// private bool _Exited = false;
|
|
||||||
// public ProcessKiller(System.Diagnostics.Process myProcess)
|
|
||||||
// {
|
|
||||||
// _MyProcess = myProcess;
|
|
||||||
// _MyProcess.Exited += new EventHandler(_MyProcess_Exited);
|
|
||||||
// _MyProcess.Kill();
|
|
||||||
// DateTime next = DateTime.Now.AddMilliseconds(200);
|
|
||||||
// while (DateTime.Now < next)
|
|
||||||
// Application.DoEvents();
|
|
||||||
// while (!_Exited)
|
|
||||||
// Application.DoEvents();
|
|
||||||
// }
|
|
||||||
// void _MyProcess_Exited(object sender, EventArgs e)
|
|
||||||
// {
|
|
||||||
// Console.WriteLine("Exited");
|
|
||||||
// _Exited = true;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,7 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="GlobalSuppressions.cs" />
|
||||||
<Compile Include="LBComObject.cs" />
|
<Compile Include="LBComObject.cs" />
|
||||||
<Compile Include="LBObjectExtension.cs" />
|
<Compile Include="LBObjectExtension.cs" />
|
||||||
<Compile Include="OutlookLBComObject.cs" />
|
<Compile Include="OutlookLBComObject.cs" />
|
||||||
|
|||||||
@@ -1,28 +1,22 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
namespace LBOutlookLibrary
|
namespace LBOutlookLibrary
|
||||||
{
|
{
|
||||||
public abstract partial class LBComObject
|
public abstract partial class LBComObject
|
||||||
{
|
{
|
||||||
private Object _Item;
|
private object _Item;
|
||||||
internal Object Item
|
internal object Item
|
||||||
{
|
{
|
||||||
get { return _Item; }
|
get { return _Item; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_Item = value;
|
_Item = value;
|
||||||
if (value != null) _MyType = _Item.GetType();
|
if (value != null) MyType = _Item.GetType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private Type _MyType;
|
|
||||||
public Type MyType
|
public Type MyType { get; set; }
|
||||||
{
|
|
||||||
get { return _MyType; }
|
|
||||||
set { _MyType = value; }
|
|
||||||
}
|
|
||||||
protected LBComObject() { }
|
protected LBComObject() { }
|
||||||
protected LBComObject(string ProgID)
|
protected LBComObject(string ProgID)
|
||||||
{
|
{
|
||||||
@@ -30,35 +24,22 @@ namespace LBOutlookLibrary
|
|||||||
objClassType = Type.GetTypeFromProgID(ProgID);
|
objClassType = Type.GetTypeFromProgID(ProgID);
|
||||||
Item = Activator.CreateInstance(objClassType);
|
Item = Activator.CreateInstance(objClassType);
|
||||||
}
|
}
|
||||||
protected LBComObject(Object item)
|
protected LBComObject(object item) => Item = item;
|
||||||
{
|
private object DoInvokeMember(string name, object[] parameters, BindingFlags bf, Binder b)
|
||||||
Item = item;
|
|
||||||
}
|
|
||||||
private Object DoInvokeMember(string name, Object[] parameters, BindingFlags bf, Binder b)
|
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return _MyType.InvokeMember(name, bf, b, _Item, parameters);
|
return MyType.InvokeMember(name, bf, b, _Item, parameters);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
throw new Exception(string.Format("LBComObject.DoInvokeMember {0}.{1}", _MyType.Name, name), ex);
|
throw new Exception(string.Format("LBComObject.DoInvokeMember {0}.{1}", MyType.Name, name), ex);
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
protected void SetProperty(string propertyName, params Object[] parameters)
|
protected void SetProperty(string propertyName, params object[] parameters) => DoInvokeMember(propertyName, parameters, BindingFlags.SetProperty, null);
|
||||||
{
|
protected object GetProperty(string propertyName) => DoInvokeMember(propertyName, null, BindingFlags.GetProperty, null);
|
||||||
DoInvokeMember(propertyName, parameters, BindingFlags.SetProperty, null);
|
protected object GetProperty(string propertyName, params object[] parameters) => DoInvokeMember(propertyName, parameters, BindingFlags.GetProperty, null);
|
||||||
}
|
protected object InvokeMethod(string methodName, params object[] parameters)
|
||||||
protected Object GetProperty(string propertyName)
|
|
||||||
{
|
|
||||||
return DoInvokeMember(propertyName, null, BindingFlags.GetProperty, null);
|
|
||||||
}
|
|
||||||
protected Object GetProperty(string propertyName, params Object[] parameters)
|
|
||||||
{
|
|
||||||
return DoInvokeMember(propertyName, parameters, BindingFlags.GetProperty, null);
|
|
||||||
}
|
|
||||||
protected Object InvokeMethod(string methodName, params Object[] parameters)
|
|
||||||
{
|
{
|
||||||
if (parameters != null)
|
if (parameters != null)
|
||||||
FixParameters(parameters);
|
FixParameters(parameters);
|
||||||
@@ -71,44 +52,14 @@ namespace LBOutlookLibrary
|
|||||||
if (parameters[i] is LBComObject)
|
if (parameters[i] is LBComObject)
|
||||||
parameters[i] = (parameters[i] as LBComObject).Item;
|
parameters[i] = (parameters[i] as LBComObject).Item;
|
||||||
}
|
}
|
||||||
protected Object InvokeMethod(string methodName)
|
protected object InvokeMethod(string methodName) => InvokeMethod(methodName, null);
|
||||||
{
|
|
||||||
return InvokeMethod(methodName, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class LBComObjectList<TList, TItem> : LBComObject
|
|
||||||
where TList : LBComObjectList<TList, TItem>
|
|
||||||
where TItem : LBComObject, new()
|
|
||||||
{
|
|
||||||
//public new(Object item):base(item){}
|
|
||||||
public TItem Add()
|
|
||||||
{
|
|
||||||
TItem tmp = new TItem();
|
|
||||||
tmp.Item = InvokeMethod("Add");
|
|
||||||
return tmp;
|
|
||||||
}
|
|
||||||
//public TItem this[int item]
|
|
||||||
//{
|
|
||||||
// get
|
|
||||||
// {
|
|
||||||
// TItem tmp = new TItem();
|
|
||||||
// tmp.Item = GetProperty("Item", item);
|
|
||||||
// return tmp;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
public partial class LBApplicationClass : LBComObject
|
public partial class LBApplicationClass : LBComObject
|
||||||
{
|
{
|
||||||
public LBApplicationClass() : base("Outlook.Application") { }
|
public LBApplicationClass() : base("Outlook.Application") { }
|
||||||
public LBApplicationClass(Object item) : base(item) { }
|
public LBApplicationClass(object item) : base(item) { }
|
||||||
public System.Object CreateItem(LBOlItemType ItemType)
|
public object CreateItem(LBOlItemType ItemType) => InvokeMethod("CreateItem", ItemType);
|
||||||
{
|
public void Quit() => InvokeMethod("Quit");
|
||||||
return InvokeMethod("CreateItem", ItemType);
|
|
||||||
}
|
|
||||||
public void Quit()
|
|
||||||
{
|
|
||||||
InvokeMethod("Quit");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public enum LBOlItemType
|
public enum LBOlItemType
|
||||||
{
|
{
|
||||||
@@ -124,13 +75,13 @@ namespace LBOutlookLibrary
|
|||||||
public partial class LBMailItem : LBComObject
|
public partial class LBMailItem : LBComObject
|
||||||
{
|
{
|
||||||
public LBMailItem() { }
|
public LBMailItem() { }
|
||||||
public LBMailItem(Object item) : base(item) { }
|
public LBMailItem(object item) : base(item) { }
|
||||||
}
|
}
|
||||||
public partial class LBMailItemClass : LBComObject
|
public partial class LBMailItemClass : LBComObject
|
||||||
{
|
{
|
||||||
public LBMailItemClass() { }
|
public LBMailItemClass() { }
|
||||||
public LBMailItemClass(Object item) : base(item) { }
|
public LBMailItemClass(object item) : base(item) { }
|
||||||
public String Body
|
public string Body
|
||||||
{
|
{
|
||||||
get { return (GetProperty("Body").ToString()); }
|
get { return (GetProperty("Body").ToString()); }
|
||||||
set { SetProperty("Body", value); }
|
set { SetProperty("Body", value); }
|
||||||
@@ -140,28 +91,19 @@ namespace LBOutlookLibrary
|
|||||||
get { return (LBOlBodyFormat)GetProperty("BodyFormat"); }
|
get { return (LBOlBodyFormat)GetProperty("BodyFormat"); }
|
||||||
set { SetProperty("BodyFormat", value); }
|
set { SetProperty("BodyFormat", value); }
|
||||||
}
|
}
|
||||||
public LBAttachments Attachments
|
public LBAttachments Attachments => new LBAttachments(GetProperty("Attachments"));
|
||||||
{
|
public string Subject
|
||||||
get { return new LBAttachments(GetProperty("Attachments")); }
|
|
||||||
}
|
|
||||||
public String Subject
|
|
||||||
{
|
{
|
||||||
get { return (GetProperty("Subject").ToString()); }
|
get { return (GetProperty("Subject").ToString()); }
|
||||||
set { SetProperty("Subject", value); }
|
set { SetProperty("Subject", value); }
|
||||||
}
|
}
|
||||||
public LBRecipients Recipients
|
public LBRecipients Recipients => new LBRecipients(GetProperty("Recipients"));
|
||||||
{
|
public string To
|
||||||
get { return new LBRecipients(GetProperty("Recipients")); }
|
|
||||||
}
|
|
||||||
public String To
|
|
||||||
{
|
{
|
||||||
get { return (GetProperty("To").ToString()); }
|
get { return (GetProperty("To").ToString()); }
|
||||||
set { SetProperty("To", value); }
|
set { SetProperty("To", value); }
|
||||||
}
|
}
|
||||||
public void Send()
|
public void Send() => InvokeMethod("Send");
|
||||||
{
|
|
||||||
InvokeMethod("Send");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public enum LBOlBodyFormat
|
public enum LBOlBodyFormat
|
||||||
{
|
{
|
||||||
@@ -173,78 +115,39 @@ namespace LBOutlookLibrary
|
|||||||
public partial class LBAttachments : LBComObject
|
public partial class LBAttachments : LBComObject
|
||||||
{
|
{
|
||||||
public LBAttachments() { }
|
public LBAttachments() { }
|
||||||
public LBAttachments(Object item) : base(item) { }
|
public LBAttachments(object item) : base(item) { }
|
||||||
public int Count
|
public int Count => (GetProperty("Count") as int? ?? 0);
|
||||||
{
|
public new LBAttachment Item => new LBAttachment(GetProperty("Item"));
|
||||||
get { return (GetProperty("Count") as int? ?? 0); }
|
public LBAttachment Add(object Source) => new LBAttachment(InvokeMethod("Add", Source, Missing.Value, Missing.Value, Missing.Value));
|
||||||
}
|
|
||||||
public LBAttachment Item
|
|
||||||
{
|
|
||||||
get { return new LBAttachment(GetProperty("Item")); }
|
|
||||||
}
|
|
||||||
public LBAttachment Add(object Source)
|
|
||||||
{
|
|
||||||
return new LBAttachment(InvokeMethod("Add", Source, Missing.Value, Missing.Value, Missing.Value));
|
|
||||||
}
|
|
||||||
public LBAttachment Add(object Source, object Type, object Position, object DisplayName)
|
public LBAttachment Add(object Source, object Type, object Position, object DisplayName)
|
||||||
{
|
{
|
||||||
return new LBAttachment(InvokeMethod("Add", Source, Type, Position, DisplayName));
|
return new LBAttachment(InvokeMethod("Add", Source, Type, Position, DisplayName));
|
||||||
}
|
}
|
||||||
public void Remove(int Index)
|
public void Remove(int Index) => InvokeMethod("Remove", Index);
|
||||||
{
|
|
||||||
InvokeMethod("Remove", Index);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class LBRecipients : LBComObject
|
public partial class LBRecipients : LBComObject
|
||||||
{
|
{
|
||||||
public LBRecipients() { }
|
public LBRecipients() { }
|
||||||
public LBRecipients(Object item) : base(item) { }
|
public LBRecipients(object item) : base(item) { }
|
||||||
public int Count
|
public int Count => (GetProperty("Count") as int? ?? 0);
|
||||||
{
|
public new LBRecipient Item => new LBRecipient(GetProperty("Item"));
|
||||||
get { return (GetProperty("Count") as int? ?? 0); }
|
public LBRecipient Add(string Name) => new LBRecipient(InvokeMethod("Add", Name));
|
||||||
}
|
public void Remove(int Index) => InvokeMethod("Remove", Index);
|
||||||
public LBRecipient Item
|
public bool ResolveAll() => InvokeMethod("ResolveAll") as bool? ?? false;
|
||||||
{
|
|
||||||
get { return new LBRecipient(GetProperty("Item")); }
|
|
||||||
}
|
|
||||||
public LBRecipient Add(string Name)
|
|
||||||
{
|
|
||||||
return new LBRecipient(InvokeMethod("Add", Name));
|
|
||||||
}
|
|
||||||
public void Remove(int Index)
|
|
||||||
{
|
|
||||||
InvokeMethod("Remove", Index);
|
|
||||||
}
|
|
||||||
public Boolean ResolveAll()
|
|
||||||
{
|
|
||||||
return InvokeMethod("ResolveAll") as Boolean? ?? false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class LBAttachment : LBComObject
|
public partial class LBAttachment : LBComObject
|
||||||
{
|
{
|
||||||
public LBAttachment() { }
|
public LBAttachment() { }
|
||||||
public LBAttachment(Object item) : base(item) { }
|
public LBAttachment(object item) : base(item) { }
|
||||||
public LBOlAttachmentType Type
|
public LBOlAttachmentType Type => (LBOlAttachmentType)GetProperty("Type");
|
||||||
{
|
|
||||||
get { return (LBOlAttachmentType)GetProperty("Type"); }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class LBRecipient : LBComObject
|
public partial class LBRecipient : LBComObject
|
||||||
{
|
{
|
||||||
public LBRecipient() { }
|
public LBRecipient() { }
|
||||||
public LBRecipient(Object item) : base(item) { }
|
public LBRecipient(object item) : base(item) { }
|
||||||
public String Address
|
public string Address => (GetProperty("Address").ToString());
|
||||||
{
|
public string Name => (GetProperty("Name").ToString());
|
||||||
get { return (GetProperty("Address").ToString()); }
|
public bool Resolve() => InvokeMethod("Resolve") as bool? ?? false;
|
||||||
}
|
|
||||||
public String Name
|
|
||||||
{
|
|
||||||
get { return (GetProperty("Name").ToString()); }
|
|
||||||
}
|
|
||||||
public Boolean Resolve()
|
|
||||||
{
|
|
||||||
return InvokeMethod("Resolve") as Boolean? ?? false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public enum LBOlAttachmentType
|
public enum LBOlAttachmentType
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,21 +1,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace LBOutlookLibrary
|
namespace LBOutlookLibrary
|
||||||
{
|
{
|
||||||
public partial class LBApplicationClass
|
public partial class LBApplicationClass
|
||||||
{
|
{
|
||||||
public LBMailItemClass CreateMailItem()
|
public LBMailItemClass CreateMailItem() => new LBMailItemClass(CreateItem(LBOlItemType.olMailItem));
|
||||||
{
|
|
||||||
return new LBMailItemClass(CreateItem(LBOlItemType.olMailItem));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public partial class LBMailItemClass
|
public partial class LBMailItemClass
|
||||||
{
|
{
|
||||||
public void AddAttachment(string filename)
|
public void AddAttachment(string filename) => Attachments.Add(filename, LBOlAttachmentType.olByValue, Type.Missing, Type.Missing);
|
||||||
{
|
|
||||||
Attachments.Add(filename, LBOlAttachmentType.olByValue, Type.Missing, Type.Missing);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,15 +53,9 @@ namespace Read64bitRegistryFrom32bitApp
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Functions
|
#region Functions
|
||||||
static public string GetRegKey64Value(UIntPtr inHive, String inKeyName, String inPropertyName)
|
static public string GetRegKey64Value(UIntPtr inHive, string inKeyName, string inPropertyName) => GetRegKey64Value(inHive, inKeyName, RegSAM.WOW64_64Key, inPropertyName);
|
||||||
{
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "inHive kept to match dll signature")]
|
||||||
return GetRegKey64Value(inHive, inKeyName, RegSAM.WOW64_64Key, inPropertyName);
|
static public string GetRegKey64Value(UIntPtr inHive, string inKeyName, RegSAM in32or64key, string inPropertyName)
|
||||||
}
|
|
||||||
static public string GetRegKey32Value(UIntPtr inHive, String inKeyName, String inPropertyName)
|
|
||||||
{
|
|
||||||
return GetRegKey64Value(inHive, inKeyName, RegSAM.WOW64_32Key, inPropertyName);
|
|
||||||
}
|
|
||||||
static public string GetRegKey64Value(UIntPtr inHive, String inKeyName, RegSAM in32or64key, String inPropertyName)
|
|
||||||
{
|
{
|
||||||
int hkey = 0;
|
int hkey = 0;
|
||||||
try
|
try
|
||||||
@@ -80,15 +74,10 @@ namespace Read64bitRegistryFrom32bitApp
|
|||||||
if (0 != hkey) RegCloseKey(hkey);
|
if (0 != hkey) RegCloseKey(hkey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static public bool CheckRegKey64Valid(UIntPtr inHive, String inKeyName)
|
static public bool CheckRegKey64Valid(UIntPtr inHive, string inKeyName) => CheckRegKey64Valid(inHive, inKeyName, RegSAM.WOW64_64Key);
|
||||||
{
|
static public bool GetRegKey32Valid(UIntPtr inHive, string inKeyName) => CheckRegKey64Valid(inHive, inKeyName, RegSAM.WOW64_32Key);
|
||||||
return CheckRegKey64Valid(inHive, inKeyName, RegSAM.WOW64_64Key);
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "inHive kept to match dll signature")]
|
||||||
}
|
static public bool CheckRegKey64Valid(UIntPtr inHive, string inKeyName, RegSAM in32or64key)
|
||||||
static public bool GetRegKey32Valid(UIntPtr inHive, String inKeyName)
|
|
||||||
{
|
|
||||||
return CheckRegKey64Valid(inHive, inKeyName, RegSAM.WOW64_32Key);
|
|
||||||
}
|
|
||||||
static public bool CheckRegKey64Valid(UIntPtr inHive, String inKeyName, RegSAM in32or64key)
|
|
||||||
{
|
{
|
||||||
int hkey = 0;
|
int hkey = 0;
|
||||||
try
|
try
|
||||||
@@ -103,8 +92,5 @@ namespace Read64bitRegistryFrom32bitApp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Enums
|
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2844,7 +2844,8 @@ namespace ROEditor
|
|||||||
}
|
}
|
||||||
else
|
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);
|
success = myrodb.RODB_WriteRO((VlnXmlElement)roTreeView.SelectedNode.Tag);
|
||||||
if (success==true && mnutitle != "") roTreeView.SelectedNode.Text = mnutitle; //B2021-077 make sure mnutitle has text or it will clear the node's title in the tree
|
if (success==true && mnutitle != "") roTreeView.SelectedNode.Text = mnutitle; //B2021-077 make sure mnutitle has text or it will clear the node's title in the tree
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -844,8 +844,12 @@ namespace ROEditor
|
|||||||
AccPageID = " ";
|
AccPageID = " ";
|
||||||
WriteString(AccPageID);
|
WriteString(AccPageID);
|
||||||
|
|
||||||
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
|
string moddt = ROdatabase.RODB_GetModDateTime(elem.GetAttribute("RecID"), elem.GetAttribute("Table"));
|
||||||
|
if (!string.IsNullOrEmpty(moddt)) WriteString(moddt);
|
||||||
|
|
||||||
// Save the ID and offset entry for the current ID
|
// Save the ID and offset entry for the current ID
|
||||||
IdsAndOffsets.Add(RORecID,startFST);
|
IdsAndOffsets.Add(RORecID, startFST);
|
||||||
|
|
||||||
// Save the RecID and Accessory Page id
|
// Save the RecID and Accessory Page id
|
||||||
IdsAndAccPgIds[AccPageID] = RORecID;
|
IdsAndAccPgIds[AccPageID] = RORecID;
|
||||||
|
|||||||
@@ -355,6 +355,7 @@ namespace RODBInterface
|
|||||||
public abstract string RODB_GetDBServerForAbout();
|
public abstract string RODB_GetDBServerForAbout();
|
||||||
public abstract string RODB_HasBeenConverted();
|
public abstract string RODB_HasBeenConverted();
|
||||||
public abstract bool RODB_WriteSqlConnectToAccess(string newConectStr);
|
public abstract bool RODB_WriteSqlConnectToAccess(string newConectStr);
|
||||||
|
public abstract string RODB_GetModDateTime(string Recid, string table);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public RODB()
|
public RODB()
|
||||||
@@ -2147,7 +2148,6 @@ namespace RODBInterface
|
|||||||
foreach (int chr in chrAry)
|
foreach (int chr in chrAry)
|
||||||
{
|
{
|
||||||
if (chr > 166)
|
if (chr > 166)
|
||||||
|
|
||||||
{
|
{
|
||||||
xmlstrTmp.Append($"\\u{(int)chr}?");
|
xmlstrTmp.Append($"\\u{(int)chr}?");
|
||||||
}
|
}
|
||||||
@@ -2205,7 +2205,6 @@ namespace RODBInterface
|
|||||||
foreach (int chr in chrAry)
|
foreach (int chr in chrAry)
|
||||||
{
|
{
|
||||||
if (chr > 166)
|
if (chr > 166)
|
||||||
|
|
||||||
{
|
{
|
||||||
xmlstrTmp.Append($"\\u{(int)chr}?");
|
xmlstrTmp.Append($"\\u{(int)chr}?");
|
||||||
}
|
}
|
||||||
@@ -2660,7 +2659,21 @@ namespace RODBInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
StatMsgWindow.StatusMessage = echild.GetAttribute("MenuTitle");
|
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 + "'";
|
str = "UPDATE " + echild.GetAttribute("Table") + " SET Info = '" + tinfo2 + "'";
|
||||||
|
char[] chrAry = tinfo2.ToCharArray();
|
||||||
|
foreach (int chr in chrAry)
|
||||||
|
{
|
||||||
|
if (chr > 166)
|
||||||
|
{
|
||||||
|
tinfo2Tmp.Append($"\\u{(int)chr}?");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tinfo2Tmp.Append((char)chr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
str = "UPDATE " + echild.GetAttribute("Table") + " SET Info = '" + tinfo2Tmp.ToString() + "'";
|
||||||
str = str + ", ModDateTime = '" + dt + "' WHERE RecID = '" + echild.GetAttribute("RecID") + "';";
|
str = str + ", ModDateTime = '" + dt + "' WHERE RecID = '" + echild.GetAttribute("RecID") + "';";
|
||||||
DBE.Command(str);
|
DBE.Command(str);
|
||||||
DBE.Reader();
|
DBE.Reader();
|
||||||
@@ -3070,6 +3083,27 @@ namespace RODBInterface
|
|||||||
return GrpCnt;
|
return GrpCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
|
//Get the Modification Date / Time for the RO
|
||||||
|
public override string RODB_GetModDateTime(string Recid, string table)
|
||||||
|
{
|
||||||
|
using (System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection(strDatabaseConnectionCommand))
|
||||||
|
{
|
||||||
|
connection.Open();
|
||||||
|
using (System.Data.OleDb.OleDbCommand command = connection.CreateCommand())
|
||||||
|
{
|
||||||
|
//Unfortunately Access wont let you paramaterize the table name
|
||||||
|
command.CommandText = $"SELECT ModDateTime FROM {Regex.Replace(table, "[^a-zA-Z0-9]", "")} WHERE RecID = @Value";
|
||||||
|
command.Parameters.Add(new System.Data.OleDb.OleDbParameter
|
||||||
|
{
|
||||||
|
OleDbType = System.Data.OleDb.OleDbType.VarChar,
|
||||||
|
ParameterName = "@Value",
|
||||||
|
Value = Recid
|
||||||
|
});
|
||||||
|
return command.ExecuteScalar().ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2653,6 +2653,34 @@ namespace RODBInterface
|
|||||||
}
|
}
|
||||||
return GrpCnt;
|
return GrpCnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
|
//Get the Modification Date / Time for the RO
|
||||||
|
public override string RODB_GetModDateTime(string Recid, string table)
|
||||||
|
{
|
||||||
|
using (SqlConnection connection = new SqlConnection(strDatabaseConnectionCommand))
|
||||||
|
{
|
||||||
|
connection.Open();
|
||||||
|
using (SqlCommand command = connection.CreateCommand())
|
||||||
|
{
|
||||||
|
command.CommandText = $"SELECT ModDateTime FROM ROALL WHERE RecID = @Value AND ROTable = @table";
|
||||||
|
command.Parameters.Add(new SqlParameter
|
||||||
|
{
|
||||||
|
SqlDbType = SqlDbType.VarChar,
|
||||||
|
ParameterName = "@Value",
|
||||||
|
Value = Recid
|
||||||
|
});
|
||||||
|
command.Parameters.Add(new SqlParameter
|
||||||
|
{
|
||||||
|
SqlDbType = SqlDbType.VarChar,
|
||||||
|
ParameterName = "@table",
|
||||||
|
Value = table
|
||||||
|
});
|
||||||
|
|
||||||
|
return command.ExecuteScalar().ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
public static bool TestConnect(string constring)
|
public static bool TestConnect(string constring)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,11 +19,6 @@
|
|||||||
*********************************************************************************************/
|
*********************************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
|
||||||
using System.Collections;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
//using ROProfiler; //don't forget to add VlnProfiler to the reference list
|
|
||||||
|
|
||||||
namespace VlnStatus
|
namespace VlnStatus
|
||||||
{
|
{
|
||||||
@@ -35,11 +30,6 @@ namespace VlnStatus
|
|||||||
private System.Windows.Forms.ProgressBar progressBar1;
|
private System.Windows.Forms.ProgressBar progressBar1;
|
||||||
private System.Windows.Forms.Label lblBar;
|
private System.Windows.Forms.Label lblBar;
|
||||||
private System.Windows.Forms.Label StatMsg;
|
private System.Windows.Forms.Label StatMsg;
|
||||||
// private string strLblLast="";
|
|
||||||
/// <summary>
|
|
||||||
/// Required designer variable.
|
|
||||||
/// </summary>
|
|
||||||
private System.ComponentModel.Container components = null;
|
|
||||||
|
|
||||||
public StatusBarFrm()
|
public StatusBarFrm()
|
||||||
{
|
{
|
||||||
@@ -61,21 +51,6 @@ namespace VlnStatus
|
|||||||
Text = StatusBoxTitle;
|
Text = StatusBoxTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clean up any resources being used.
|
|
||||||
/// </summary>
|
|
||||||
protected override void Dispose( bool disposing )
|
|
||||||
{
|
|
||||||
if( disposing )
|
|
||||||
{
|
|
||||||
if(components != null)
|
|
||||||
{
|
|
||||||
components.Dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
base.Dispose( disposing );
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
#region Windows Form Designer generated code
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required method for Designer support - do not modify
|
/// Required method for Designer support - do not modify
|
||||||
@@ -190,14 +165,6 @@ namespace VlnStatus
|
|||||||
{
|
{
|
||||||
lblBar.Text = (Math.Round((decimal)(progressBar1.Value * 100) / progressBar1.Maximum)).ToString();
|
lblBar.Text = (Math.Round((decimal)(progressBar1.Value * 100) / progressBar1.Maximum)).ToString();
|
||||||
lblBar.Text += "% Complete";
|
lblBar.Text += "% Complete";
|
||||||
// if( lblBar.Text != strLblLast)
|
|
||||||
// {
|
|
||||||
// Profiler.Start("UpdateLabel");
|
|
||||||
lblBar.Refresh();
|
|
||||||
// lblBar.Update();
|
|
||||||
// Profiler.End("UpdateLabel");
|
|
||||||
// }
|
|
||||||
// strLblLast = lblBar.Text;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string StatusMessage
|
public string StatusMessage
|
||||||
@@ -209,10 +176,7 @@ namespace VlnStatus
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
StatMsg.Text = value;
|
StatMsg.Text = value;
|
||||||
// Profiler.Start("StatusMessage");
|
|
||||||
StatMsg.Refresh();
|
StatMsg.Refresh();
|
||||||
// StatMsg.Update();
|
|
||||||
// Profiler.End("StatusMessage");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,12 +17,6 @@
|
|||||||
* Added overbounds check
|
* Added overbounds check
|
||||||
*********************************************************************************************/
|
*********************************************************************************************/
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Collections;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace VlnStatus
|
namespace VlnStatus
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -31,10 +25,6 @@ namespace VlnStatus
|
|||||||
public class StatusMessageFrm : System.Windows.Forms.Form
|
public class StatusMessageFrm : System.Windows.Forms.Form
|
||||||
{
|
{
|
||||||
private System.Windows.Forms.Label lblStatMsg;
|
private System.Windows.Forms.Label lblStatMsg;
|
||||||
/// <summary>
|
|
||||||
/// Required designer variable.
|
|
||||||
/// </summary>
|
|
||||||
private System.ComponentModel.Container components = null;
|
|
||||||
|
|
||||||
public StatusMessageFrm()
|
public StatusMessageFrm()
|
||||||
{
|
{
|
||||||
@@ -54,21 +44,6 @@ namespace VlnStatus
|
|||||||
Text = StatTitle;
|
Text = StatTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clean up any resources being used.
|
|
||||||
/// </summary>
|
|
||||||
protected override void Dispose( bool disposing )
|
|
||||||
{
|
|
||||||
if( disposing )
|
|
||||||
{
|
|
||||||
if(components != null)
|
|
||||||
{
|
|
||||||
components.Dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
base.Dispose( disposing );
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
#region Windows Form Designer generated code
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required method for Designer support - do not modify
|
/// Required method for Designer support - do not modify
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace VlnStatus
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class VlnStatusBar
|
public class VlnStatusBar
|
||||||
{
|
{
|
||||||
StatusBarFrm StatBar;
|
readonly StatusBarFrm StatBar;
|
||||||
private int Cnt;
|
private int Cnt;
|
||||||
|
|
||||||
// Create a status window with the default title of "Status"
|
// Create a status window with the default title of "Status"
|
||||||
@@ -53,8 +53,6 @@ namespace VlnStatus
|
|||||||
// Increament the the status bar by the passed in value.
|
// Increament the the status bar by the passed in value.
|
||||||
public void PerformStep(int val)
|
public void PerformStep(int val)
|
||||||
{
|
{
|
||||||
// StatBar.Value = val;
|
|
||||||
// Cnt = val;
|
|
||||||
BarValue = val;
|
BarValue = val;
|
||||||
StatBar.PerformStep();
|
StatBar.PerformStep();
|
||||||
}
|
}
|
||||||
@@ -62,7 +60,6 @@ namespace VlnStatus
|
|||||||
// Increament the the status bar by one
|
// Increament the the status bar by one
|
||||||
public void PerformStep()
|
public void PerformStep()
|
||||||
{
|
{
|
||||||
// StatBar.Value = StatBar.Value + 1;
|
|
||||||
Cnt++;
|
Cnt++;
|
||||||
BarValue = Cnt;
|
BarValue = Cnt;
|
||||||
StatBar.PerformStep();
|
StatBar.PerformStep();
|
||||||
|
|||||||
@@ -13,8 +13,6 @@
|
|||||||
* Added overbounds check
|
* Added overbounds check
|
||||||
*********************************************************************************************/
|
*********************************************************************************************/
|
||||||
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace VlnStatus
|
namespace VlnStatus
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -28,7 +26,7 @@ namespace VlnStatus
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class VlnStatusMessage
|
public class VlnStatusMessage
|
||||||
{
|
{
|
||||||
StatusMessageFrm StatusMessageBox;
|
readonly StatusMessageFrm StatusMessageBox;
|
||||||
|
|
||||||
// Create a status window with the default title of "Status"
|
// Create a status window with the default title of "Status"
|
||||||
public VlnStatusMessage()
|
public VlnStatusMessage()
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// This file is used by Code Analysis to maintain SuppressMessage
|
||||||
|
// attributes that are applied to this project.
|
||||||
|
// Project-level suppressions either have no target or are given
|
||||||
|
// a specific target and scoped to a namespace, type, member, etc.
|
||||||
|
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
|
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Not modifying Naming Styles")]
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace RoAccessToSql
|
namespace RoAccessToSql
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
using System.Data.OleDb;
|
using System.Data.OleDb;
|
||||||
using Volian.Base.Library;
|
|
||||||
|
|
||||||
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
|
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
|
||||||
|
|
||||||
@@ -33,25 +27,11 @@ namespace RoAccessToSql
|
|||||||
public partial class RoAccessToSql : Form
|
public partial class RoAccessToSql : Form
|
||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private string _MSAccessPath = null;
|
|
||||||
public string MSAccessPath
|
public string MSAccessPath { get; set; } = null;
|
||||||
{
|
public string SqlServerName { get; set; } = null;
|
||||||
get { return _MSAccessPath; }
|
public string SqlDatabaseName { get; set; } = null;
|
||||||
set { _MSAccessPath = value; }
|
readonly bool _Initializing = false;
|
||||||
}
|
|
||||||
private string _SqlServerName = null;
|
|
||||||
public string SqlServerName
|
|
||||||
{
|
|
||||||
get { return _SqlServerName; }
|
|
||||||
set { _SqlServerName = value; }
|
|
||||||
}
|
|
||||||
private string _SqlDatabaseName = null;
|
|
||||||
public string SqlDatabaseName
|
|
||||||
{
|
|
||||||
get { return _SqlDatabaseName; }
|
|
||||||
set { _SqlDatabaseName = value; }
|
|
||||||
}
|
|
||||||
bool _Initializing = false;
|
|
||||||
|
|
||||||
public RoAccessToSql(string[] args)
|
public RoAccessToSql(string[] args)
|
||||||
{
|
{
|
||||||
@@ -66,7 +46,7 @@ namespace RoAccessToSql
|
|||||||
}
|
}
|
||||||
else if (parm.StartsWith("/sqldb="))
|
else if (parm.StartsWith("/sqldb="))
|
||||||
{
|
{
|
||||||
SqlDatabaseName = parm.Substring(7) + "_RO";
|
SqlDatabaseName = $"{parm.Substring(7)}_RO";
|
||||||
}
|
}
|
||||||
else if (parm.StartsWith("/server="))
|
else if (parm.StartsWith("/server="))
|
||||||
{
|
{
|
||||||
@@ -92,7 +72,7 @@ namespace RoAccessToSql
|
|||||||
if (UserInRoEditor()) this.Close();
|
if (UserInRoEditor()) this.Close();
|
||||||
tbSqlDbName.Text = SqlDatabaseName;
|
tbSqlDbName.Text = SqlDatabaseName;
|
||||||
_TmpFileForConnectStr = Path.GetTempPath();
|
_TmpFileForConnectStr = Path.GetTempPath();
|
||||||
_TmpFileForConnectStr = _TmpFileForConnectStr + @"\PromsConnect.txt";
|
_TmpFileForConnectStr += @"\PromsConnect.txt";
|
||||||
File.Delete(_TmpFileForConnectStr);
|
File.Delete(_TmpFileForConnectStr);
|
||||||
_Initializing = false;
|
_Initializing = false;
|
||||||
}
|
}
|
||||||
@@ -100,7 +80,7 @@ namespace RoAccessToSql
|
|||||||
private bool UserInRoEditor()
|
private bool UserInRoEditor()
|
||||||
{
|
{
|
||||||
FileInfo fiown = null;
|
FileInfo fiown = null;
|
||||||
FileStream fsown = null;
|
FileStream fsown;
|
||||||
// The following code was taken from the roeditor. It uses the 'RoEditor.own' file to assure that
|
// The following code was taken from the roeditor. It uses the 'RoEditor.own' file to assure that
|
||||||
// no one is in the roeditor. This file is located in the microsoft access database directory.
|
// no one is in the roeditor. This file is located in the microsoft access database directory.
|
||||||
try
|
try
|
||||||
@@ -119,7 +99,7 @@ namespace RoAccessToSql
|
|||||||
fsown = fiown.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
fsown = fiown.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||||
TextReader tr1 = new StreamReader(fsown);
|
TextReader tr1 = new StreamReader(fsown);
|
||||||
string who1 = tr1.ReadToEnd();
|
string who1 = tr1.ReadToEnd();
|
||||||
MessageBox.Show(ex.Message + "\r\n\r\n" + who1, "RO Editor In Use", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
MessageBox.Show($"{ex.Message}\r\n\r\n{who1}", "RO Editor In Use", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
}
|
}
|
||||||
fsown = fiown.Open(FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite);
|
fsown = fiown.Open(FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite);
|
||||||
TextReader tr = new StreamReader(fsown);
|
TextReader tr = new StreamReader(fsown);
|
||||||
@@ -142,7 +122,7 @@ namespace RoAccessToSql
|
|||||||
tw.WriteLine("Current User: {0}, Date and Time Started: {1}", Environment.UserName.ToUpper(), DateTime.Now.ToString("MM/dd/yyyy @ hh:mm"));
|
tw.WriteLine("Current User: {0}, Date and Time Started: {1}", Environment.UserName.ToUpper(), DateTime.Now.ToString("MM/dd/yyyy @ hh:mm"));
|
||||||
tw.Flush();
|
tw.Flush();
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException)
|
||||||
{
|
{
|
||||||
fsown = fiown.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
fsown = fiown.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||||
TextReader tr = new StreamReader(fsown);
|
TextReader tr = new StreamReader(fsown);
|
||||||
@@ -154,12 +134,8 @@ namespace RoAccessToSql
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
static string _ErrorLogFileName;
|
|
||||||
public static string ErrorLogFileName
|
public static string ErrorLogFileName { get; set; }
|
||||||
{
|
|
||||||
get { return _ErrorLogFileName; }
|
|
||||||
set { _ErrorLogFileName = value; }
|
|
||||||
}
|
|
||||||
// make error log file name (uses same logic as proms error log)
|
// make error log file name (uses same logic as proms error log)
|
||||||
static bool ChangeLogFileName(string AppenderName, string NewFilename)
|
static bool ChangeLogFileName(string AppenderName, string NewFilename)
|
||||||
{
|
{
|
||||||
@@ -168,11 +144,10 @@ namespace RoAccessToSql
|
|||||||
foreach (log4net.Appender.IAppender iApp in RootRep.GetAppenders())
|
foreach (log4net.Appender.IAppender iApp in RootRep.GetAppenders())
|
||||||
{
|
{
|
||||||
if (iApp.Name.CompareTo(AppenderName) == 0
|
if (iApp.Name.CompareTo(AppenderName) == 0
|
||||||
&& iApp is log4net.Appender.FileAppender)
|
&& iApp is log4net.Appender.FileAppender fApp)
|
||||||
{
|
{
|
||||||
log4net.Appender.FileAppender fApp = (log4net.Appender.FileAppender)iApp;
|
|
||||||
string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
||||||
fApp.File = folderPath + @"\VEPROMS\" + (Volian.Base.Library.VlnSettings.GetCommand("prefix", "") + "_").TrimStart("_".ToCharArray()) + NewFilename;
|
fApp.File = $@"{folderPath}\VEPROMS\{($"{Volian.Base.Library.VlnSettings.GetCommand("prefix", "")}_").TrimStart("_".ToCharArray())}{NewFilename}";
|
||||||
ErrorLogFileName = fApp.File;
|
ErrorLogFileName = fApp.File;
|
||||||
fApp.ActivateOptions();
|
fApp.ActivateOptions();
|
||||||
return true;
|
return true;
|
||||||
@@ -189,7 +164,7 @@ namespace RoAccessToSql
|
|||||||
if (Directory.Exists(fbd.SelectedPath))
|
if (Directory.Exists(fbd.SelectedPath))
|
||||||
tbAccessPath.Text = fbd.SelectedPath;
|
tbAccessPath.Text = fbd.SelectedPath;
|
||||||
else
|
else
|
||||||
MessageBox.Show("Path doesn't exist " + tbAccessPath.Text);
|
MessageBox.Show($"Path doesn't exist {tbAccessPath.Text}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Convert the data
|
// Convert the data
|
||||||
@@ -212,7 +187,7 @@ namespace RoAccessToSql
|
|||||||
{
|
{
|
||||||
DateTime dtSunday = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek));
|
DateTime dtSunday = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek));
|
||||||
|
|
||||||
ChangeLogFileName("LogFileAppender", SqlDatabaseName + " " + dtSunday.ToString("yyyyMMdd") + " ErrorLog.txt");
|
ChangeLogFileName("LogFileAppender", $"{SqlDatabaseName} {dtSunday:yyyyMMdd} ErrorLog.txt");
|
||||||
_MyLog.InfoFormat("\r\nSession Beginning\r\n<===={0}[SQL:{1:yyMM.ddHH}]====== User: {2}/{3} Started {4} ===============>{5}"
|
_MyLog.InfoFormat("\r\nSession Beginning\r\n<===={0}[SQL:{1:yyMM.ddHH}]====== User: {2}/{3} Started {4} ===============>{5}"
|
||||||
, Application.ProductVersion, RevDate, DateTime.Now, Environment.UserDomainName, Environment.UserName, DateTime.Now.ToString("dddd MMMM d, yyyy h:mm:ss tt"), "");
|
, Application.ProductVersion, RevDate, DateTime.Now, Environment.UserDomainName, Environment.UserName, DateTime.Now.ToString("dddd MMMM d, yyyy h:mm:ss tt"), "");
|
||||||
}
|
}
|
||||||
@@ -229,7 +204,7 @@ namespace RoAccessToSql
|
|||||||
if (sqlConnection.State == ConnectionState.Open)
|
if (sqlConnection.State == ConnectionState.Open)
|
||||||
{
|
{
|
||||||
// now try to open access db:
|
// now try to open access db:
|
||||||
string strDatabaseConnectionCommand = "Provider=Microsoft.ACE.OLEDB.12.0;Password=\"\";User ID=Admin;Data Source=" + MSAccessPath + "\\ROMaster.mdb;Mode=Share Deny None;Extended Properties=\"\";Jet OLEDB:System database=\"\";Jet OLEDB:Registry Path=\"\";Jet OLEDB:Database Password=\"\";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False";
|
string strDatabaseConnectionCommand = $"Provider=Microsoft.ACE.OLEDB.12.0;Password=\"\";User ID=Admin;Data Source={MSAccessPath}\\ROMaster.mdb;Mode=Share Deny None;Extended Properties=\"\";Jet OLEDB:System database=\"\";Jet OLEDB:Registry Path=\"\";Jet OLEDB:Database Password=\"\";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False";
|
||||||
using (OleDbConnection accessConnection = new OleDbConnection(strDatabaseConnectionCommand))
|
using (OleDbConnection accessConnection = new OleDbConnection(strDatabaseConnectionCommand))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -251,13 +226,13 @@ namespace RoAccessToSql
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_MyLog.Error("SQL Connection is not open. Check connection string: " + tbSqlDbName.Text);
|
_MyLog.Error($"SQL Connection is not open. Check connection string: {tbSqlDbName.Text}");
|
||||||
MessageBox.Show("Check connection string: " + tbSqlDbName.Text, "SQL Connection is not open.");
|
MessageBox.Show($"Check connection string: {tbSqlDbName.Text}", "SQL Connection is not open.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SqlException ex)
|
catch (SqlException ex)
|
||||||
{
|
{
|
||||||
_MyLog.Error("SQL Connection is not open. Check connection string: " + tbSqlDbName.Text);
|
_MyLog.Error($"SQL Connection is not open. Check connection string: {tbSqlDbName.Text}");
|
||||||
MessageBox.Show(ex.Message, "Unknown error when migrating RO data from MS Access to SQL");
|
MessageBox.Show(ex.Message, "Unknown error when migrating RO data from MS Access to SQL");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -274,9 +249,8 @@ namespace RoAccessToSql
|
|||||||
lastTimeDbs = ProgressBarUpdate(pBarDbs, null, 0, 1, 0, 0, lastTimeDbs, false);
|
lastTimeDbs = ProgressBarUpdate(pBarDbs, null, 0, 1, 0, 0, lastTimeDbs, false);
|
||||||
lastTimeRos = ProgressBarUpdate(pBarROs, null, 0, maxCntRo, 0, 0, lastTimeRos, false);
|
lastTimeRos = ProgressBarUpdate(pBarROs, null, 0, maxCntRo, 0, 0, lastTimeRos, false);
|
||||||
lastTimeDbs = ProgressBarUpdate(pBarDbs, "ROMaster Table", 0, 5, 0, 1, lastTimeDbs, false);
|
lastTimeDbs = ProgressBarUpdate(pBarDbs, "ROMaster Table", 0, 5, 0, 1, lastTimeDbs, false);
|
||||||
OleDbDataReader reader = null;
|
|
||||||
OleDbCommand command = new OleDbCommand("select * from ROMaster", accessConnection);
|
OleDbCommand command = new OleDbCommand("select * from ROMaster", accessConnection);
|
||||||
reader = command.ExecuteReader();
|
OleDbDataReader reader = command.ExecuteReader();
|
||||||
// Do access's romaster table first so that the list of other tables to process is found. While doing this, migrate this table's data.
|
// Do access's romaster table first so that the list of other tables to process is found. While doing this, migrate this table's data.
|
||||||
int cntRo = 0;
|
int cntRo = 0;
|
||||||
int cntDb = 0;
|
int cntDb = 0;
|
||||||
@@ -303,10 +277,9 @@ namespace RoAccessToSql
|
|||||||
maxCntDb++;
|
maxCntDb++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lastTimeRos = ProgressBarUpdate(pBarROs, "ROMaster", 0, maxCntRo, maxCntRo, 1, lastTimeRos, true);
|
ProgressBarUpdate(pBarROs, "ROMaster", 0, maxCntRo, maxCntRo, 1, lastTimeRos, true);
|
||||||
lastTimeDbs = ProgressBarUpdate(pBarDbs, null, 0, maxCntDb, 0, 0, lastTimeDbs, false);
|
lastTimeDbs = ProgressBarUpdate(pBarDbs, null, 0, maxCntDb, 0, 0, lastTimeDbs, false);
|
||||||
reader.Close();
|
reader.Close();
|
||||||
reader = null;
|
|
||||||
|
|
||||||
// now migrate all the tables that were found
|
// now migrate all the tables that were found
|
||||||
foreach (string tableName in allTables)
|
foreach (string tableName in allTables)
|
||||||
@@ -318,7 +291,7 @@ namespace RoAccessToSql
|
|||||||
lastTimeRos = ProgressBarUpdate(pBarROs, null, 0, maxCntRo, 0, 0, lastTimeRos, true);
|
lastTimeRos = ProgressBarUpdate(pBarROs, null, 0, maxCntRo, 0, 0, lastTimeRos, true);
|
||||||
lastTimeDbs = ProgressBarUpdate(pBarDbs, allTablesText[cntDb], 0, maxCntDb, cntDb, 1, lastTimeDbs, false);
|
lastTimeDbs = ProgressBarUpdate(pBarDbs, allTablesText[cntDb], 0, maxCntDb, cntDb, 1, lastTimeDbs, false);
|
||||||
command = null;
|
command = null;
|
||||||
command = new OleDbCommand("select * from " + tableName, accessConnection);
|
command = new OleDbCommand($"select * from {tableName}", accessConnection);
|
||||||
reader = command.ExecuteReader();
|
reader = command.ExecuteReader();
|
||||||
while (reader.Read()) // read all of the records from the current access table
|
while (reader.Read()) // read all of the records from the current access table
|
||||||
{
|
{
|
||||||
@@ -338,7 +311,7 @@ namespace RoAccessToSql
|
|||||||
reader = null;
|
reader = null;
|
||||||
lastTimeRos = ProgressBarUpdate(pBarROs, tableName, 0, maxCntRo, maxCntRo, 1, lastTimeRos, false);
|
lastTimeRos = ProgressBarUpdate(pBarROs, tableName, 0, maxCntRo, maxCntRo, 1, lastTimeRos, false);
|
||||||
}
|
}
|
||||||
lastTimeDbs = ProgressBarUpdate(pBarDbs, allTablesText[maxCntDb - 1], 0, maxCntDb, maxCntDb, 1, lastTimeDbs, false);
|
ProgressBarUpdate(pBarDbs, allTablesText[maxCntDb - 1], 0, maxCntDb, maxCntDb, 1, lastTimeDbs, false);
|
||||||
pBarDbs.Text = "Referenced Object Tables Migration Completed";
|
pBarDbs.Text = "Referenced Object Tables Migration Completed";
|
||||||
pBarROs.Text = "Referenced Objects Migration Completed";
|
pBarROs.Text = "Referenced Objects Migration Completed";
|
||||||
btnConvert.Enabled = false;
|
btnConvert.Enabled = false;
|
||||||
@@ -357,7 +330,7 @@ namespace RoAccessToSql
|
|||||||
string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now);
|
string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now);
|
||||||
string strInsert = "INSERT INTO ROMaster (RecID, RecType, ModDateTime, Info) ";
|
string strInsert = "INSERT INTO ROMaster (RecID, RecType, ModDateTime, Info) ";
|
||||||
// note that '8' for rectype flags database converted:
|
// note that '8' for rectype flags database converted:
|
||||||
strInsert = strInsert + " VALUES ('09999999', 8, '" + dt + "', '" + _SqlConnectStr + "');";
|
strInsert = $"{strInsert} VALUES ('09999999', 8, '{dt}', '{_SqlConnectStr}');";
|
||||||
OleDbCommand command = new OleDbCommand(strInsert, accessConnection);
|
OleDbCommand command = new OleDbCommand(strInsert, accessConnection);
|
||||||
reader = command.ExecuteReader();
|
reader = command.ExecuteReader();
|
||||||
if (reader.Read()) return;
|
if (reader.Read()) return;
|
||||||
@@ -367,7 +340,7 @@ namespace RoAccessToSql
|
|||||||
MessageBox.Show(e.Message, "Error on insert to flag migration completed");
|
MessageBox.Show(e.Message, "Error on insert to flag migration completed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string _TmpFileForConnectStr = null;
|
private readonly string _TmpFileForConnectStr = null;
|
||||||
private void WriteSqlPathToTempFile()
|
private void WriteSqlPathToTempFile()
|
||||||
{
|
{
|
||||||
System.IO.File.WriteAllText(_TmpFileForConnectStr, _SqlConnectStr);
|
System.IO.File.WriteAllText(_TmpFileForConnectStr, _SqlConnectStr);
|
||||||
@@ -375,12 +348,11 @@ namespace RoAccessToSql
|
|||||||
// the following is used to update the progress bars, it finds how many records are in a table.
|
// the following is used to update the progress bars, it finds how many records are in a table.
|
||||||
private int GetRecordCountForTable(string tableName, OleDbConnection accessConnection)
|
private int GetRecordCountForTable(string tableName, OleDbConnection accessConnection)
|
||||||
{
|
{
|
||||||
OleDbDataReader reader = null;
|
|
||||||
int retcnt = 100;
|
int retcnt = 100;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OleDbCommand command = new OleDbCommand("SELECT COUNT (RecID) as cnt FROM " + tableName, accessConnection);
|
OleDbCommand command = new OleDbCommand($"SELECT COUNT (RecID) as cnt FROM {tableName}", accessConnection);
|
||||||
reader = command.ExecuteReader();
|
OleDbDataReader reader = command.ExecuteReader();
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
{
|
{
|
||||||
retcnt = reader.GetInt32(0);
|
retcnt = reader.GetInt32(0);
|
||||||
@@ -393,6 +365,7 @@ namespace RoAccessToSql
|
|||||||
}
|
}
|
||||||
return retcnt;
|
return retcnt;
|
||||||
}
|
}
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping min for Debugging")]
|
||||||
DateTime ProgressBarUpdate(DevComponents.DotNetBar.Controls.ProgressBarX pbi, string msg, int min, int max, int progress, int flag, DateTime lastUpdateDisplay, bool doTimeCheck)
|
DateTime ProgressBarUpdate(DevComponents.DotNetBar.Controls.ProgressBarX pbi, string msg, int min, int max, int progress, int flag, DateTime lastUpdateDisplay, bool doTimeCheck)
|
||||||
{
|
{
|
||||||
if (flag == 0) // setup
|
if (flag == 0) // setup
|
||||||
@@ -412,10 +385,12 @@ namespace RoAccessToSql
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SqlCommand command = new SqlCommand();
|
SqlCommand command = new SqlCommand
|
||||||
command.Connection = sqlConnection;
|
{
|
||||||
command.CommandType = CommandType.StoredProcedure;
|
Connection = sqlConnection,
|
||||||
command.CommandText = "insertAllRectypes";
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
CommandText = "insertAllRectypes"
|
||||||
|
};
|
||||||
command.Parameters.AddWithValue("@RecType", RecType);
|
command.Parameters.AddWithValue("@RecType", RecType);
|
||||||
if (AccPageID == null || AccPageID == "")
|
if (AccPageID == null || AccPageID == "")
|
||||||
command.Parameters.AddWithValue("@AccPageID", string.Empty);
|
command.Parameters.AddWithValue("@AccPageID", string.Empty);
|
||||||
@@ -428,7 +403,6 @@ namespace RoAccessToSql
|
|||||||
command.Parameters.AddWithValue("@ModDateTime", ModDateTime);
|
command.Parameters.AddWithValue("@ModDateTime", ModDateTime);
|
||||||
using (SqlDataReader reader = command.ExecuteReader())
|
using (SqlDataReader reader = command.ExecuteReader())
|
||||||
{
|
{
|
||||||
bool success = true;
|
|
||||||
}
|
}
|
||||||
command = null;
|
command = null;
|
||||||
}
|
}
|
||||||
@@ -438,29 +412,12 @@ namespace RoAccessToSql
|
|||||||
_MyLog.Error(msg, ex);
|
_MyLog.Error(msg, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void btnExit_Click(object sender, EventArgs e)
|
private void btnExit_Click(object sender, EventArgs e) => this.Close();
|
||||||
{
|
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
// the user selected the button to test the sql connection string
|
// the user selected the button to test the sql connection string
|
||||||
private void btnTestConnect_Click(object sender, EventArgs e)
|
private void btnTestConnect_Click(object sender, EventArgs e) => TestConnection(true);
|
||||||
{
|
|
||||||
TestConnection(true);
|
public static DateTime RevDate { get; set; } = DateTime.MinValue;
|
||||||
}
|
public static string RevDescription { get; set; } = "Unknown";
|
||||||
// the RevDate & RevDescription are found in a stored procedure, vesp_GetSQLCodeRevision, in the sql database. These get updated each
|
|
||||||
// time a revision is made to the sql database using ROFixes.sql script.
|
|
||||||
private static DateTime _RevDate = DateTime.MinValue;
|
|
||||||
public static DateTime RevDate
|
|
||||||
{
|
|
||||||
get { return _RevDate; }
|
|
||||||
set { _RevDate = value; }
|
|
||||||
}
|
|
||||||
private static string _RevDescription = "Unknown";
|
|
||||||
public static string RevDescription
|
|
||||||
{
|
|
||||||
get { return _RevDescription; }
|
|
||||||
set { _RevDescription = value; }
|
|
||||||
}
|
|
||||||
// This is called to test the sql connection, either from the button when pressed by user, or from the convert button, before
|
// This is called to test the sql connection, either from the button when pressed by user, or from the convert button, before
|
||||||
// the conversion is done. See below for what is checked
|
// the conversion is done. See below for what is checked
|
||||||
private bool TestConnection(bool notifyUser)
|
private bool TestConnection(bool notifyUser)
|
||||||
@@ -486,10 +443,12 @@ namespace RoAccessToSql
|
|||||||
if (connection.State == ConnectionState.Open)
|
if (connection.State == ConnectionState.Open)
|
||||||
{
|
{
|
||||||
// now see if there is an roall table
|
// now see if there is an roall table
|
||||||
SqlCommand command = new SqlCommand();
|
SqlCommand command = new SqlCommand
|
||||||
command.Connection = connection;
|
{
|
||||||
command.CommandType = CommandType.Text;
|
Connection = connection,
|
||||||
command.CommandText = "(SELECT count(*) FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ROALL]') AND type in (N'U'))";
|
CommandType = CommandType.Text,
|
||||||
|
CommandText = "(SELECT count(*) FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ROALL]') AND type in (N'U'))"
|
||||||
|
};
|
||||||
using (SqlDataReader reader = command.ExecuteReader())
|
using (SqlDataReader reader = command.ExecuteReader())
|
||||||
{
|
{
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
@@ -509,10 +468,12 @@ namespace RoAccessToSql
|
|||||||
{
|
{
|
||||||
// now see if there are stored procedures:
|
// now see if there are stored procedures:
|
||||||
command = null; // reset command
|
command = null; // reset command
|
||||||
command = new SqlCommand();
|
command = new SqlCommand
|
||||||
command.Connection = connection;
|
{
|
||||||
command.CommandType = CommandType.Text;
|
Connection = connection,
|
||||||
command.CommandText = "(SELECT count(*) FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteByROTable]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)";
|
CommandType = CommandType.Text,
|
||||||
|
CommandText = "(SELECT count(*) FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteByROTable]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)"
|
||||||
|
};
|
||||||
using (SqlDataReader reader = command.ExecuteReader())
|
using (SqlDataReader reader = command.ExecuteReader())
|
||||||
{
|
{
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
@@ -533,10 +494,12 @@ namespace RoAccessToSql
|
|||||||
{
|
{
|
||||||
// now test that the roall table is empty:
|
// now test that the roall table is empty:
|
||||||
command = null; // reset command
|
command = null; // reset command
|
||||||
command = new SqlCommand();
|
command = new SqlCommand
|
||||||
command.Connection = connection;
|
{
|
||||||
command.CommandType = CommandType.Text;
|
Connection = connection,
|
||||||
command.CommandText = "SELECT count(*) FROM roall";
|
CommandType = CommandType.Text,
|
||||||
|
CommandText = "SELECT count(*) FROM roall"
|
||||||
|
};
|
||||||
using (SqlDataReader reader = command.ExecuteReader())
|
using (SqlDataReader reader = command.ExecuteReader())
|
||||||
{
|
{
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
@@ -557,16 +520,18 @@ namespace RoAccessToSql
|
|||||||
{
|
{
|
||||||
// now test that the database version is ok
|
// now test that the database version is ok
|
||||||
command = null; // reset command
|
command = null; // reset command
|
||||||
command = new SqlCommand();
|
command = new SqlCommand
|
||||||
command.Connection = connection;
|
{
|
||||||
command.CommandType = CommandType.StoredProcedure;
|
Connection = connection,
|
||||||
command.CommandText = "vesp_GetSQLCodeRevision";
|
CommandType = CommandType.StoredProcedure,
|
||||||
|
CommandText = "vesp_GetSQLCodeRevision"
|
||||||
|
};
|
||||||
using (SqlDataReader reader = command.ExecuteReader())
|
using (SqlDataReader reader = command.ExecuteReader())
|
||||||
{
|
{
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
{
|
{
|
||||||
_RevDate = reader.GetDateTime(0);
|
RevDate = reader.GetDateTime(0);
|
||||||
_RevDescription = reader.GetString(1);
|
RevDescription = reader.GetString(1);
|
||||||
dbsuc = true;
|
dbsuc = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -582,13 +547,13 @@ namespace RoAccessToSql
|
|||||||
}
|
}
|
||||||
catch (SqlException ex)
|
catch (SqlException ex)
|
||||||
{
|
{
|
||||||
if (notifyUser) MessageBox.Show("Connection failed: " + ex, "Connection Failed");
|
if (notifyUser) MessageBox.Show($"Connection failed: {ex}", "Connection Failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
if (notifyUser) MessageBox.Show("Connection failed: " + ex, "Connection Failed");
|
if (notifyUser) MessageBox.Show($"Connection failed: {ex}", "Connection Failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notifyUser && success) MessageBox.Show("You have been successfully connected to the database!", "Connection Succeeded");
|
if (notifyUser && success) MessageBox.Show("You have been successfully connected to the database!", "Connection Succeeded");
|
||||||
|
|||||||
@@ -66,6 +66,7 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="GlobalSuppressions.cs" />
|
||||||
<Compile Include="RoAccessToSql.cs">
|
<Compile Include="RoAccessToSql.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1817,7 +1817,7 @@ ALTER trigger [dbo].[tr_Contents_Delete] on [dbo].[Contents] instead of delete a
|
|||||||
select ii.ContentID,ii.Number,ii.Text,ii.Type,ii.FormatID,ii.Config,ii.DTS,ii.UserID,ii.DeleteStatus,ii.ActionDTS
|
select ii.ContentID,ii.Number,ii.Text,ii.Type,ii.FormatID,ii.Config,ii.DTS,ii.UserID,ii.DeleteStatus,ii.ActionDTS
|
||||||
from tblContents ii inner join deleted dd on dd.ContentID = ii.ContentID
|
from tblContents ii inner join deleted dd on dd.ContentID = ii.ContentID
|
||||||
where ii.DeleteStatus > 0
|
where ii.DeleteStatus > 0
|
||||||
update ga set ga.contentauditid = (select max(auditid) from contentaudits where contentid = ga.contentid and deletestatus = ga.deletestatus)
|
update ga set ga.contentauditid = (select ISNULL(max(auditid),0) from contentaudits where contentid = ga.contentid and deletestatus = ga.deletestatus)
|
||||||
from gridaudits ga join deleted dd on ga.contentid = dd.contentid where ga.contentauditid = 0
|
from gridaudits ga join deleted dd on ga.contentid = dd.contentid where ga.contentauditid = 0
|
||||||
end
|
end
|
||||||
go
|
go
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Collections;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace Accentra.Controls
|
namespace Accentra.Controls
|
||||||
@@ -11,11 +8,6 @@ namespace Accentra.Controls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class TablePicker : System.Windows.Forms.Form
|
public class TablePicker : System.Windows.Forms.Form
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Required designer variable.
|
|
||||||
/// </summary>
|
|
||||||
private System.ComponentModel.Container components = null;
|
|
||||||
|
|
||||||
public TablePicker()
|
public TablePicker()
|
||||||
{
|
{
|
||||||
// Activates double buffering
|
// Activates double buffering
|
||||||
@@ -29,21 +21,6 @@ namespace Accentra.Controls
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clean up any resources being used.
|
|
||||||
/// </summary>
|
|
||||||
protected override void Dispose( bool disposing )
|
|
||||||
{
|
|
||||||
if( disposing )
|
|
||||||
{
|
|
||||||
if(components != null)
|
|
||||||
{
|
|
||||||
components.Dispose();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
base.Dispose( disposing );
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
#region Windows Form Designer generated code
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required method for Designer support - do not modify
|
/// Required method for Designer support - do not modify
|
||||||
@@ -75,80 +52,39 @@ namespace Accentra.Controls
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private Pen BeigePen = new Pen(Color.Beige, 1);
|
private readonly Brush BlackBrush = System.Drawing.Brushes.Black;
|
||||||
private Brush BeigeBrush = System.Drawing.Brushes.Beige;
|
private readonly Brush WhiteBrush = System.Drawing.Brushes.White;
|
||||||
private Brush GrayBrush = System.Drawing.Brushes.Gray;
|
|
||||||
private Brush BlackBrush = System.Drawing.Brushes.Black;
|
|
||||||
private Brush WhiteBrush = System.Drawing.Brushes.White;
|
|
||||||
|
|
||||||
private Brush Jbrush = System.Drawing.Brushes.LightBlue;
|
private readonly Brush Jbrush = System.Drawing.Brushes.LightBlue;
|
||||||
//private Brush Jbrush = System.Drawing.Brushes.LightSteelBlue;
|
|
||||||
//private Brush Jbrush = System.Drawing.Brushes.SteelBlue;
|
|
||||||
//private Brush Jbrush = System.Drawing.Brushes.PowderBlue;
|
|
||||||
|
|
||||||
private Pen BorderPen = new Pen(SystemColors.ControlDark);
|
private readonly Pen BorderPen = new Pen(SystemColors.ControlDark);
|
||||||
private Pen BluePen = new Pen(Color.SlateGray, 1);
|
private readonly Pen BluePen = new Pen(Color.SlateGray, 1);
|
||||||
|
|
||||||
private string DispText = "Esc to Cancel"; // Display text
|
private string DispText = "Esc to Cancel"; // Display text
|
||||||
private int DispHeight = 40;//20; // Display ("Table 1x1", "Cancel")
|
private readonly int DispHeight = 40; // Display ("Table 1x1", "Cancel")
|
||||||
private Font DispFont = new Font("Tahoma", 8.25F);
|
private readonly Font DispFont = new Font("Tahoma", 8.25F);
|
||||||
private int SquareX = 20; // Width of squares
|
private readonly int SquareX = 20; // Width of squares
|
||||||
private int SquareY = 20; // Height of squares
|
private readonly int SquareY = 20; // Height of squares
|
||||||
private int SquareQX = 3; // Number of visible squares (X)
|
private int SquareQX = 3; // Number of visible squares (X)
|
||||||
private int SquareQY = 3; // Number of visible squares (Y)
|
private int SquareQY = 3; // Number of visible squares (Y)
|
||||||
private int SelQX = 1; // Number of selected squares (x)
|
private int SelQX = 1; // Number of selected squares (x)
|
||||||
private int SelQY = 1; // Number of selected squares (y)
|
private int SelQY = 1; // Number of selected squares (y)
|
||||||
|
|
||||||
private bool bHiding = false;
|
public int MaxRows { get; set; } = -1;
|
||||||
private bool bCancel = true; // Determines whether to Cancel
|
|
||||||
|
|
||||||
// Added my Volian 4/27/11
|
public int MaxCols { get; set; } = -1;
|
||||||
private int _MaxRows = -1;
|
|
||||||
|
|
||||||
public int MaxRows
|
|
||||||
{
|
|
||||||
get { return _MaxRows; }
|
|
||||||
set { _MaxRows = value; }
|
|
||||||
}
|
|
||||||
private int _MaxCols = -1;
|
|
||||||
|
|
||||||
public int MaxCols
|
|
||||||
{
|
|
||||||
get { return _MaxCols; }
|
|
||||||
set { _MaxCols = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Similar to <code><see cref="DialogResult"/>
|
|
||||||
/// == <see cref="DialogResult.Cancel"/></code>,
|
|
||||||
/// but is used as a state value before the form
|
|
||||||
/// is hidden and cancellation is finalized.
|
|
||||||
/// </summary>
|
|
||||||
public bool Cancel {
|
|
||||||
get {
|
|
||||||
return bCancel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the number of columns, or the horizontal / X count,
|
/// Returns the number of columns, or the horizontal / X count,
|
||||||
/// of the selection.
|
/// of the selection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int SelectedColumns {
|
public int SelectedColumns => SelQX;
|
||||||
get {
|
|
||||||
return SelQX;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the number of rows, or the vertical / Y count,
|
/// Returns the number of rows, or the vertical / Y count,
|
||||||
/// of the selection.
|
/// of the selection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int SelectedRows {
|
public int SelectedRows => SelQY;
|
||||||
get {
|
|
||||||
return SelQY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TablePicker_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {
|
private void TablePicker_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {
|
||||||
Graphics g = e.Graphics;
|
Graphics g = e.Graphics;
|
||||||
@@ -162,8 +98,8 @@ namespace Accentra.Controls
|
|||||||
if (SquareQX < 7) SquareQX = 7;
|
if (SquareQX < 7) SquareQX = 7;
|
||||||
if (SquareQY < 5) SquareQY = 5;
|
if (SquareQY < 5) SquareQY = 5;
|
||||||
|
|
||||||
if (_MaxRows > 0 && SquareQY > _MaxRows) SquareQY = _MaxRows;
|
if (MaxRows > 0 && SquareQY > MaxRows) SquareQY = MaxRows;
|
||||||
if (_MaxCols > 0 && SquareQX > _MaxCols) SquareQX = _MaxCols;
|
if (MaxCols > 0 && SquareQX > MaxCols) SquareQX = MaxCols;
|
||||||
|
|
||||||
// Second, expand the dimensions of this form according to the
|
// Second, expand the dimensions of this form according to the
|
||||||
// number of visible squares.
|
// number of visible squares.
|
||||||
@@ -177,14 +113,7 @@ namespace Accentra.Controls
|
|||||||
// the text is left-justified, only the Y (vertical) position
|
// the text is left-justified, only the Y (vertical) position
|
||||||
// is calculated.
|
// is calculated.
|
||||||
int dispY = ((SquareY - 1) * SquareQY) + SquareQY + 4;
|
int dispY = ((SquareY - 1) * SquareQY) + SquareQY + 4;
|
||||||
//if (this.Cancel) {
|
DispText = $"{SelQY} Row{((SelQY > 1) ? "s" : "")} {SelQX} Column{((SelQX > 1) ? "s" : "")}\nEsc to Cancel";
|
||||||
// DispText = "Esc Key to Cancel";
|
|
||||||
//} else {
|
|
||||||
// DispText = SelQX.ToString() + " by " + SelQY.ToString() + " Table";
|
|
||||||
//}
|
|
||||||
//DispText = SelQX.ToString() + " by " + SelQY.ToString() + " Table\nEsc Key to Cancel";
|
|
||||||
//DispText = SelQY.ToString() + " Row"+((SelQY>1)?"s by ":" by ") + SelQX.ToString() + " Column"+((SelQX>1)?"s\nEsc Key to Cancel":"\nEsc Key to Cancel");
|
|
||||||
DispText = SelQY.ToString() + " Row" + ((SelQY > 1) ? "s" : "") + " " + SelQX.ToString() + " Column" + ((SelQX > 1) ? "s" : "")+ "\nEsc to Cancel";
|
|
||||||
g.DrawString(DispText, DispFont, BlackBrush, 3, dispY + 2);
|
g.DrawString(DispText, DispFont, BlackBrush, 3, dispY + 2);
|
||||||
|
|
||||||
// Draw each of the squares and fill with the default color.
|
// Draw each of the squares and fill with the default color.
|
||||||
@@ -198,7 +127,6 @@ namespace Accentra.Controls
|
|||||||
// Go back and paint the squares with selection colors.
|
// Go back and paint the squares with selection colors.
|
||||||
for (int x=0; x<SelQX; x++) {
|
for (int x=0; x<SelQX; x++) {
|
||||||
for (int y=0; y<SelQY; y++) {
|
for (int y=0; y<SelQY; y++) {
|
||||||
//g.FillRectangle(BeigeBrush, (x*SquareX) + 3, (y*SquareY) + 3, SquareX - 2, SquareY - 2);
|
|
||||||
g.FillRectangle(Jbrush, (x * SquareX) + 3, (y * SquareY) + 3, SquareX - 2, SquareY - 2);
|
g.FillRectangle(Jbrush, (x * SquareX) + 3, (y * SquareY) + 3, SquareX - 2, SquareY - 2);
|
||||||
g.DrawRectangle(BluePen, (x * SquareX) + 3, (y * SquareY) + 3, SquareX - 2, SquareY - 2);
|
g.DrawRectangle(BluePen, (x * SquareX) + 3, (y * SquareY) + 3, SquareX - 2, SquareY - 2);
|
||||||
}
|
}
|
||||||
@@ -210,11 +138,6 @@ namespace Accentra.Controls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void TablePicker_Deactivate(object sender, System.EventArgs e) {
|
private void TablePicker_Deactivate(object sender, System.EventArgs e) {
|
||||||
|
|
||||||
// bCancel = true
|
|
||||||
// and DialogResult = DialogResult.Cancel
|
|
||||||
// were previously already set in MouseLeave.
|
|
||||||
|
|
||||||
//this.Hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -242,9 +165,6 @@ namespace Accentra.Controls
|
|||||||
/// escaped (canceling) state.
|
/// escaped (canceling) state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void TablePicker_MouseLeave(object sender, System.EventArgs e) {
|
private void TablePicker_MouseLeave(object sender, System.EventArgs e) {
|
||||||
//if (!bHiding) bCancel = true;
|
|
||||||
//this.DialogResult = DialogResult.Cancel;
|
|
||||||
//this.Invalidate();
|
|
||||||
if (this.DialogResult == DialogResult.None)
|
if (this.DialogResult == DialogResult.None)
|
||||||
this.DialogResult = DialogResult.Cancel;
|
this.DialogResult = DialogResult.Cancel;
|
||||||
}
|
}
|
||||||
@@ -252,32 +172,17 @@ namespace Accentra.Controls
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Cancels the prior cancellation caused by MouseLeave.
|
/// Cancels the prior cancellation caused by MouseLeave.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void TablePicker_MouseEnter(object sender, System.EventArgs e) {
|
private void TablePicker_MouseEnter(object sender, System.EventArgs e) => this.Invalidate();
|
||||||
//bHiding = false;
|
|
||||||
//bCancel = false;
|
|
||||||
//this.DialogResult = DialogResult.OK;
|
|
||||||
this.Invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Detects that the user made a selection by clicking.
|
/// Detects that the user made a selection by clicking.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void TablePicker_Click(object sender, System.EventArgs e) {
|
private void TablePicker_Click(object sender, System.EventArgs e) => this.DialogResult = DialogResult.OK;
|
||||||
//bHiding = true; // Not the same as Visible == false
|
|
||||||
// // because bHiding suggests that the control
|
|
||||||
// // is still "active" (not canceled).
|
|
||||||
//this.Hide();
|
|
||||||
this.DialogResult = DialogResult.OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TablePicker_KeyPress(object sender, KeyPressEventArgs e)
|
private void TablePicker_KeyPress(object sender, KeyPressEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.KeyChar == (char)Keys.Escape)
|
if (e.KeyChar == (char)Keys.Escape)
|
||||||
{
|
{
|
||||||
//bHiding = true; // Not the same as Visible == false
|
|
||||||
//// because bHiding suggests that the control
|
|
||||||
//// is still "active" (not canceled).
|
|
||||||
//this.Hide();
|
|
||||||
this.DialogResult = DialogResult.Cancel;
|
this.DialogResult = DialogResult.Cancel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Volian.Controls.Library;
|
using Volian.Controls.Library;
|
||||||
@@ -24,7 +21,7 @@ namespace VEPROMS
|
|||||||
string connectionString = Database.VEPROMS_Connection;
|
string connectionString = Database.VEPROMS_Connection;
|
||||||
Match mServer = Regex.Match(connectionString, ".*Data Source=([^;]*).*");
|
Match mServer = Regex.Match(connectionString, ".*Data Source=([^;]*).*");
|
||||||
_SQLServerName = (mServer.Success) ? mServer.Groups[1].Value : "unknown";
|
_SQLServerName = (mServer.Success) ? mServer.Groups[1].Value : "unknown";
|
||||||
if (_SQLServerName.StartsWith(@".\")) _SQLServerName = @"Local \ " + _SQLServerName.Substring(2);
|
if (_SQLServerName.StartsWith(@".\")) _SQLServerName = $@"Local \ {_SQLServerName.Substring(2)}";
|
||||||
}
|
}
|
||||||
return _SQLServerName;
|
return _SQLServerName;
|
||||||
}
|
}
|
||||||
@@ -37,7 +34,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
if (_DatabaseName == null)
|
if (_DatabaseName == null)
|
||||||
{
|
{
|
||||||
_DatabaseName = string.Format("{0}[SQL:{1:yyMM.ddHH}]", Database.ActiveDatabase, Database.RevDate);
|
_DatabaseName = $"{Database.ActiveDatabase}[SQL:{Database.RevDate:yyMM.ddHH}]";
|
||||||
}
|
}
|
||||||
return _DatabaseName;
|
return _DatabaseName;
|
||||||
}
|
}
|
||||||
@@ -55,26 +52,16 @@ namespace VEPROMS
|
|||||||
DateTime buildDateTime = new System.IO.FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
|
DateTime buildDateTime = new System.IO.FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
|
||||||
// If the AssemblyConfiguration is "DEMO" then we are running a Demo version
|
// If the AssemblyConfiguration is "DEMO" then we are running a Demo version
|
||||||
string demoTxt = VlnSettings.DemoMode ? "(Demo)": VlnSettings.DebugMode ? "(Debug)" : "(Production)";
|
string demoTxt = VlnSettings.DemoMode ? "(Demo)": VlnSettings.DebugMode ? "(Debug)" : "(Production)";
|
||||||
// C2018-015 made this information static so we can use in meta files
|
Text = $"About {AssemblyTitle} {demoTxt}";
|
||||||
//string connectionString = Database.VEPROMS_Connection;
|
labelProductName.Text = AssemblyProduct;
|
||||||
//Match mServer = Regex.Match(connectionString,".*Data Source=([^;]*).*");
|
labelVersion.Text = $"Version {AssemblyVersion}";
|
||||||
//string server = (mServer.Success)?mServer.Groups[1].Value:"unknown";
|
labelVersionDateTime.Text = $"Build Date: {buildDateTime}";
|
||||||
//if (server.StartsWith(@".\")) server = @"Local \ " + server.Substring(2);
|
labelCopyright.Text = $"Copyright © {buildDateTime.Year}. All Rights Reserved.";
|
||||||
//string databaseName = string.Format("{0}[SQL:{1:yyMM.ddHH}]", Database.ActiveDatabase, Database.RevDate);
|
labelCompanyName.Text = AssemblyCompany;
|
||||||
this.Text = String.Format("About {0}", AssemblyTitle + " " + demoTxt);
|
labelCompanyName.Links[0].LinkData = "Volian Enterprises Inc.";
|
||||||
this.labelProductName.Text = AssemblyProduct;
|
labelCompanyName.Links.Add(0,23,"www.volian.com");
|
||||||
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
|
labelServer.Text = $"SQL Server: {SQLServerName}"; // C2018-015 use static for this info.
|
||||||
this.labelVersionDateTime.Text = String.Format("Build Date: {0}", buildDateTime.ToString());
|
labelDatabase.Text = $"Database: {DatabaseName}"; // C2018-015 use static for this info.
|
||||||
this.labelCopyright.Text = String.Format("Copyright © {0}. All Rights Reserved.", buildDateTime.Year.ToString());
|
|
||||||
this.labelCompanyName.Text = AssemblyCompany;
|
|
||||||
// this.textBoxDescription.Text = AssemblyDescription;
|
|
||||||
this.labelCompanyName.Links[0].LinkData = "Volian Enterprises Inc.";
|
|
||||||
this.labelCompanyName.Links.Add(0,23,"www.volian.com");
|
|
||||||
//this.labelServer.Text = string.Format("SQL Server: {0}", server);
|
|
||||||
this.labelServer.Text = string.Format("SQL Server: {0}", SQLServerName); // C2018-015 use static for this info.
|
|
||||||
//if (databaseName == null) databaseName = Regex.Replace(connectionString, "^.*Initial Catalog=([^;]*);.*$", "$1", RegexOptions.IgnoreCase);
|
|
||||||
//this.labelDatabase.Text = string.Format("Database: {0}", databaseName);
|
|
||||||
this.labelDatabase.Text = string.Format("Database: {0}", DatabaseName); // C2018-015 use static for this info.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Assembly Attribute Accessors
|
#region Assembly Attribute Accessors
|
||||||
@@ -99,22 +86,10 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string AssemblyVersion
|
public string AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// C2018-009 used to print the PROMS version number at the top of each PDF page
|
// C2018-009 used to print the PROMS version number at the top of each PDF page
|
||||||
public static string PROMSVersion
|
public static string PROMSVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string AssemblyDescription
|
public string AssemblyDescription
|
||||||
{
|
{
|
||||||
@@ -162,7 +137,7 @@ namespace VEPROMS
|
|||||||
private void labelCompanyName_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
private void labelCompanyName_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||||
{
|
{
|
||||||
// Determine which link was clicked within the LinkLabel.
|
// Determine which link was clicked within the LinkLabel.
|
||||||
this.labelCompanyName.Links[0].Visited = true;
|
labelCompanyName.Links[0].Visited = true;
|
||||||
|
|
||||||
// Display the appropriate link based on the value of the
|
// Display the appropriate link based on the value of the
|
||||||
// LinkData property of the Link object.
|
// LinkData property of the Link object.
|
||||||
@@ -171,17 +146,16 @@ namespace VEPROMS
|
|||||||
System.Diagnostics.Process.Start(target); // this should start the default web browser
|
System.Diagnostics.Process.Start(target); // this should start the default web browser
|
||||||
}
|
}
|
||||||
|
|
||||||
private void logoPictureBox_Click(object sender, EventArgs e)
|
private void logoPictureBox_Click(object sender, EventArgs e) => System.Diagnostics.Process.Start(labelCompanyName.Links[0].LinkData as string); // this should start the default web browser
|
||||||
{
|
|
||||||
System.Diagnostics.Process.Start(labelCompanyName.Links[0].LinkData as string); // this should start the default web browser
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnViewEULA_Click(object sender, EventArgs e)
|
private void btnViewEULA_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string EulaFile = string.Format(@"\{0}", VlnSettings.EULAfile);
|
string EulaFile = $@"\{VlnSettings.EULAfile}";
|
||||||
string strEULA = System.Environment.CurrentDirectory + EulaFile;
|
string strEULA = System.Environment.CurrentDirectory + EulaFile;
|
||||||
frmViewTextFile ViewFile = new frmViewTextFile(strEULA,RichTextBoxStreamType.PlainText);
|
frmViewTextFile ViewFile = new frmViewTextFile(strEULA, RichTextBoxStreamType.PlainText)
|
||||||
ViewFile.Text = "End-User License Agreement";
|
{
|
||||||
|
Text = "End-User License Agreement"
|
||||||
|
};
|
||||||
ViewFile.ShowDialog();
|
ViewFile.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using VEPROMS.CSLA.Library;
|
|
||||||
|
|
||||||
namespace VEPROMS
|
|
||||||
{
|
|
||||||
public class BookMarks
|
|
||||||
{
|
|
||||||
public string Name;
|
|
||||||
public VETreeNode Node;
|
|
||||||
|
|
||||||
public BookMarks()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public BookMarks(string n, VETreeNode o)
|
|
||||||
{
|
|
||||||
Name = n;
|
|
||||||
Node = o;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BookMarks(VETreeNode o)
|
|
||||||
{
|
|
||||||
Name = o.Text;
|
|
||||||
Node = o;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return Name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
@@ -14,10 +9,7 @@ namespace VEPROMS
|
|||||||
// C2025-027 Annotation Type Filtering
|
// C2025-027 Annotation Type Filtering
|
||||||
public partial class dlgAnnotationsSelect : Form
|
public partial class dlgAnnotationsSelect : Form
|
||||||
{
|
{
|
||||||
public dlgAnnotationsSelect()
|
public dlgAnnotationsSelect() => InitializeComponent();
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
public dlgAnnotationsSelect(string userid)
|
public dlgAnnotationsSelect(string userid)
|
||||||
{
|
{
|
||||||
@@ -25,30 +17,13 @@ namespace VEPROMS
|
|||||||
UserID = userid;
|
UserID = userid;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int _MyItemID;
|
public int MyItemID { get; set; }
|
||||||
public int MyItemID
|
public string UserID { get; set; }
|
||||||
{
|
|
||||||
get { return _MyItemID; }
|
|
||||||
set { _MyItemID = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private string _UserID;
|
private void btnSelect_Click(object sender, EventArgs e) => MoveSelectedItems(lstUnselected, lstSelected);
|
||||||
public string UserID
|
|
||||||
{
|
|
||||||
get { return _UserID; }
|
|
||||||
set { _UserID = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnSelect_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
MoveSelectedItems(lstUnselected, lstSelected);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Move selected items to lstUnselected.
|
// Move selected items to lstUnselected.
|
||||||
private void btnDeselect_Click(object sender, EventArgs e)
|
private void btnDeselect_Click(object sender, EventArgs e) => MoveSelectedItems(lstSelected, lstUnselected);
|
||||||
{
|
|
||||||
MoveSelectedItems(lstSelected, lstUnselected);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Move selected items from one ListBox to another.
|
// Move selected items from one ListBox to another.
|
||||||
private void MoveSelectedItems(ListBox lstFrom, ListBox lstTo)
|
private void MoveSelectedItems(ListBox lstFrom, ListBox lstTo)
|
||||||
@@ -90,39 +65,21 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Enable and disable buttons.
|
// Enable and disable buttons.
|
||||||
private void lst_SelectedIndexChanged(object sender, EventArgs e)
|
private void lst_SelectedIndexChanged(object sender, EventArgs e) => SetButtonsEditable();
|
||||||
{
|
|
||||||
SetButtonsEditable();
|
|
||||||
}
|
|
||||||
// Save selected list to DB.
|
// Save selected list to DB.
|
||||||
private void btnUpdate_Click(object sender, EventArgs e)
|
private void btnUpdate_Click(object sender, EventArgs e) => saveChanges();
|
||||||
{
|
|
||||||
saveChanges();
|
|
||||||
}
|
|
||||||
public class AnnotataionItem
|
public class AnnotataionItem
|
||||||
{
|
{
|
||||||
private string _NameStr;
|
private readonly string _NameStr;
|
||||||
private int _TypeID;
|
private readonly int _TypeID;
|
||||||
|
|
||||||
public AnnotataionItem(string NameStr, int TypeID)
|
public AnnotataionItem(string NameStr, int TypeID)
|
||||||
{
|
{
|
||||||
this._NameStr = NameStr;
|
_NameStr = NameStr;
|
||||||
this._TypeID = TypeID;
|
_TypeID = TypeID;
|
||||||
}
|
|
||||||
public string NameStr
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _NameStr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public int TypeID
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _TypeID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
public string NameStr => _NameStr;
|
||||||
|
public int TypeID => _TypeID;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable and disable buttons.
|
// Enable and disable buttons.
|
||||||
@@ -167,16 +124,16 @@ namespace VEPROMS
|
|||||||
if (result == DialogResult.Yes)
|
if (result == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
saveChanges();
|
saveChanges();
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
{
|
{
|
||||||
@@ -16,18 +8,9 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
private bool _Cancel = true;
|
private bool _Cancel = true;
|
||||||
|
|
||||||
public bool Cancel
|
public bool Cancel => _Cancel;
|
||||||
{
|
|
||||||
get { return _Cancel; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool _ExitPROMS;
|
public bool ExitPROMS { get; set; }
|
||||||
|
|
||||||
public bool ExitPROMS
|
|
||||||
{
|
|
||||||
get { return _ExitPROMS; }
|
|
||||||
set { _ExitPROMS = value; }
|
|
||||||
}
|
|
||||||
public DlgCloseTabsOrExit(bool isMainWindow, bool hasChildWindows)
|
public DlgCloseTabsOrExit(bool isMainWindow, bool hasChildWindows)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -46,22 +29,22 @@ namespace VEPROMS
|
|||||||
private void BtnClsTab_Click(object sender, EventArgs e)
|
private void BtnClsTab_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_Cancel = false;
|
_Cancel = false;
|
||||||
_ExitPROMS = false;
|
ExitPROMS = false;
|
||||||
this.Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnExitPROMS_Click(object sender, EventArgs e)
|
private void BtnExitPROMS_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_Cancel = false;
|
_Cancel = false;
|
||||||
_ExitPROMS = true;
|
ExitPROMS = true;
|
||||||
this.Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnCancel_Click(object sender, EventArgs e)
|
private void btnCancel_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_Cancel = true;
|
_Cancel = true;
|
||||||
_ExitPROMS = false;
|
ExitPROMS = false;
|
||||||
this.Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,20 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using Volian.Print.Library;
|
using Volian.Print.Library;
|
||||||
//using Volian.Controls.Library;
|
|
||||||
using Volian.Base.Library;
|
using Volian.Base.Library;
|
||||||
using JR.Utils.GUI.Forms;
|
using JR.Utils.GUI.Forms;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
{
|
{
|
||||||
public partial class DlgPrintProcedure : DevComponents.DotNetBar.Office2007Form
|
public partial class DlgPrintProcedure : DevComponents.DotNetBar.Office2007Form
|
||||||
{
|
{
|
||||||
public bool SaveLinks
|
public bool SaveLinks => swtbtnPDFLinks.Value;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return swtbtnPDFLinks.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public int RemoveTrailingHardReturnsAndManualPageBreaks
|
public int RemoveTrailingHardReturnsAndManualPageBreaks
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -36,37 +28,18 @@ namespace VEPROMS
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string _Prefix = ""; // RHM20150506 Multiline ItemID TextBox
|
// RHM20150506 Multiline ItemID TextBox
|
||||||
public string Prefix
|
public string Prefix { get; set; } = "";
|
||||||
{
|
|
||||||
get { return _Prefix; }
|
|
||||||
set { _Prefix = value; }
|
|
||||||
}
|
|
||||||
public bool OpenAfterCreate // RHM20150506 Multiline ItemID TextBox
|
public bool OpenAfterCreate // RHM20150506 Multiline ItemID TextBox
|
||||||
{
|
{
|
||||||
get { return cbxOpenAfterCreate2.Checked; }
|
get { return cbxOpenAfterCreate2.Checked; }
|
||||||
set { cbxOpenAfterCreate2.Checked = value; }
|
set { cbxOpenAfterCreate2.Checked = value; }
|
||||||
}
|
}
|
||||||
private SessionInfo _MySessionInfo;
|
|
||||||
public SessionInfo MySessionInfo
|
|
||||||
{
|
|
||||||
get { return _MySessionInfo; }
|
|
||||||
set { _MySessionInfo = value; }
|
|
||||||
}
|
|
||||||
private bool _Automatic;
|
|
||||||
public bool Automatic
|
|
||||||
{
|
|
||||||
get { return _Automatic; }
|
|
||||||
set { _Automatic = value; }
|
|
||||||
}
|
|
||||||
private int _prtSectID = -1;
|
|
||||||
public int PrtSectID
|
|
||||||
{
|
|
||||||
get { return _prtSectID; }
|
|
||||||
set { _prtSectID = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool _OverwritePDF;
|
public SessionInfo MySessionInfo { get; set; }
|
||||||
|
public bool Automatic { get; set; }
|
||||||
|
public int PrtSectID { get; set; } = -1;
|
||||||
|
|
||||||
public bool OverwritePDF
|
public bool OverwritePDF
|
||||||
{
|
{
|
||||||
get { return cbxOverwritePDF2.Checked; }
|
get { return cbxOverwritePDF2.Checked; }
|
||||||
@@ -85,7 +58,7 @@ namespace VEPROMS
|
|||||||
swtbtnPDFdtPrefixSuffix.Value = swtbtnPDFdtPrefixSuffix.Enabled = _AllowDateTimePrefixSuffix;
|
swtbtnPDFdtPrefixSuffix.Value = swtbtnPDFdtPrefixSuffix.Enabled = _AllowDateTimePrefixSuffix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private DateTime _PrefixSuffixDTS = DateTime.Now; // C2018-033 date/time used for the date/time PDF file prefix and suffix
|
private readonly DateTime _PrefixSuffixDTS = DateTime.Now; // C2018-033 date/time used for the date/time PDF file prefix and suffix
|
||||||
private bool _DateTimePrefixSuffixPrintingAllProcedures = true; // C2018-033 to control adding the Date/Time Prefix/Suffix to PFD name when printing All procedures
|
private bool _DateTimePrefixSuffixPrintingAllProcedures = true; // C2018-033 to control adding the Date/Time Prefix/Suffix to PFD name when printing All procedures
|
||||||
private bool _IncludeWordSecTextInMetafile = true; // C2018-023 so that we can turn off including Word attachment text in metafile
|
private bool _IncludeWordSecTextInMetafile = true; // C2018-023 so that we can turn off including Word attachment text in metafile
|
||||||
private void RunAutomatic()
|
private void RunAutomatic()
|
||||||
@@ -96,7 +69,6 @@ namespace VEPROMS
|
|||||||
_IncludeWordSecTextInMetafile = true;
|
_IncludeWordSecTextInMetafile = true;
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray());
|
string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray());
|
||||||
bool ranAuto = false;
|
|
||||||
foreach (string parameter in parameters)
|
foreach (string parameter in parameters)
|
||||||
{
|
{
|
||||||
if (parameter.ToUpper() == "/NT")
|
if (parameter.ToUpper() == "/NT")
|
||||||
@@ -111,11 +83,11 @@ namespace VEPROMS
|
|||||||
_IncludeWordSecTextInMetafile = false; // C2018-023 turn off putting Word attachment text in the meta file for baseline compares
|
_IncludeWordSecTextInMetafile = false; // C2018-023 turn off putting Word attachment text in the meta file for baseline compares
|
||||||
}
|
}
|
||||||
CreatePDFs();
|
CreatePDFs();
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
private DocVersionInfo _DocVersionInfo = null;
|
private readonly DocVersionInfo _DocVersionInfo = null;
|
||||||
private bool _AllProcedures;
|
private readonly bool _AllProcedures;
|
||||||
private DocVersionConfig _DocVersionConfig;
|
private readonly DocVersionConfig _DocVersionConfig;
|
||||||
public string RevNum
|
public string RevNum
|
||||||
{
|
{
|
||||||
get { return txbRevNum.Text; }
|
get { return txbRevNum.Text; }
|
||||||
@@ -143,10 +115,7 @@ namespace VEPROMS
|
|||||||
return RevNum + "/" + RevDate;
|
return RevNum + "/" + RevDate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string ProcNum
|
public string ProcNum => MyProcedure.DisplayNumber;
|
||||||
{
|
|
||||||
get { return MyProcedure.DisplayNumber; }
|
|
||||||
}
|
|
||||||
public string PDFPath
|
public string PDFPath
|
||||||
{
|
{
|
||||||
get {// B2018-069 Revert to Temporary for Baseline testing
|
get {// B2018-069 Revert to Temporary for Baseline testing
|
||||||
@@ -179,7 +148,7 @@ namespace VEPROMS
|
|||||||
private bool _CreateButtonClicked = false; // B2020-062 control the toggle of date/time prefix/suffix on pdf file name
|
private bool _CreateButtonClicked = false; // B2020-062 control the toggle of date/time prefix/suffix on pdf file name
|
||||||
public DlgPrintProcedure(DocVersionInfo dvi, bool automatic)
|
public DlgPrintProcedure(DocVersionInfo dvi, bool automatic)
|
||||||
{
|
{
|
||||||
_Automatic = automatic;
|
Automatic = automatic;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_AllProcedures = true;
|
_AllProcedures = true;
|
||||||
_DocVersionConfig = dvi.DocVersionConfig;
|
_DocVersionConfig = dvi.DocVersionConfig;
|
||||||
@@ -201,14 +170,12 @@ namespace VEPROMS
|
|||||||
btnCreatePDF.Text = "Create PDFs";
|
btnCreatePDF.Text = "Create PDFs";
|
||||||
HandleDocVersionSettings();
|
HandleDocVersionSettings();
|
||||||
PrepForAllOrOne(false);
|
PrepForAllOrOne(false);
|
||||||
// don't open all PDFs if doing All Procedures
|
|
||||||
//cbxOpenAfterCreate2.Checked = dvi.DocVersionConfig.Print_AlwaysViewPDFAfterCreate;
|
|
||||||
// C2018-033 added the Prefix / Suffix switch to the expand Additional Settings check
|
// C2018-033 added the Prefix / Suffix switch to the expand Additional Settings check
|
||||||
expPrnSetting.Expanded = swtbtnBlankPgsForDuplex.Value || swtbtnChgBar.Value || swtbtnGeneratePlacekeeper.Value || swtbtnPDFLinks.Value || swtbtnPROMSVersion.Value || swtbtnWaterMark.Value || swtbtnPDFdtPrefixSuffix.Value;
|
expPrnSetting.Expanded = swtbtnBlankPgsForDuplex.Value || swtbtnChgBar.Value || swtbtnGeneratePlacekeeper.Value || swtbtnPDFLinks.Value || swtbtnPROMSVersion.Value || swtbtnWaterMark.Value || swtbtnPDFdtPrefixSuffix.Value;
|
||||||
}
|
}
|
||||||
public DlgPrintProcedure(DocVersionInfo dvi)
|
public DlgPrintProcedure(DocVersionInfo dvi)
|
||||||
{
|
{
|
||||||
_Automatic = false;
|
Automatic = false;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_AllProcedures = true;
|
_AllProcedures = true;
|
||||||
_DocVersionConfig = dvi.DocVersionConfig;
|
_DocVersionConfig = dvi.DocVersionConfig;
|
||||||
@@ -249,18 +216,9 @@ namespace VEPROMS
|
|||||||
// C2021-063 make the Generate Alarm Point List text checkbox visable in the format flag is set.
|
// C2021-063 make the Generate Alarm Point List text checkbox visable in the format flag is set.
|
||||||
cbxAlmPtTxt.Visible = !oneProcedure && MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.ChkBoxToGeneratePointListText;
|
cbxAlmPtTxt.Visible = !oneProcedure && MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.ChkBoxToGeneratePointListText;
|
||||||
}
|
}
|
||||||
private string _UnitNumber;
|
|
||||||
public string UnitNumber
|
public string UnitNumber { get; set; }
|
||||||
{
|
public int UnitIndex { get; set; }
|
||||||
get { return _UnitNumber; }
|
|
||||||
set { _UnitNumber = value; }
|
|
||||||
}
|
|
||||||
private int _UnitIndex;
|
|
||||||
public int UnitIndex
|
|
||||||
{
|
|
||||||
get { return _UnitIndex; }
|
|
||||||
set { _UnitIndex = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
// C2018-012 - Code Cleanup - redesigned the Print Dialog to include a sliding panel and remplaced check boxes with ON/OFF switches
|
// C2018-012 - Code Cleanup - redesigned the Print Dialog to include a sliding panel and remplaced check boxes with ON/OFF switches
|
||||||
public DlgPrintProcedure(ProcedureInfo pi)
|
public DlgPrintProcedure(ProcedureInfo pi)
|
||||||
@@ -354,30 +312,8 @@ namespace VEPROMS
|
|||||||
swtbtnWaterMark.Value = false;
|
swtbtnWaterMark.Value = false;
|
||||||
else
|
else
|
||||||
swtbtnWaterMark.Value = true;
|
swtbtnWaterMark.Value = true;
|
||||||
// Auto Duplexing on/off - Auto duplex was used only by Point Beach formats These buttons were removed from the dialog
|
|
||||||
// There was not print coding to support this format flag
|
|
||||||
|
|
||||||
//if ((_MyProcedure.ActiveParent as DocVersionInfo).ActiveFormat.PlantFormat.FormatData.PrintData.AllowDuplex)
|
|
||||||
//{
|
|
||||||
// lblAutoDuplexing.Visible = true;
|
|
||||||
// btnDuplxOff.Visible = true;
|
|
||||||
// btnDuplxOn.Visible = true;
|
|
||||||
// if (_DocVersionConfig.Print_DisableDuplex)
|
|
||||||
// btnDuplxOff.PerformClick();
|
|
||||||
// else
|
|
||||||
// btnDuplxOn.PerformClick();
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// lblAutoDuplexing.Visible = false;
|
|
||||||
// btnDuplxOff.Visible = false;
|
|
||||||
// btnDuplxOn.Visible = false;
|
|
||||||
//}
|
|
||||||
SetCompareVisibility();
|
SetCompareVisibility();
|
||||||
|
|
||||||
// default to using OriginalPageBreaks (16bit page breaks) if App.config is set
|
|
||||||
// to true:
|
|
||||||
//cbxOrPgBrk.Visible = VlnSettings.OriginalPageBreak && VlnSettings.DebugMode;
|
|
||||||
cbxOrPgBrk.Visible = false; //per Harry
|
cbxOrPgBrk.Visible = false; //per Harry
|
||||||
cbxOrPgBrk.Checked = false;
|
cbxOrPgBrk.Checked = false;
|
||||||
}
|
}
|
||||||
@@ -416,13 +352,7 @@ namespace VEPROMS
|
|||||||
private Timer _MyTimer;
|
private Timer _MyTimer;
|
||||||
public void SetupForProcedure() // RHM20150506 Multiline ItemID TextBox
|
public void SetupForProcedure() // RHM20150506 Multiline ItemID TextBox
|
||||||
{
|
{
|
||||||
if(_DocVersionInfo == null)this.Text = "Create PDF for " + ProcNum;
|
if(_DocVersionInfo == null)Text = "Create PDF for " + ProcNum;
|
||||||
// get list of previous pdf files
|
|
||||||
// if no previous pdf file, then get path from frmVersionProperties
|
|
||||||
// dlgSelectFile.InitialDirectory = pdf path from frmVersionProperties
|
|
||||||
//cbxPDF.Text = string.Format(@"{0}\{1}.pdf", _PDFPath, _ProcNum);
|
|
||||||
// General 2 settings
|
|
||||||
//txbPDFLocation.Text = _PDFPath;
|
|
||||||
BuildPDFFileName();
|
BuildPDFFileName();
|
||||||
ProcedureConfig pc = _MyProcedure.MyConfig as ProcedureConfig;
|
ProcedureConfig pc = _MyProcedure.MyConfig as ProcedureConfig;
|
||||||
// C2025-033 set which Child procedure is being printed used for PageStyle items
|
// C2025-033 set which Child procedure is being printed used for PageStyle items
|
||||||
@@ -434,7 +364,7 @@ namespace VEPROMS
|
|||||||
if (pc != null)
|
if (pc != null)
|
||||||
{
|
{
|
||||||
//C2021-062 use the save rev number for all procedures if set, or just use the rev number in the current procedure config
|
//C2021-062 use the save rev number for all procedures if set, or just use the rev number in the current procedure config
|
||||||
RevNum = (_NewRevForAllProcs == null) ? pc.Print_Rev : _NewRevForAllProcs;
|
RevNum = _NewRevForAllProcs ?? pc.Print_Rev;
|
||||||
RevDate = pc.Print_RevDate; //== null || pc.Print_RevDate=="" ? DateTime.Today : Convert.ToDateTime(pc.Print_RevDate);
|
RevDate = pc.Print_RevDate; //== null || pc.Print_RevDate=="" ? DateTime.Today : Convert.ToDateTime(pc.Print_RevDate);
|
||||||
ReviewDate = pc.Print_ReviewDate; // == null ? DateTime.Today : Convert.ToDateTime(pc.Print_ReviewDate);
|
ReviewDate = pc.Print_ReviewDate; // == null ? DateTime.Today : Convert.ToDateTime(pc.Print_ReviewDate);
|
||||||
//Now check the format flags to determine if/how the Rev string should be parsed.
|
//Now check the format flags to determine if/how the Rev string should be parsed.
|
||||||
@@ -498,11 +428,6 @@ namespace VEPROMS
|
|||||||
else
|
else
|
||||||
swtbtnWaterMark.Value = false; // set to None at folder level so set Watermark switch to the off position
|
swtbtnWaterMark.Value = false; // set to None at folder level so set Watermark switch to the off position
|
||||||
|
|
||||||
//ppCmbxChgBarPos.DataSource = EnumDetail<PrintChangeBarLoc>.Details();
|
|
||||||
//ppCmbxChgBarPos.DisplayMember = "Description";
|
|
||||||
//ppCmbxChgBarPos.ValueMember = "EValue";
|
|
||||||
//ppCmbxChgBarPos.SelectedIndex = (int)MyProcedure.MyDocVersion.DocVersionConfig.Print_ChangeBarLoc;
|
|
||||||
|
|
||||||
ppCmbxChgBarTxtType.DataSource = EnumDetail<PrintChangeBarText>.Details();
|
ppCmbxChgBarTxtType.DataSource = EnumDetail<PrintChangeBarText>.Details();
|
||||||
ppCmbxChgBarTxtType.DisplayMember = "Description";
|
ppCmbxChgBarTxtType.DisplayMember = "Description";
|
||||||
ppCmbxChgBarTxtType.ValueMember = "EValue";
|
ppCmbxChgBarTxtType.ValueMember = "EValue";
|
||||||
@@ -515,7 +440,7 @@ namespace VEPROMS
|
|||||||
bool usesRevDate = _MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate || _MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash;
|
bool usesRevDate = _MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate || _MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash;
|
||||||
if (_MyProcedure.Sections != null)
|
if (_MyProcedure.Sections != null)
|
||||||
{
|
{
|
||||||
foreach (SectionInfo mysection in _MyProcedure.Sections)
|
foreach (SectionInfo mysection in _MyProcedure.Sections.OfType<SectionInfo>())
|
||||||
hasReviewDate |= mysection.ActiveFormat.PlantFormat.HasPageListToken("{REVIEWDATE}");
|
hasReviewDate |= mysection.ActiveFormat.PlantFormat.HasPageListToken("{REVIEWDATE}");
|
||||||
}
|
}
|
||||||
// Only the New HLP format and the MYA format use this
|
// Only the New HLP format and the MYA format use this
|
||||||
@@ -535,7 +460,6 @@ namespace VEPROMS
|
|||||||
if (MyProcedure == null) return;
|
if (MyProcedure == null) return;
|
||||||
string PDFFilePrefix = _DocVersionConfig.Print_PDFFilePrefix;
|
string PDFFilePrefix = _DocVersionConfig.Print_PDFFilePrefix;
|
||||||
string PDFFileSuffix = _DocVersionConfig.Print_PDFFileSuffix;
|
string PDFFileSuffix = _DocVersionConfig.Print_PDFFileSuffix;
|
||||||
string PDFFileName = "";
|
|
||||||
PDFDTPrefix dtPre = _DocVersionConfig.Print_PDFdtFilePrefix;
|
PDFDTPrefix dtPre = _DocVersionConfig.Print_PDFdtFilePrefix;
|
||||||
PDFDTSuffix dtSuf = _DocVersionConfig.Print_PDFdtFileSuffix;
|
PDFDTSuffix dtSuf = _DocVersionConfig.Print_PDFdtFileSuffix;
|
||||||
if (dtPre != PDFDTPrefix.None) PDFFilePrefix = ""; // incase user entered prefix text but then selected a date/time (in working draft properties)
|
if (dtPre != PDFDTPrefix.None) PDFFilePrefix = ""; // incase user entered prefix text but then selected a date/time (in working draft properties)
|
||||||
@@ -556,19 +480,17 @@ namespace VEPROMS
|
|||||||
if (dtSuf != PDFDTSuffix.None)
|
if (dtSuf != PDFDTSuffix.None)
|
||||||
PDFFileSuffix = "_" + (_PrefixSuffixDTS.ToString(dtSuf.ToString())).Replace("__", " ").Replace("_", "-");
|
PDFFileSuffix = "_" + (_PrefixSuffixDTS.ToString(dtSuf.ToString())).Replace("__", " ").Replace("_", "-");
|
||||||
}
|
}
|
||||||
|
string PDFFileName;
|
||||||
if (ProcNum == string.Empty)
|
if (ProcNum == string.Empty)
|
||||||
//txbPDFName.Text = this.UnitNumber + ".pdf";
|
PDFFileName = UnitNumber;
|
||||||
PDFFileName = this.UnitNumber;
|
|
||||||
else
|
else
|
||||||
//txbPDFName.Text = string.Format("{0}.pdf", _MyProcedure.PDFNumber);
|
|
||||||
PDFFileName = string.Format("{0}", _MyProcedure.PDFNumber);
|
PDFFileName = string.Format("{0}", _MyProcedure.PDFNumber);
|
||||||
//if (txbPDFName.Text.StartsWith("*"))
|
|
||||||
// txbPDFName.Text = txbPDFName.Text.Replace("*", this.UnitNumber);
|
|
||||||
if ((PDFFileName ?? "") == "") PDFFileName = "NoProcNumber";
|
if ((PDFFileName ?? "") == "") PDFFileName = "NoProcNumber";
|
||||||
if (PDFFileName.StartsWith("*"))
|
if (PDFFileName.StartsWith("*"))
|
||||||
PDFFileName = PDFFileName.Replace("*", this.UnitNumber);
|
PDFFileName = PDFFileName.Replace("*", UnitNumber);
|
||||||
if (PDFFileName.Contains("?")) PDFFileName = PDFFileName.Replace("?", "_"); // for wcn sys/BM-2xxA??, etc
|
if (PDFFileName.Contains("?")) PDFFileName = PDFFileName.Replace("?", "_"); // for wcn sys/BM-2xxA??, etc
|
||||||
txbPDFName.Text = PDFFilePrefix + PDFFileName + PDFFileSuffix + ".pdf";
|
txbPDFName.Text = $"{PDFFilePrefix}{PDFFileName}{PDFFileSuffix}.pdf";
|
||||||
}
|
}
|
||||||
|
|
||||||
// C2018-033 Enable/disable the switch to control whether to add Prefix and/or Suffix to PDF file name
|
// C2018-033 Enable/disable the switch to control whether to add Prefix and/or Suffix to PDF file name
|
||||||
@@ -585,10 +507,7 @@ namespace VEPROMS
|
|||||||
swtbtnPDFdtPrefixSuffix.Enabled = hasPrefixSuffix;
|
swtbtnPDFdtPrefixSuffix.Enabled = hasPrefixSuffix;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnCancel_Click(object sender, EventArgs e)
|
private void btnCancel_Click(object sender, EventArgs e) => Close();
|
||||||
{
|
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void swtbtnChgBar_ValueChanged(object sender, EventArgs e)
|
private void swtbtnChgBar_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -714,7 +633,7 @@ namespace VEPROMS
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
if (MySessionInfo != null)
|
if (MySessionInfo != null)
|
||||||
{
|
{
|
||||||
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures)
|
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures.OfType<ProcedureInfo>())
|
||||||
{
|
{
|
||||||
string message = string.Empty;
|
string message = string.Empty;
|
||||||
if (!MySessionInfo.CanCheckOutItem(myProc.ItemID, CheckOutType.Procedure, ref message))
|
if (!MySessionInfo.CanCheckOutItem(myProc.ItemID, CheckOutType.Procedure, ref message))
|
||||||
@@ -742,15 +661,14 @@ namespace VEPROMS
|
|||||||
pbPDFsStatus.Maximum = n;
|
pbPDFsStatus.Maximum = n;
|
||||||
pbPDFsStatus.Visible = true;
|
pbPDFsStatus.Visible = true;
|
||||||
VlnSvgPageHelper.CountInApplProcs = 1; // B2021-127: BNPPalr - Auto set of serial #, skip Front Matter as per PAL 11/1/21 (set to 1 not 0)
|
VlnSvgPageHelper.CountInApplProcs = 1; // B2021-127: BNPPalr - Auto set of serial #, skip Front Matter as per PAL 11/1/21 (set to 1 not 0)
|
||||||
this.Text = string.Format("Processing {0}", _DocVersionInfo.MyFolder.Name);
|
Text = string.Format("Processing {0}", _DocVersionInfo.MyFolder.Name);
|
||||||
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures)
|
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures.OfType<ProcedureInfo>())
|
||||||
{
|
{
|
||||||
string locpdfname = null; // get pdf file name for later merge code
|
string locpdfname = null; // get pdf file name for later merge code
|
||||||
MyProcedure = myProc;
|
MyProcedure = myProc;
|
||||||
// C2021-019: Override Watermark Text, 'waterMarkText' will have whatever watermark text should be printed
|
// C2021-019: Override Watermark Text, 'waterMarkText' will have whatever watermark text should be printed
|
||||||
ProcedureConfig procConfig = MyProcedure.MyConfig as ProcedureConfig;
|
|
||||||
string waterMarkTextOverride = "";
|
string waterMarkTextOverride = "";
|
||||||
if (procConfig != null) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE");
|
if (MyProcedure.MyConfig is ProcedureConfig procConfig) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE");
|
||||||
// C2020-002 paper size is now set in the format files - default is Letter
|
// C2020-002 paper size is now set in the format files - default is Letter
|
||||||
Volian.Print.Library.Rtf2Pdf.PaperSize = myProc.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize;
|
Volian.Print.Library.Rtf2Pdf.PaperSize = myProc.ActiveFormat.PlantFormat.FormatData.PDFPageSize.PaperSize;
|
||||||
if (myProc.Sections != null)
|
if (myProc.Sections != null)
|
||||||
@@ -772,13 +690,6 @@ namespace VEPROMS
|
|||||||
pbPDFsStatus.TextVisible = true;
|
pbPDFsStatus.TextVisible = true;
|
||||||
pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
|
pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
|
||||||
pbPDFsStatus.Value = i;
|
pbPDFsStatus.Value = i;
|
||||||
// this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
|
|
||||||
|
|
||||||
// B2021-102 we now get this information in frmPDFStatusForm()
|
|
||||||
//MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave);
|
|
||||||
// C2018-015 add the procedure tree path and the procedure number and title to the meta file
|
|
||||||
//if (BaselineMetaFile.IsOpen && i == 1) BaselineMetaFile.WriteLine("!! {0}", MyProcedure.SearchDVPath.Replace("\a", " | "));
|
|
||||||
//if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0} | {1}", MyProcedure.DisplayNumber, MyProcedure.DisplayText);
|
|
||||||
|
|
||||||
string myPDFPath = GetMultiunitPDFPath();
|
string myPDFPath = GetMultiunitPDFPath();
|
||||||
_MergedPdfPath = myPDFPath; // If Slave, need its subdirectory/unit path for merging
|
_MergedPdfPath = myPDFPath; // If Slave, need its subdirectory/unit path for merging
|
||||||
@@ -814,13 +725,6 @@ namespace VEPROMS
|
|||||||
pbPDFsStatus.TextVisible = true;
|
pbPDFsStatus.TextVisible = true;
|
||||||
pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
|
pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
|
||||||
pbPDFsStatus.Value = i;
|
pbPDFsStatus.Value = i;
|
||||||
// this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
|
|
||||||
|
|
||||||
// B2021-102 we now get this information in frmPDFStatusForm()
|
|
||||||
//MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave);
|
|
||||||
// C2018-015 add the procedure tree path and the procedure number and title to the meta file
|
|
||||||
//if (BaselineMetaFile.IsOpen && i == 1) BaselineMetaFile.WriteLine("!! {0}", MyProcedure.SearchDVPath.Replace("\a", " | "));
|
|
||||||
//if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0} | {1}", MyProcedure.DisplayNumber, MyProcedure.DisplayText);
|
|
||||||
|
|
||||||
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
|
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
|
||||||
// B2016-249 Output Procedure to folder associated with Parent Child
|
// B2016-249 Output Procedure to folder associated with Parent Child
|
||||||
@@ -850,17 +754,8 @@ namespace VEPROMS
|
|||||||
pbPDFsStatus.TextVisible = true;
|
pbPDFsStatus.TextVisible = true;
|
||||||
pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
|
pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
|
||||||
pbPDFsStatus.Value = i;
|
pbPDFsStatus.Value = i;
|
||||||
// this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
|
|
||||||
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
|
// RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered.
|
||||||
int profileDepth1 = ProfileTimer.Push(">>>> GetItemAndChildren");
|
int profileDepth1 = ProfileTimer.Push(">>>> GetItemAndChildren");
|
||||||
// B2021-102 we now get this information in frmPDFStatusForm()
|
|
||||||
//if (MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier)
|
|
||||||
// MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave);
|
|
||||||
//else
|
|
||||||
// MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID);
|
|
||||||
//// C2018-015 add the procedure tree path and the procedure number and title to the meta file
|
|
||||||
//if (BaselineMetaFile.IsOpen && i == 1) BaselineMetaFile.WriteLine("!! {0}", MyProcedure.SearchDVPath.Replace("\a", " | "));
|
|
||||||
//if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0} | {1}", MyProcedure.DisplayNumber, MyProcedure.DisplayText);
|
|
||||||
|
|
||||||
ProfileTimer.Pop(profileDepth1);
|
ProfileTimer.Pop(profileDepth1);
|
||||||
// B2021-102 put in the using for better memory management
|
// B2021-102 put in the using for better memory management
|
||||||
@@ -934,12 +829,12 @@ namespace VEPROMS
|
|||||||
private void CreateDebugFiles()
|
private void CreateDebugFiles()
|
||||||
{
|
{
|
||||||
if (cbxDebugPagination.Checked)
|
if (cbxDebugPagination.Checked)
|
||||||
Volian.Base.Library.DebugPagination.Open(PDFPath + "\\DebugPagination.txt"); // RHM 20120925 Corrected spelling
|
Volian.Base.Library.DebugPagination.Open($"{PDFPath}\\DebugPagination.txt"); // RHM 20120925 Corrected spelling
|
||||||
if (cbxDebugText.Checked)
|
if (cbxDebugText.Checked)
|
||||||
Volian.Base.Library.DebugText.Open(PDFPath + "\\DebugText.txt");
|
Volian.Base.Library.DebugText.Open($"{PDFPath}\\DebugText.txt");
|
||||||
if (cbxMetaFile.Checked) // C2018-004 create meta file for baseline compares
|
if (cbxMetaFile.Checked) // C2018-004 create meta file for baseline compares
|
||||||
{
|
{
|
||||||
Volian.Base.Library.BaselineMetaFile.Open(PDFPath + "\\DebugMeta.txt");
|
Volian.Base.Library.BaselineMetaFile.Open($"{PDFPath}\\DebugMeta.txt");
|
||||||
// C2018-015 add the PROMS Version, SQL Server, and Database to top of the meta file
|
// C2018-015 add the PROMS Version, SQL Server, and Database to top of the meta file
|
||||||
Volian.Base.Library.BaselineMetaFile.WriteLine("!! Ver {0} {1} {2}", AboutVEPROMS.PROMSVersion, AboutVEPROMS.SQLServerName, AboutVEPROMS.DatabaseName);
|
Volian.Base.Library.BaselineMetaFile.WriteLine("!! Ver {0} {1} {2}", AboutVEPROMS.PROMSVersion, AboutVEPROMS.SQLServerName, AboutVEPROMS.DatabaseName);
|
||||||
// C2018-023 set as to whether we are going to include the Word attment text in the baseline metafile
|
// C2018-023 set as to whether we are going to include the Word attment text in the baseline metafile
|
||||||
@@ -975,7 +870,7 @@ namespace VEPROMS
|
|||||||
if (MyProcedure.MyDocVersion.MultiUnitCount > 1)
|
if (MyProcedure.MyDocVersion.MultiUnitCount > 1)
|
||||||
{
|
{
|
||||||
VlnSvgPageHelper.CountInApplProcs = 1;
|
VlnSvgPageHelper.CountInApplProcs = 1;
|
||||||
foreach (ProcedureInfo pi in MyProcedure.MyDocVersion.Procedures)
|
foreach (ProcedureInfo pi in MyProcedure.MyDocVersion.Procedures.OfType<ProcedureInfo>())
|
||||||
{
|
{
|
||||||
if (pi.ItemID == MyProcedure.ItemID) break;
|
if (pi.ItemID == MyProcedure.ItemID) break;
|
||||||
bool includeProc = pi.ApplInclude(SelectedSlave);
|
bool includeProc = pi.ApplInclude(SelectedSlave);
|
||||||
@@ -991,24 +886,14 @@ namespace VEPROMS
|
|||||||
string waterMarkText = (swtbtnWaterMark.Value) ? cbxWaterMark.Text : "None" ; // B2018-124 use text of watermark form drop down list instead of enum value
|
string waterMarkText = (swtbtnWaterMark.Value) ? cbxWaterMark.Text : "None" ; // B2018-124 use text of watermark form drop down list instead of enum value
|
||||||
string watermarkColor = "Blue"; // this is the default watermark color
|
string watermarkColor = "Blue"; // this is the default watermark color
|
||||||
frmPDFStatusForm.SetUnitWatermark(MyProcedure, ref waterMarkText, ref watermarkColor); //C2022-004 Unit Designator Watermark
|
frmPDFStatusForm.SetUnitWatermark(MyProcedure, ref waterMarkText, ref watermarkColor); //C2022-004 Unit Designator Watermark
|
||||||
ProcedureConfig procConfig = MyProcedure.MyConfig as ProcedureConfig;
|
|
||||||
string waterMarkTextOverride = "";
|
string waterMarkTextOverride = "";
|
||||||
if (procConfig != null) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE"); // C2021-019: override watermark text
|
if (MyProcedure.MyConfig is ProcedureConfig procConfig) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE"); // C2021-019: override watermark text
|
||||||
if (swtbtnWaterMark.Value && waterMarkTextOverride != null && waterMarkTextOverride != "") waterMarkText = waterMarkTextOverride;
|
if (swtbtnWaterMark.Value && waterMarkTextOverride != null && waterMarkTextOverride != "") waterMarkText = waterMarkTextOverride;
|
||||||
// Determine change bar settings. First get from config & then see if override from dialog.
|
// Determine change bar settings. First get from config & then see if override from dialog.
|
||||||
// Also check that format allows override.
|
// Also check that format allows override.
|
||||||
ChangeBarDefinition cbd = DetermineChangeBarSettings();
|
ChangeBarDefinition cbd = DetermineChangeBarSettings();
|
||||||
int profileDepth2 = ProfileTimer.Push(">>>> CreatePdf.GetItemAndChildren");
|
int profileDepth2 = ProfileTimer.Push(">>>> CreatePdf.GetItemAndChildren");
|
||||||
|
|
||||||
// B2021-088 moved this if/else to frmPDFStatusForm() so that the Approval logic will have access to this logic
|
|
||||||
//if (MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave > 0 || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier)
|
|
||||||
// MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave);
|
|
||||||
//else
|
|
||||||
// MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID);
|
|
||||||
// C2018-015 add the procedure tree path and the procedure number and title to the meta file
|
|
||||||
//if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0}", MyProcedure.SearchDVPath.Replace("\a"," | "));
|
|
||||||
//if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0} | {1}", MyProcedure.DisplayNumber, MyProcedure.DisplayText);
|
|
||||||
|
|
||||||
// B2022-088: Find Doc Ro button not working in Word Sections
|
// B2022-088: Find Doc Ro button not working in Word Sections
|
||||||
// Initialize Print Cache
|
// Initialize Print Cache
|
||||||
MSWordToPDF.RoPrintCache = new Dictionary<string, ROFSTLookup.rochild>();
|
MSWordToPDF.RoPrintCache = new Dictionary<string, ROFSTLookup.rochild>();
|
||||||
@@ -1045,7 +930,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
|
MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
|
||||||
MyProcedure.SelectedChildToPrint = 0; // B2023-035 reset
|
MyProcedure.SelectedChildToPrint = 0; // B2023-035 reset
|
||||||
this.Close();
|
Close();
|
||||||
ShowDebugFiles();
|
ShowDebugFiles();
|
||||||
ProfileTimer.Pop(profileDepth);
|
ProfileTimer.Pop(profileDepth);
|
||||||
ProfileTimer.ShowTimerTable();
|
ProfileTimer.ShowTimerTable();
|
||||||
@@ -1121,22 +1006,19 @@ namespace VEPROMS
|
|||||||
DoCreatePDF();
|
DoCreatePDF();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void QPCreatePDF()
|
public void QPCreatePDF() => DoCreatePDF();
|
||||||
{
|
|
||||||
DoCreatePDF();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DoCreatePDF()
|
private void DoCreatePDF()
|
||||||
{
|
{
|
||||||
if (_AllProcedures)
|
if (_AllProcedures)
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime dtStart = DateTime.Now;
|
DateTime dtStart = DateTime.Now;
|
||||||
_MultiunitPdfLocation = cbxMultiunitPdfLocation.SelectedItem.ToString();
|
_MultiunitPdfLocation = cbxMultiunitPdfLocation.SelectedItem.ToString();
|
||||||
PromsPrinter.ClearTransPageNumProblems();
|
PromsPrinter.ClearTransPageNumProblems();
|
||||||
CreatePDFs();
|
CreatePDFs();
|
||||||
PromsPrinter.ReportTransPageNumProblems();
|
PromsPrinter.ReportTransPageNumProblems();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
if (_MergedPfd == null)
|
if (_MergedPfd == null)
|
||||||
{
|
{
|
||||||
if (VlnSettings.DebugMode)
|
if (VlnSettings.DebugMode)
|
||||||
@@ -1149,7 +1031,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
MessageBox.Show("Completed Successfully", "Print All Procedures", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("Completed Successfully", "Print All Procedures", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1158,14 +1040,14 @@ namespace VEPROMS
|
|||||||
// B2017-009 If the selected item is null don't add a folder
|
// B2017-009 If the selected item is null don't add a folder
|
||||||
if (cbxMultiunitPdfLocation.SelectedItem != null)
|
if (cbxMultiunitPdfLocation.SelectedItem != null)
|
||||||
_MultiunitPdfLocation = cbxMultiunitPdfLocation.SelectedItem.ToString();
|
_MultiunitPdfLocation = cbxMultiunitPdfLocation.SelectedItem.ToString();
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
_CreateButtonClicked = true; // B2020-062 control the toggle of date/time prefix/suffix on pdf file name
|
_CreateButtonClicked = true; // B2020-062 control the toggle of date/time prefix/suffix on pdf file name
|
||||||
CreatePDF();
|
CreatePDF();
|
||||||
_CreateButtonClicked = false;
|
_CreateButtonClicked = false;
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private bool _Initializing = false;
|
private readonly bool _Initializing = false;
|
||||||
|
|
||||||
private void btnPdfLocation_Click(object sender, EventArgs e)
|
private void btnPdfLocation_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -1191,10 +1073,7 @@ namespace VEPROMS
|
|||||||
ppTxbxChangeBarUserMsgOne.Enabled = enabled;
|
ppTxbxChangeBarUserMsgOne.Enabled = enabled;
|
||||||
ppTxbxChangeBarUserMsgTwo.Enabled = enabled;
|
ppTxbxChangeBarUserMsgTwo.Enabled = enabled;
|
||||||
}
|
}
|
||||||
private void cbxOvrrideDefChgBars_CheckStateChanged(object sender, EventArgs e)
|
private void cbxOvrrideDefChgBars_CheckStateChanged(object sender, EventArgs e) => SetCustomControls(cbxOvrrideDefChgBars.Checked);
|
||||||
{
|
|
||||||
SetCustomControls(cbxOvrrideDefChgBars.Checked);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void rbCustom_Click(object sender, EventArgs e)
|
private void rbCustom_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -1218,11 +1097,9 @@ namespace VEPROMS
|
|||||||
// B2024-058 Add validation for Revision Date field of the Print dialog
|
// B2024-058 Add validation for Revision Date field of the Print dialog
|
||||||
private bool validateDate(TextBox txtDate)
|
private bool validateDate(TextBox txtDate)
|
||||||
{
|
{
|
||||||
DateTime dDate;
|
|
||||||
if (!(txtDate.Text == ""))
|
if (!(txtDate.Text == ""))
|
||||||
{
|
{
|
||||||
|
if (DateTime.TryParse(txtDate.Text, out _))
|
||||||
if (DateTime.TryParse(txtDate.Text, out dDate))
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1243,8 +1120,6 @@ namespace VEPROMS
|
|||||||
txbDate = txbRevDate;
|
txbDate = txbRevDate;
|
||||||
grpDateSelector.Text = "Select Revision Date";
|
grpDateSelector.Text = "Select Revision Date";
|
||||||
grpDateSelector.Visible = calDateSelector.Visible = true;
|
grpDateSelector.Visible = calDateSelector.Visible = true;
|
||||||
//C2021-007 position the calendar to the current RevDate or if no RevDate, position to today's date
|
|
||||||
DateTime dDate;
|
|
||||||
// B2024-058 Add validation for Revision Date field of the Print dialog
|
// B2024-058 Add validation for Revision Date field of the Print dialog
|
||||||
if (!validateDate(txbDate))
|
if (!validateDate(txbDate))
|
||||||
{
|
{
|
||||||
@@ -1259,7 +1134,7 @@ namespace VEPROMS
|
|||||||
private void txbRevDate_Leave(object sender, EventArgs e)
|
private void txbRevDate_Leave(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_Initializing) return;
|
if (_Initializing) return;
|
||||||
if (this.ActiveControl == calDateSelector)
|
if (ActiveControl == calDateSelector)
|
||||||
{
|
{
|
||||||
txbRevDate.Focus(); //B2018-059 keep the calendar open until a different field on the print dialog is selected
|
txbRevDate.Focus(); //B2018-059 keep the calendar open until a different field on the print dialog is selected
|
||||||
return;
|
return;
|
||||||
@@ -1267,8 +1142,7 @@ namespace VEPROMS
|
|||||||
txbDate = null;
|
txbDate = null;
|
||||||
grpDateSelector.Visible = calDateSelector.Visible = false;
|
grpDateSelector.Visible = calDateSelector.Visible = false;
|
||||||
// save the RevDate to the procedure's config.
|
// save the RevDate to the procedure's config.
|
||||||
ProcedureConfig pc = MyProcedure.MyConfig as ProcedureConfig;
|
if (!(MyProcedure.MyConfig is ProcedureConfig pc)) return;
|
||||||
if (pc == null) return;
|
|
||||||
pc.Print_RevDate = txbRevDate.Text;
|
pc.Print_RevDate = txbRevDate.Text;
|
||||||
using (Item itm = Item.Get(MyProcedure.ItemID))
|
using (Item itm = Item.Get(MyProcedure.ItemID))
|
||||||
{
|
{
|
||||||
@@ -1284,8 +1158,7 @@ namespace VEPROMS
|
|||||||
txbDate = null;
|
txbDate = null;
|
||||||
grpDateSelector.Visible = calDateSelector.Visible = false;
|
grpDateSelector.Visible = calDateSelector.Visible = false;
|
||||||
// save the ReviewDate to the procedure's config.
|
// save the ReviewDate to the procedure's config.
|
||||||
ProcedureConfig pc = MyProcedure.MyConfig as ProcedureConfig;
|
if (!(MyProcedure.MyConfig is ProcedureConfig pc)) return;
|
||||||
if (pc == null) return;
|
|
||||||
pc.Print_ReviewDate = txbReviewDate.Text;
|
pc.Print_ReviewDate = txbReviewDate.Text;
|
||||||
using (Item itm = Item.Get(MyProcedure.ItemID))
|
using (Item itm = Item.Get(MyProcedure.ItemID))
|
||||||
{
|
{
|
||||||
@@ -1327,8 +1200,7 @@ namespace VEPROMS
|
|||||||
private void SaveRevNumToProcedureConfig(string newrevnum)
|
private void SaveRevNumToProcedureConfig(string newrevnum)
|
||||||
{
|
{
|
||||||
// save the RevNum to the procedure's config.
|
// save the RevNum to the procedure's config.
|
||||||
ProcedureConfig pc = MyProcedure.MyConfig as ProcedureConfig;
|
if (!(MyProcedure.MyConfig is ProcedureConfig pc)) return;
|
||||||
if (pc == null) return;
|
|
||||||
pc.Print_Rev = newrevnum;
|
pc.Print_Rev = newrevnum;
|
||||||
using (Item itm = Item.Get(MyProcedure.ItemID))
|
using (Item itm = Item.Get(MyProcedure.ItemID))
|
||||||
{
|
{
|
||||||
@@ -1341,22 +1213,16 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
if (expPrnSetting.Expanded)
|
if (expPrnSetting.Expanded)
|
||||||
{
|
{
|
||||||
this.Size = new Size(this.Size.Width + (expPrnSetting.Size.Width - expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
|
Size = new Size(Size.Width + (expPrnSetting.Size.Width - expPrnSetting.TitlePanel.Size.Height), Size.Height);
|
||||||
// B2018-137 set the visability of Generate Placekeeper
|
// B2018-137 set the visability of Generate Placekeeper
|
||||||
swtbtnGeneratePlacekeeper.Visible = lblGeneratePlacekeeper.Visible = ((MyProcedure.ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.AutoPlacekeeper) == E_PurchaseOptions.AutoPlacekeeper);
|
swtbtnGeneratePlacekeeper.Visible = lblGeneratePlacekeeper.Visible = ((MyProcedure.ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.AutoPlacekeeper) == E_PurchaseOptions.AutoPlacekeeper);
|
||||||
}
|
}
|
||||||
//else
|
|
||||||
// this.Size = new Size(this.Size.Width-(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
|
|
||||||
//Refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void expPrnSetting_ExpandedChanging(object sender, DevComponents.DotNetBar.ExpandedChangeEventArgs e)
|
private void expPrnSetting_ExpandedChanging(object sender, DevComponents.DotNetBar.ExpandedChangeEventArgs e)
|
||||||
{
|
{
|
||||||
if (expPrnSetting.Expanded)
|
if (expPrnSetting.Expanded)
|
||||||
//this.Size = new Size(this.Size.Width+(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
|
Size = new Size(Size.Width-(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), Size.Height);
|
||||||
//else
|
|
||||||
this.Size = new Size(this.Size.Width-(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
|
|
||||||
//Refresh();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1395,15 +1261,15 @@ namespace VEPROMS
|
|||||||
DoCreatePDF(); // create indivitual pdfs
|
DoCreatePDF(); // create indivitual pdfs
|
||||||
if (_MergedPdfPath != null && _MergedPdfPath != PDFPath) PDFPath = _MergedPfd.Folder = _MergedPdfPath;
|
if (_MergedPdfPath != null && _MergedPdfPath != PDFPath) PDFPath = _MergedPfd.Folder = _MergedPdfPath;
|
||||||
// C2021-063 pass in whether to generate Alarm Point List text when a merge is done
|
// C2021-063 pass in whether to generate Alarm Point List text when a merge is done
|
||||||
if (!_MergedPfd.DoTheMerge(PromsPrinter.MergedLandscapePages,cbxAlmPtTxt.Checked)) return; // merge them together.
|
if (!_MergedPfd.DoTheMerge(cbxAlmPtTxt.Checked)) return; // merge them together.
|
||||||
// if the property to show the file after printing is set (on the version dialog), display it. Otherwise do a dialog to let user know it's done
|
// if the property to show the file after printing is set (on the version dialog), display it. Otherwise do a dialog to let user know it's done
|
||||||
if (_DocVersionConfig.Print_MergedPdfsViewAfter)
|
if (_DocVersionConfig.Print_MergedPdfsViewAfter)
|
||||||
{
|
{
|
||||||
if (_MergedPfd.MergedPdfs != null && _MergedPfd.MergedPdfs.Count > 0)
|
if (_MergedPfd.MergedPdfs != null && _MergedPfd.MergedPdfs.Count > 0)
|
||||||
{
|
{
|
||||||
System.Diagnostics.Process sdp = System.Diagnostics.Process.Start(_MergedPfd.MergedFileName);
|
System.Diagnostics.Process sdp = System.Diagnostics.Process.Start(_MergedPfd.MergedFileName);
|
||||||
if (sdp != null) // B2020-055 if the current .NET version does not recognize the program used to display the PDF, it will return a NULL (ex. Microsoft Edge)
|
// B2020-055 if the current .NET version does not recognize the program used to display the PDF, it will return a NULL (ex. Microsoft Edge)
|
||||||
sdp.WaitForInputIdle();
|
sdp?.WaitForInputIdle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (VlnSettings.DebugMode)
|
else if (VlnSettings.DebugMode)
|
||||||
@@ -1416,7 +1282,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
FlexibleMessageBox.Show("Completed Successfully", "Print All and Merge Procedures", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
FlexibleMessageBox.Show("Completed Successfully", "Print All and Merge Procedures", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cbxAssignRevToAllMergedPrcs_CheckedChanged(object sender, EventArgs e)
|
private void cbxAssignRevToAllMergedPrcs_CheckedChanged(object sender, EventArgs e)
|
||||||
@@ -1428,10 +1294,5 @@ namespace VEPROMS
|
|||||||
_NewRevForAllProcs = null;
|
_NewRevForAllProcs = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//private void cbxDebug_CheckedChanged(object sender, EventArgs e)
|
|
||||||
//{
|
|
||||||
// cbxCmpPRMSpfd.Visible = cbxDebug.Checked;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
// This file is used by Code Analysis to maintain SuppressMessage
|
||||||
|
// attributes that are applied to this project.
|
||||||
|
// Project-level suppressions either have no target or are given
|
||||||
|
// a specific target and scoped to a namespace, type, member, etc.
|
||||||
|
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
|
[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Not modifying Naming Styles")]
|
||||||
@@ -5227,7 +5227,7 @@ CREATE PROCEDURE [dbo].[getRevisionByItemIDandRevisionNumberAndUnitID]
|
|||||||
WITH EXECUTE AS OWNER
|
WITH EXECUTE AS OWNER
|
||||||
AS
|
AS
|
||||||
declare @RevisionID int
|
declare @RevisionID int
|
||||||
set @RevisionID = (select revisionid from revisions rr cross apply rr.config.nodes('//Applicability') t1(r1) where itemid = @itemid and revisionnumber = @RevisionNumber and r1.value('@Index','int') = @UnitID)
|
set @RevisionID = (select top 1 revisionid from revisions rr cross apply rr.config.nodes('//Applicability') t1(r1) where itemid = @itemid and revisionnumber = @RevisionNumber and r1.value('@Index','int') = @UnitID order by revisionid desc)
|
||||||
SELECT
|
SELECT
|
||||||
[RevisionID],
|
[RevisionID],
|
||||||
[ItemID],
|
[ItemID],
|
||||||
@@ -5547,6 +5547,12 @@ ELSE PRINT 'Function: ve_GetItemDerivedApplicability Error on Creation'
|
|||||||
GO
|
GO
|
||||||
|
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
-- =============================================
|
||||||
|
-- Author: Matthew Schill
|
||||||
|
-- Modify date: 07/14/2026
|
||||||
|
-- Description: Reworked ve_GetParentItem for Performance improvement
|
||||||
|
-- =============================================
|
||||||
/****** Object: UserDefinedFunction [dbo].[vefn_GetParentItem] Script Date: 03/28/2012 17:58:48 ******/
|
/****** Object: UserDefinedFunction [dbo].[vefn_GetParentItem] Script Date: 03/28/2012 17:58:48 ******/
|
||||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[ve_GetParentItem]') AND OBJECTPROPERTY(id,N'IsScalarFunction') = 1)
|
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[ve_GetParentItem]') AND OBJECTPROPERTY(id,N'IsScalarFunction') = 1)
|
||||||
DROP FUNCTION [ve_GetParentItem];
|
DROP FUNCTION [ve_GetParentItem];
|
||||||
@@ -5555,35 +5561,46 @@ GO
|
|||||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||||
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
|
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
CREATE FUNCTION [dbo].[ve_GetParentItem] (@ItemID int) RETURNS int
|
CREATE OR ALTER FUNCTION [dbo].[ve_GetParentItem] (@ItemID int) RETURNS int
|
||||||
WITH EXECUTE AS OWNER
|
WITH EXECUTE AS OWNER
|
||||||
AS
|
AS
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE @ParentID int;
|
DECLARE @ParentID int;
|
||||||
WITH Itemz([ItemID],[IsFound]) as
|
WITH Itemz([ItemID]) as
|
||||||
(
|
(
|
||||||
select ii.itemid,0 from items ii where ii.itemid = @ItemID
|
select ii.itemid from items ii WITH (NOLOCK) where ii.itemid = @ItemID
|
||||||
union all
|
union all
|
||||||
select ii.previousid,0 from items ii
|
select ii.previousid from items ii WITH (NOLOCK)
|
||||||
join itemz zz on ii.itemid = zz.itemid
|
join itemz zz on ii.itemid = zz.itemid
|
||||||
where ii.previousid is not null
|
where ii.previousid is not null
|
||||||
and zz.isfound = 0
|
|
||||||
union all
|
|
||||||
select ii.itemid,1
|
|
||||||
from parts pp
|
|
||||||
join itemz zz on pp.itemid = zz.itemid
|
|
||||||
join items ii on ii.contentid = pp.contentid
|
|
||||||
)
|
)
|
||||||
select top 1 @ParentID = itemid from itemz
|
select top 1 @ParentID = ii.itemid
|
||||||
where isfound = 1 OPTION (MAXRECURSION 10000)
|
from itemz
|
||||||
|
inner join parts pp WITH (NOLOCK) on pp.itemid = itemz.itemid
|
||||||
|
inner join items ii WITH (NOLOCK) on ii.contentid = pp.contentid
|
||||||
|
OPTION (MAXRECURSION 10000)
|
||||||
|
|
||||||
RETURN @ParentID
|
RETURN @ParentID
|
||||||
END
|
END
|
||||||
|
|
||||||
GO
|
GO
|
||||||
|
|
||||||
IF (@@Error = 0) PRINT 'ScalerFunction [vefn_GetParentItem] Succeeded'
|
IF (@@Error = 0) PRINT 'ScalerFunction [vefn_GetParentItem] Succeeded'
|
||||||
ELSE PRINT 'ScalerFunction [vefn_GetParentItem] Error on Creation'
|
ELSE PRINT 'ScalerFunction [vefn_GetParentItem] Error on Creation'
|
||||||
go
|
go
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM dbo.sysIndexes WHERE name like 'IX_PartsItemID')
|
||||||
|
DROP INDEX [IX_PartsItemID] ON [dbo].[tblParts];
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE NONCLUSTERED INDEX IX_PartsItemID
|
||||||
|
ON [dbo].[tblParts] ([ItemID] ASC)
|
||||||
|
INCLUDE([ContentID],[DeleteStatus],[FromType]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||||
|
GO
|
||||||
|
|
||||||
|
PRINT 'Added IX_PartsItemID Index. Speeds up Getting Parent Items'
|
||||||
|
GO
|
||||||
|
|
||||||
/****** Object: UserDefinedFunction [dbo].[vefn_CanTransitionBeCreated] Script Date: 10/14/2012 02:03:30 ******/
|
/****** Object: UserDefinedFunction [dbo].[vefn_CanTransitionBeCreated] Script Date: 10/14/2012 02:03:30 ******/
|
||||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_CanTransitionBeCreated]') AND OBJECTPROPERTY(id,N'IsScalarFunction') = 1)
|
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_CanTransitionBeCreated]') AND OBJECTPROPERTY(id,N'IsScalarFunction') = 1)
|
||||||
DROP FUNCTION [vefn_CanTransitionBeCreated];
|
DROP FUNCTION [vefn_CanTransitionBeCreated];
|
||||||
@@ -13541,34 +13558,6 @@ IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteAllDocVers
|
|||||||
DROP PROCEDURE [deleteAllDocVersionPdfs];
|
DROP PROCEDURE [deleteAllDocVersionPdfs];
|
||||||
GO
|
GO
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
|
||||||
Copyright 2017 - Volian Enterprises, Inc. All rights reserved.
|
|
||||||
*****************************************************************************/
|
|
||||||
CREATE PROCEDURE [dbo].[deleteAllDocVersionPdfs]
|
|
||||||
|
|
||||||
(
|
|
||||||
@VersionID int
|
|
||||||
)
|
|
||||||
WITH EXECUTE AS OWNER
|
|
||||||
AS
|
|
||||||
BEGIN TRY -- Try Block
|
|
||||||
BEGIN TRANSACTION
|
|
||||||
DELETE [Pdfs]
|
|
||||||
WHERE [DocID] IN(select EE.DocID from vefn_GetVersionItems(cast(@VersionID as varchar(20))) VI
|
|
||||||
Join Entries EE ON EE.ContentID= VI.ContentID)
|
|
||||||
IF( @@TRANCOUNT > 0 ) COMMIT
|
|
||||||
END TRY
|
|
||||||
BEGIN CATCH -- Catch Block
|
|
||||||
IF( @@TRANCOUNT = 1 ) ROLLBACK -- Only rollback if top level
|
|
||||||
ELSE IF( @@TRANCOUNT > 1 ) COMMIT -- Otherwise commit. Top level will rollback
|
|
||||||
EXEC vlnErrorHandler
|
|
||||||
END CATCH
|
|
||||||
GO
|
|
||||||
-- Display the status of Proc creation
|
|
||||||
IF (@@Error = 0) PRINT 'Procedure Creation: deleteAllDocVersionPdfs Succeeded'
|
|
||||||
ELSE PRINT 'Procedure Creation: deleteAllDocVersionPdfs Error on Creation'
|
|
||||||
GO
|
|
||||||
/****** Object: StoredProcedure [addFiguresByROFstIDandImageIDs] ******/
|
/****** Object: StoredProcedure [addFiguresByROFstIDandImageIDs] ******/
|
||||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[addFiguresByROFstIDandImageIDs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[addFiguresByROFstIDandImageIDs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||||
DROP PROCEDURE [addFiguresByROFstIDandImageIDs];
|
DROP PROCEDURE [addFiguresByROFstIDandImageIDs];
|
||||||
@@ -17169,6 +17158,7 @@ GO
|
|||||||
[roid] [varchar](50) NOT NULL,
|
[roid] [varchar](50) NOT NULL,
|
||||||
[appid] [varchar](max) NULL,
|
[appid] [varchar](max) NULL,
|
||||||
[value] [varchar](max) NULL,
|
[value] [varchar](max) NULL,
|
||||||
|
[moddatetime] [datetime] NULL,
|
||||||
CONSTRAINT [PK_RofstChild] PRIMARY KEY CLUSTERED
|
CONSTRAINT [PK_RofstChild] PRIMARY KEY CLUSTERED
|
||||||
(
|
(
|
||||||
[RofstChildID] ASC
|
[RofstChildID] ASC
|
||||||
@@ -17303,6 +17293,23 @@ GO
|
|||||||
End -- Rofst Tables
|
End -- Rofst Tables
|
||||||
Go
|
Go
|
||||||
|
|
||||||
|
-- =============================================
|
||||||
|
-- Author: Matthew Schill
|
||||||
|
-- Create date: 03/30/2026
|
||||||
|
-- Description: Store RO Modification date/time
|
||||||
|
-- =============================================
|
||||||
|
|
||||||
|
--- Add Column to store RO Modification date/time if it does not already exist
|
||||||
|
IF NOT EXISTS(SELECT *
|
||||||
|
FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE TABLE_NAME = 'RofstChild'
|
||||||
|
AND COLUMN_NAME = 'moddatetime')
|
||||||
|
ALTER TABLE RofstChild ADD moddatetime datetime NULL;
|
||||||
|
go
|
||||||
|
-- Display the status
|
||||||
|
IF (@@Error = 0) PRINT 'Altered table [RofstChild] Succeeded for moddatetime'
|
||||||
|
ELSE PRINT 'Altered table [RofstChild] Error on Alter for moddatetime'
|
||||||
|
go
|
||||||
|
|
||||||
/*
|
/*
|
||||||
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
||||||
@@ -19705,6 +19712,7 @@ GO
|
|||||||
@roid VarChar(50),
|
@roid VarChar(50),
|
||||||
@appid VarChar(Max) = null,
|
@appid VarChar(Max) = null,
|
||||||
@value VarChar(Max) = null,
|
@value VarChar(Max) = null,
|
||||||
|
@ModDateTime DateTime = null,
|
||||||
@missingDefaultValue VarChar(Max) = null
|
@missingDefaultValue VarChar(Max) = null
|
||||||
)
|
)
|
||||||
With Execute as Owner
|
With Execute as Owner
|
||||||
@@ -19722,8 +19730,8 @@ GO
|
|||||||
Set @missingDefaultValue = '[TBD]';
|
Set @missingDefaultValue = '[TBD]';
|
||||||
|
|
||||||
-- Create Rofst Child/Group Record --> [Roid = (12) Digits]
|
-- Create Rofst Child/Group Record --> [Roid = (12) Digits]
|
||||||
Insert Into RofstChild (RofstID, ID, ParentID, dbiID, [type], title, roid, appid, [value])
|
Insert Into RofstChild (RofstID, ID, ParentID, dbiID, [type], title, roid, appid, moddatetime, [value])
|
||||||
Values (@RofstID, @ID, @ParentID, @dbiID, @type, @title, @roid, @appid, REPLACE(REPLACE(@value, '&123;', '{'), '&125;', '}'));
|
Values (@RofstID, @ID, @ParentID, @dbiID, @type, @title, @roid, @appid, @ModDateTime, REPLACE(REPLACE(@value, '&123;', '{'), '&125;', '}'));
|
||||||
|
|
||||||
|
|
||||||
-- Check for appid, if exists, then insert the default value for each return type if multi-value
|
-- Check for appid, if exists, then insert the default value for each return type if multi-value
|
||||||
@@ -24329,8 +24337,10 @@ BEGIN
|
|||||||
OR FromID in (Select ContentID from tblContents where deletestatus != 0 and ActionDTS < @dte)
|
OR FromID in (Select ContentID from tblContents where deletestatus != 0 and ActionDTS < @dte)
|
||||||
)
|
)
|
||||||
PRINT 'Deleting Items and Parts'
|
PRINT 'Deleting Items and Parts'
|
||||||
|
alter table tblParts nocheck constraint FK_Parts_Items
|
||||||
delete from tblItems where deletestatus != 0 and DTS < @dte
|
delete from tblItems where deletestatus != 0 and DTS < @dte
|
||||||
delete from tblParts where deletestatus != 0 and ItemID Not IN (Select ItemID from Items) and DTS < @dte
|
delete from tblParts where deletestatus != 0 and ItemID Not IN (Select ItemID from Items) and DTS < @dte
|
||||||
|
alter table tblParts check constraint FK_Parts_Items
|
||||||
PRINT 'Purging Parts with deleted Contents'
|
PRINT 'Purging Parts with deleted Contents'
|
||||||
DELETE from Child
|
DELETE from Child
|
||||||
FROM tblParts AS Child
|
FROM tblParts AS Child
|
||||||
@@ -24355,7 +24365,9 @@ BEGIN
|
|||||||
ON Itms.ItemID = tblItems.ItemID AND Itms.deletestatus = tblItems.deletestatus
|
ON Itms.ItemID = tblItems.ItemID AND Itms.deletestatus = tblItems.deletestatus
|
||||||
alter table tblItems check constraint FK_Items_Items
|
alter table tblItems check constraint FK_Items_Items
|
||||||
PRINT 'Purging Contents'
|
PRINT 'Purging Contents'
|
||||||
|
alter table tblEntries nocheck constraint FK_Entries_Contents
|
||||||
delete from tblContents where deletestatus != 0 and ActionDTS < @dte
|
delete from tblContents where deletestatus != 0 and ActionDTS < @dte
|
||||||
|
alter table tblEntries check constraint FK_Entries_Contents
|
||||||
PRINT 'Phase 3'
|
PRINT 'Phase 3'
|
||||||
delete from AnnotationAudits where DTS < @dte
|
delete from AnnotationAudits where DTS < @dte
|
||||||
delete from ContentAudits where DTS < @dte
|
delete from ContentAudits where DTS < @dte
|
||||||
@@ -24732,6 +24744,296 @@ 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
|
||||||
|
|
||||||
|
/****** Object: StoredProcedure [dbo].[getRevisionByItemIDandRevisionNumber] ******/
|
||||||
|
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[getRevisionByItemIDandRevisionNumber]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||||
|
DROP PROCEDURE [dbo].[getRevisionByItemIDandRevisionNumber];
|
||||||
|
GO
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||||
|
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
|
||||||
|
*****************************************************************************/
|
||||||
|
CREATE PROCEDURE [dbo].[getRevisionByItemIDandRevisionNumber]
|
||||||
|
|
||||||
|
(
|
||||||
|
@ItemID int,
|
||||||
|
@RevisionNumber nvarchar(50)
|
||||||
|
)
|
||||||
|
WITH EXECUTE AS OWNER
|
||||||
|
AS
|
||||||
|
declare @RevisionID int
|
||||||
|
set @RevisionID = (select top 1 revisionid from revisions where itemid = @itemid and revisionnumber = @RevisionNumber order by revisionid desc)
|
||||||
|
SELECT
|
||||||
|
[RevisionID],
|
||||||
|
[ItemID],
|
||||||
|
[TypeID],
|
||||||
|
[RevisionNumber],
|
||||||
|
[RevisionDate],
|
||||||
|
[Notes],
|
||||||
|
[Config],
|
||||||
|
[DTS],
|
||||||
|
[UserID],
|
||||||
|
[LastChanged],
|
||||||
|
(SELECT COUNT(*) FROM [Checks] WHERE [Checks].[RevisionID]=[Revisions].[RevisionID]) [CheckCount],
|
||||||
|
(SELECT COUNT(*) FROM [Versions] WHERE [Versions].[RevisionID]=[Revisions].[RevisionID]) [VersionCount]
|
||||||
|
FROM [Revisions]
|
||||||
|
WHERE [RevisionID]=@RevisionID
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
[Checks].[CheckID],
|
||||||
|
[Checks].[RevisionID],
|
||||||
|
[Checks].[StageID],
|
||||||
|
[Checks].[ConsistencyChecks],
|
||||||
|
[Checks].[DTS],
|
||||||
|
[Checks].[UserID],
|
||||||
|
[Checks].[LastChanged],
|
||||||
|
[Stages].[Name] [Stage_Name],
|
||||||
|
[Stages].[Description] [Stage_Description],
|
||||||
|
[Stages].[IsApproved] [Stage_IsApproved],
|
||||||
|
[Stages].[DTS] [Stage_DTS],
|
||||||
|
[Stages].[UserID] [Stage_UserID]
|
||||||
|
FROM [Checks]
|
||||||
|
JOIN [Stages] ON
|
||||||
|
[Stages].[StageID]=[Checks].[StageID]
|
||||||
|
WHERE
|
||||||
|
[Checks].[RevisionID]=@RevisionID
|
||||||
|
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
[Versions].[VersionID],
|
||||||
|
[Versions].[RevisionID],
|
||||||
|
[Versions].[StageID],
|
||||||
|
[Versions].[DTS],
|
||||||
|
[Versions].[UserID],
|
||||||
|
[Versions].[LastChanged],
|
||||||
|
[Versions].[PDF],
|
||||||
|
[Versions].[SummaryPDF],
|
||||||
|
[Stages].[Name] [Stage_Name],
|
||||||
|
[Stages].[Description] [Stage_Description],
|
||||||
|
[Stages].[IsApproved] [Stage_IsApproved],
|
||||||
|
[Stages].[DTS] [Stage_DTS],
|
||||||
|
[Stages].[UserID] [Stage_UserID]
|
||||||
|
FROM [Versions]
|
||||||
|
JOIN [Stages] ON
|
||||||
|
[Stages].[StageID]=[Versions].[StageID]
|
||||||
|
WHERE
|
||||||
|
[Versions].[RevisionID]=@RevisionID
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
|
||||||
|
-- Display the status of Proc creation
|
||||||
|
IF (@@Error = 0) PRINT 'Procedure Creation: getRevisionByItemIDandRevisionNumber Succeeded'
|
||||||
|
ELSE PRINT 'Procedure Creation: getRevisionByItemIDandRevisionNumber Error on Creation'
|
||||||
|
GO
|
||||||
|
|
||||||
|
/*
|
||||||
|
==========================================================================================================
|
||||||
|
Author: Matthew Schill
|
||||||
|
Create Date: 06/29/2026
|
||||||
|
Description: Added an ISNULL check when setting GridAudits.contentauditid.
|
||||||
|
Was Causing Deletion of some Grids to fail.
|
||||||
|
==========================================================================================================
|
||||||
|
*/
|
||||||
|
/****** Object: Trigger [tr_Contents_Delete] ******/
|
||||||
|
ALTER trigger [dbo].[tr_Contents_Delete] on [dbo].[Contents] instead of delete as
|
||||||
|
begin
|
||||||
|
update ii set DeleteStatus = (select max(DeleteID) from DeleteLog where SPID = @@spid), ActionDTS = getdate(),
|
||||||
|
UserID = (select top 1 UserID from DeleteLog where SPID = @@spid order by deleteid desc)
|
||||||
|
from tblContents ii inner join deleted dd on dd.ContentID = ii.ContentID
|
||||||
|
insert into ContentAudits(ContentID,Number,Text,Type,FormatID,Config,DTS,UserID,DeleteStatus,ActionDTS)
|
||||||
|
select ii.ContentID,ii.Number,ii.Text,ii.Type,ii.FormatID,ii.Config,ii.DTS,ii.UserID,ii.DeleteStatus,ii.ActionDTS
|
||||||
|
from tblContents ii inner join deleted dd on dd.ContentID = ii.ContentID
|
||||||
|
where ii.DeleteStatus > 0
|
||||||
|
update ga set ga.contentauditid = (select ISNULL(max(auditid),0) from contentaudits where contentid = ga.contentid and deletestatus = ga.deletestatus)
|
||||||
|
from gridaudits ga join deleted dd on ga.contentid = dd.contentid where ga.contentauditid = 0
|
||||||
|
end
|
||||||
|
go
|
||||||
|
|
||||||
|
-- Display the status of Trigger alter
|
||||||
|
IF (@@Error = 0) PRINT 'Trigger Alteration: tr_Contents_Delete Succeeded'
|
||||||
|
ELSE PRINT 'Trigger Alteration: tr_Contents_Delete Error on Creation'
|
||||||
|
GO
|
||||||
|
|
||||||
/*
|
/*
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
@@ -24766,8 +25068,8 @@ BEGIN TRY -- Try Block
|
|||||||
DECLARE @RevDate varchar(255)
|
DECLARE @RevDate varchar(255)
|
||||||
DECLARE @RevDescription varchar(255)
|
DECLARE @RevDescription varchar(255)
|
||||||
|
|
||||||
set @RevDate = '02/18/2026 7:00 AM'
|
set @RevDate = '07/16/2026 8:30 AM'
|
||||||
set @RevDescription = 'Added Audit Ability for ChangeBars'
|
set @RevDescription = 'Reworked ve_GetParentItem for Performance improvement'
|
||||||
|
|
||||||
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
|
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
|
||||||
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
|
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Volian.Base.Library;
|
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Text;
|
|
||||||
using System.IO;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using DevComponents.DotNetBar;
|
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -154,7 +154,6 @@
|
|||||||
<Compile Include="AboutVEPROMS.Designer.cs">
|
<Compile Include="AboutVEPROMS.Designer.cs">
|
||||||
<DependentUpon>AboutVEPROMS.cs</DependentUpon>
|
<DependentUpon>AboutVEPROMS.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="BookMarks.cs" />
|
|
||||||
<Compile Include="dlgAnnotationsSelect.cs">
|
<Compile Include="dlgAnnotationsSelect.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -349,6 +348,7 @@
|
|||||||
<Compile Include="frmVersionsProperties.Designer.cs">
|
<Compile Include="frmVersionsProperties.Designer.cs">
|
||||||
<DependentUpon>frmVersionsProperties.cs</DependentUpon>
|
<DependentUpon>frmVersionsProperties.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="GlobalSuppressions.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<EmbeddedResource Include="AboutVEPROMS.resx">
|
<EmbeddedResource Include="AboutVEPROMS.resx">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
@@ -21,8 +14,8 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private void btnTabs_Click(object sender, EventArgs e)
|
private void btnTabs_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Remember = this.cbRemember.Checked;
|
Remember = cbRemember.Checked;
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
@@ -23,35 +19,21 @@ namespace VEPROMS
|
|||||||
_MySessionInfo = SessionInfo.Get(_MyOwnerInfo.SessionID);
|
_MySessionInfo = SessionInfo.Get(_MyOwnerInfo.SessionID);
|
||||||
_MyUserInfo = ui;
|
_MyUserInfo = ui;
|
||||||
}
|
}
|
||||||
private ProcedureInfo _MyProcedureInfo;
|
private readonly ProcedureInfo _MyProcedureInfo;
|
||||||
public ProcedureInfo MyProcedureInfo
|
public ProcedureInfo MyProcedureInfo => _MyProcedureInfo;
|
||||||
{
|
private readonly SectionInfo _MySectionInfo;
|
||||||
get { return _MyProcedureInfo; }
|
public SectionInfo MySectionInfo => _MySectionInfo;
|
||||||
}
|
private readonly OwnerInfo _MyOwnerInfo;
|
||||||
private SectionInfo _MySectionInfo;
|
public OwnerInfo MyOwnerInfo => _MyOwnerInfo;
|
||||||
public SectionInfo MySectionInfo
|
private readonly SessionInfo _MySessionInfo;
|
||||||
{
|
public SessionInfo MySessionInfo => _MySessionInfo;
|
||||||
get { return _MySectionInfo; }
|
private readonly UserInfo _MyUserInfo;
|
||||||
}
|
public UserInfo MyUserInfo => _MyUserInfo;
|
||||||
private OwnerInfo _MyOwnerInfo;
|
|
||||||
public OwnerInfo MyOwnerInfo
|
|
||||||
{
|
|
||||||
get { return _MyOwnerInfo; }
|
|
||||||
}
|
|
||||||
private SessionInfo _MySessionInfo;
|
|
||||||
public SessionInfo MySessionInfo
|
|
||||||
{
|
|
||||||
get { return _MySessionInfo; }
|
|
||||||
}
|
|
||||||
private UserInfo _MyUserInfo;
|
|
||||||
public UserInfo MyUserInfo
|
|
||||||
{
|
|
||||||
get { return _MyUserInfo; }
|
|
||||||
}
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
|
|
||||||
private void dlgCheckedOutProcedure_Load(object sender, EventArgs e)
|
private void dlgCheckedOutProcedure_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
if (MyProcedureInfo != null)
|
if (MyProcedureInfo != null)
|
||||||
sb.AppendLine(string.Format("The procedure {0} - {1}", MyProcedureInfo.DisplayNumber, MyProcedureInfo.DisplayText));
|
sb.AppendLine(string.Format("The procedure {0} - {1}", MyProcedureInfo.DisplayNumber, MyProcedureInfo.DisplayText));
|
||||||
else
|
else
|
||||||
@@ -74,6 +56,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private void btnForce_Click(object sender, EventArgs e)
|
private void btnForce_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
MySessionInfo.CheckInItem(MyOwnerInfo.OwnerID);
|
MySessionInfo.CheckInItem(MyOwnerInfo.OwnerID);
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine("Forced Check In has been completed");
|
sb.AppendLine("Forced Check In has been completed");
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using Volian.Controls.Library;
|
|
||||||
using Volian.Base.Library;
|
using Volian.Base.Library;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@@ -21,12 +19,7 @@ namespace VEPROMS
|
|||||||
#region Log4Net
|
#region Log4Net
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
#endregion
|
#endregion
|
||||||
frmVEPROMS _MyFrmVEPROMS = null;// Save frmVEPROMS for Import to shutoff SessionPing
|
public frmVEPROMS MyFrmVEPROMS { get; set; } = null;
|
||||||
public frmVEPROMS MyFrmVEPROMS
|
|
||||||
{
|
|
||||||
get { return _MyFrmVEPROMS; }
|
|
||||||
set { _MyFrmVEPROMS = value; }
|
|
||||||
}
|
|
||||||
private bool _ConvertROsToTextDuringImport = false;
|
private bool _ConvertROsToTextDuringImport = false;
|
||||||
private bool _ConvertROsAndTransitionsToText = false; // set to true when Approval creates an Export file
|
private bool _ConvertROsAndTransitionsToText = false; // set to true when Approval creates an Export file
|
||||||
protected bool _ExportBothConvertedandNot = false; // set to true when Electronic Procedure export
|
protected bool _ExportBothConvertedandNot = false; // set to true when Electronic Procedure export
|
||||||
@@ -40,32 +33,18 @@ namespace VEPROMS
|
|||||||
//this will hold if a specific unit was selected
|
//this will hold if a specific unit was selected
|
||||||
readonly protected int _UnitIndex;
|
readonly protected int _UnitIndex;
|
||||||
|
|
||||||
private ItemInfo _ExternalTransitionItem = null;
|
public ItemInfo ExternalTransitionItem { get; set; } = null;
|
||||||
public ItemInfo ExternalTransitionItem
|
|
||||||
{
|
|
||||||
get { return _ExternalTransitionItem; }
|
|
||||||
set { _ExternalTransitionItem = value; }
|
|
||||||
}
|
|
||||||
private Dictionary<int, int> floatFoldout;
|
private Dictionary<int, int> floatFoldout;
|
||||||
private Dictionary<int, string> importedFormat;
|
private Dictionary<int, string> importedFormat;
|
||||||
private Dictionary<string, int> existingFormat;
|
private Dictionary<string, int> existingFormat;
|
||||||
private Dictionary<string, string> renamedUCFFormatName; // if format is renamed, this is its new name so references to it can be made
|
|
||||||
private Dictionary<int, int> renamedUCFFormatId; // if format is renamed, this is its old->new formatid
|
|
||||||
private int oldRODbID;
|
private int oldRODbID;
|
||||||
private int newRODbID;
|
private int newRODbID;
|
||||||
private FolderInfo _MyNewFolder;
|
private FolderInfo _MyNewFolder;
|
||||||
public FolderInfo MyNewFolder
|
public FolderInfo MyNewFolder => _MyNewFolder;
|
||||||
{
|
|
||||||
get { return _MyNewFolder; }
|
public ProcedureInfo MyNewProcedure { get; set; }
|
||||||
}
|
|
||||||
private ProcedureInfo _MyNewProcedure;
|
|
||||||
public ProcedureInfo MyNewProcedure
|
|
||||||
{
|
|
||||||
get { return _MyNewProcedure; }
|
|
||||||
set { _MyNewProcedure = value; }
|
|
||||||
}
|
|
||||||
private string PEIPath;
|
private string PEIPath;
|
||||||
private string _MyMode;
|
private readonly string _MyMode;
|
||||||
protected FolderInfo MyFolder = null;
|
protected FolderInfo MyFolder = null;
|
||||||
protected DocVersionInfo MyDocVersion = null;
|
protected DocVersionInfo MyDocVersion = null;
|
||||||
protected ProcedureInfo MyProcedure = null;
|
protected ProcedureInfo MyProcedure = null;
|
||||||
@@ -81,7 +60,7 @@ namespace VEPROMS
|
|||||||
_MyMode = mode;
|
_MyMode = mode;
|
||||||
MyFolder = folderInfo;
|
MyFolder = folderInfo;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.Text = mode + " Dialog for " + folderInfo.Name;
|
Text = $"{mode} Dialog for {folderInfo.Name}";
|
||||||
_UnitIndex = unitIndex;
|
_UnitIndex = unitIndex;
|
||||||
|
|
||||||
if (_UnitIndex > 0)
|
if (_UnitIndex > 0)
|
||||||
@@ -103,9 +82,9 @@ namespace VEPROMS
|
|||||||
MyDocVersion = docVersionInfo;
|
MyDocVersion = docVersionInfo;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
if (mode.ToUpper().Contains("FORMAT"))
|
if (mode.ToUpper().Contains("FORMAT"))
|
||||||
this.Text = mode;
|
Text = mode;
|
||||||
else
|
else
|
||||||
this.Text = mode + " Dialog for " + docVersionInfo.Name + " of " + docVersionInfo.MyFolder.Name;
|
Text = $"{mode} Dialog for {docVersionInfo.Name} of {docVersionInfo.MyFolder.Name}";
|
||||||
_UnitIndex = unitIndex;
|
_UnitIndex = unitIndex;
|
||||||
|
|
||||||
if (_UnitIndex > 0)
|
if (_UnitIndex > 0)
|
||||||
@@ -124,7 +103,7 @@ namespace VEPROMS
|
|||||||
_MyMode = mode;
|
_MyMode = mode;
|
||||||
MyProcedure = procedureInfo;
|
MyProcedure = procedureInfo;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.Text = mode + " Dialog for " + procedureInfo.DisplayNumber;
|
Text = $"{mode} Dialog for {procedureInfo.DisplayNumber}";
|
||||||
_UnitIndex = unitIndex;
|
_UnitIndex = unitIndex;
|
||||||
|
|
||||||
if (_UnitIndex > 0)
|
if (_UnitIndex > 0)
|
||||||
@@ -173,7 +152,7 @@ namespace VEPROMS
|
|||||||
ofd.InitialDirectory = PEIPath;
|
ofd.InitialDirectory = PEIPath;
|
||||||
pnlImport.BringToFront();
|
pnlImport.BringToFront();
|
||||||
}
|
}
|
||||||
this.Height = this.Height / formsize;
|
Height /= formsize;
|
||||||
}
|
}
|
||||||
private void btnExport_Click(object sender, EventArgs e)
|
private void btnExport_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -220,19 +199,19 @@ namespace VEPROMS
|
|||||||
string msg = "Finished Exporting:\n\n";
|
string msg = "Finished Exporting:\n\n";
|
||||||
if (_MyMode.ToUpper().Contains("FORMAT"))
|
if (_MyMode.ToUpper().Contains("FORMAT"))
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
MyStart = DateTime.Now;
|
MyStart = DateTime.Now;
|
||||||
btnDoExport.Enabled = false;
|
btnDoExport.Enabled = false;
|
||||||
lblExportStatus.Text = "Performing Export of UC Formats";
|
lblExportStatus.Text = "Performing Export of UC Formats";
|
||||||
SaveExportUCF();
|
SaveExportUCF();
|
||||||
|
|
||||||
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
||||||
lblExportStatus.Text = "Format Export Completed in " + elapsed.ToString();
|
lblExportStatus.Text = $"Format Export Completed in {elapsed}";
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
else if (MyFolder != null)
|
else if (MyFolder != null)
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
MyStart = DateTime.Now;
|
MyStart = DateTime.Now;
|
||||||
btnDoExport.Enabled = false;
|
btnDoExport.Enabled = false;
|
||||||
lblExportStatus.Text = "Performing Export";
|
lblExportStatus.Text = "Performing Export";
|
||||||
@@ -240,7 +219,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
||||||
lblExportStatus.Text = "Export Completed in " + elapsed.ToString();
|
lblExportStatus.Text = "Export Completed in " + elapsed.ToString();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
msg += MyFolder.Name;
|
msg += MyFolder.Name;
|
||||||
}
|
}
|
||||||
else if (MyProcedure != null)
|
else if (MyProcedure != null)
|
||||||
@@ -281,7 +260,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
MyStart = DateTime.Now;
|
MyStart = DateTime.Now;
|
||||||
btnDoExport.Enabled = false;
|
btnDoExport.Enabled = false;
|
||||||
lblExportStatus.Text = "Performing Export";
|
lblExportStatus.Text = "Performing Export";
|
||||||
@@ -294,7 +273,7 @@ namespace VEPROMS
|
|||||||
xd.Save(fileLocation);
|
xd.Save(fileLocation);
|
||||||
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
||||||
lblExportStatus.Text = "Export Completed in " + elapsed.ToString();
|
lblExportStatus.Text = "Export Completed in " + elapsed.ToString();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
// added message to user when export of a procedure or procedure set has completed
|
// added message to user when export of a procedure or procedure set has completed
|
||||||
if (successfullExport)
|
if (successfullExport)
|
||||||
@@ -338,7 +317,7 @@ namespace VEPROMS
|
|||||||
bool isImported = false;
|
bool isImported = false;
|
||||||
bool canceledPressed = false;
|
bool canceledPressed = false;
|
||||||
btnImport.Enabled = false;
|
btnImport.Enabled = false;
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
MyStart = DateTime.Now;
|
MyStart = DateTime.Now;
|
||||||
btnDoImport.Enabled = false;
|
btnDoImport.Enabled = false;
|
||||||
lblImportStatus.Text = "Performing Import";
|
lblImportStatus.Text = "Performing Import";
|
||||||
@@ -350,13 +329,13 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
TurnChangeManagerOff.Execute();
|
TurnChangeManagerOff.Execute();
|
||||||
MyFrmVEPROMS.DisablePing = true;// Turn-off SessionPing
|
MyFrmVEPROMS.DisablePing = true;// Turn-off SessionPing
|
||||||
bool result = TryToImportUCFs(ref isImported, ref canceledPressed);
|
bool result = TryToImportUCFs(ref isImported);
|
||||||
MyFrmVEPROMS.DisablePing = false;// Turn-on SessionPing
|
MyFrmVEPROMS.DisablePing = false;// Turn-on SessionPing
|
||||||
TurnChangeManagerOn.Execute();
|
TurnChangeManagerOn.Execute();
|
||||||
if (!result) // B2019-006: let user know there was an error during import:
|
if (!result) // B2019-006: let user know there was an error during import:
|
||||||
{
|
{
|
||||||
MessageBox.Show("Error occurred during import. Format(s) not imported.");
|
MessageBox.Show("Error occurred during import. Format(s) not imported.");
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
btnCloseImport.Enabled = true;
|
btnCloseImport.Enabled = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -400,7 +379,7 @@ namespace VEPROMS
|
|||||||
if (isImported)
|
if (isImported)
|
||||||
{
|
{
|
||||||
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
||||||
lblImportStatus.Text = "Import Completed in " + elapsed.ToString();
|
lblImportStatus.Text = $"Import Completed in {elapsed}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -408,7 +387,7 @@ namespace VEPROMS
|
|||||||
btnDoImport.Enabled = true;
|
btnDoImport.Enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
btnCloseImport.Enabled = true;
|
btnCloseImport.Enabled = true;
|
||||||
if (isImported)
|
if (isImported)
|
||||||
{
|
{
|
||||||
@@ -436,7 +415,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool TryToImportUCFs(ref bool isImported, ref bool canceledPressed)
|
private bool TryToImportUCFs(ref bool isImported)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -450,7 +429,7 @@ namespace VEPROMS
|
|||||||
if (nl == null || nl.Count == 0) // B2019-014: Check contents of import file for compatible operation
|
if (nl == null || nl.Count == 0) // B2019-014: Check contents of import file for compatible operation
|
||||||
{
|
{
|
||||||
MessageBox.Show("A Procedure export file can only be imported from the Tree View.", "Import Failed", MessageBoxButtons.OK);
|
MessageBox.Show("A Procedure export file can only be imported from the Tree View.", "Import Failed", MessageBoxButtons.OK);
|
||||||
this.Close();
|
Close();
|
||||||
isImported = false;
|
isImported = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -504,7 +483,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||||
_MyLog.Warn("Failed during UC Formats Import", ex);
|
_MyLog.Warn("Failed during UC Formats Import", ex);
|
||||||
this.Close();
|
Close();
|
||||||
isImported = false;
|
isImported = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -519,7 +498,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||||
_MyLog.Warn("Failed during Procedure Import", ex);
|
_MyLog.Warn("Failed during Procedure Import", ex);
|
||||||
this.Close();
|
Close();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -528,11 +507,9 @@ namespace VEPROMS
|
|||||||
private bool _ImportingApprovedExportFile = false;
|
private bool _ImportingApprovedExportFile = false;
|
||||||
private bool ImportingApprovedExport(string fnAndPath)
|
private bool ImportingApprovedExport(string fnAndPath)
|
||||||
{
|
{
|
||||||
bool rtnval = false;
|
|
||||||
int idx = fnAndPath.LastIndexOf("//") + 1;
|
int idx = fnAndPath.LastIndexOf("//") + 1;
|
||||||
string tmp = fnAndPath.Substring(idx);
|
string tmp = fnAndPath.Substring(idx);
|
||||||
rtnval = tmp.ToUpper().Contains("APPROVED_REV_");
|
return tmp.ToUpper().Contains("APPROVED_REV_");
|
||||||
return rtnval;
|
|
||||||
}
|
}
|
||||||
private bool ImportProcedure(ref bool isImported, ref bool canceledPressed)
|
private bool ImportProcedure(ref bool isImported, ref bool canceledPressed)
|
||||||
{
|
{
|
||||||
@@ -544,14 +521,16 @@ namespace VEPROMS
|
|||||||
if (ucf != null)
|
if (ucf != null)
|
||||||
{
|
{
|
||||||
MessageBox.Show("A User Control of Format export file can only be imported from Administration on the V-Button.", "Import Failed", MessageBoxButtons.OK);
|
MessageBox.Show("A User Control of Format export file can only be imported from Administration on the V-Button.", "Import Failed", MessageBoxButtons.OK);
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
this.btnImport.Enabled = true; // allow user to select a different export file to import
|
btnImport.Enabled = true; // allow user to select a different export file to import
|
||||||
this.btnCloseImport.Enabled = true; // allow user to close import dialog
|
btnCloseImport.Enabled = true; // allow user to close import dialog
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
string rofolderpath = xd.DocumentElement.Attributes.GetNamedItem("rofolderpath").InnerText;
|
string rofolderpath = xd.DocumentElement.Attributes.GetNamedItem("rofolderpath").InnerText;
|
||||||
int rodbid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rodbid").InnerText);
|
int rodbid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rodbid").InnerText);
|
||||||
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - rofstid for Debugging/future use
|
||||||
int rofstid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rofstid").InnerText);
|
int rofstid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rofstid").InnerText);
|
||||||
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
if (MyDocVersion.DocVersionAssociationCount > 0)
|
if (MyDocVersion.DocVersionAssociationCount > 0)
|
||||||
{
|
{
|
||||||
// use current ROPath
|
// use current ROPath
|
||||||
@@ -560,15 +539,17 @@ namespace VEPROMS
|
|||||||
// then ask if we should import using the current workingdraft RO Path, convert the ROs to text, or cancel the import
|
// then ask if we should import using the current workingdraft RO Path, convert the ROs to text, or cancel the import
|
||||||
if (MyRODb.FolderPath != rofolderpath && !_ImportingApprovedExportFile) //B2020-095 don't display dialog if importing approved procedure export file
|
if (MyRODb.FolderPath != rofolderpath && !_ImportingApprovedExportFile) //B2020-095 don't display dialog if importing approved procedure export file
|
||||||
{
|
{
|
||||||
dlgImpHowToHandleROs dlg = new dlgImpHowToHandleROs();
|
dlgImpHowToHandleROs dlg = new dlgImpHowToHandleROs
|
||||||
dlg.ImportedROFolder = rofolderpath;
|
{
|
||||||
dlg.WorkingDraftROFolder = MyRODb.FolderPath;
|
ImportedROFolder = rofolderpath,
|
||||||
|
WorkingDraftROFolder = MyRODb.FolderPath
|
||||||
|
};
|
||||||
dlg.ShowDialog(this);
|
dlg.ShowDialog(this);
|
||||||
if (dlg.CancelImport)
|
if (dlg.CancelImport)
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
this.btnImport.Enabled = true; // allow user to select a different export file to import
|
btnImport.Enabled = true; // allow user to select a different export file to import
|
||||||
this.btnDoImport.Enabled = true; // allow user to change mind and perform the import
|
btnDoImport.Enabled = true; // allow user to change mind and perform the import
|
||||||
return false; // Return False to Indicate that the Import did not succeed
|
return false; // Return False to Indicate that the Import did not succeed
|
||||||
}
|
}
|
||||||
_ConvertROsToTextDuringImport = dlg.ConvertROsToText;
|
_ConvertROsToTextDuringImport = dlg.ConvertROsToText;
|
||||||
@@ -612,15 +593,17 @@ namespace VEPROMS
|
|||||||
if (localROPaths.Count == 0)
|
if (localROPaths.Count == 0)
|
||||||
{
|
{
|
||||||
MessageBox.Show("There has been no RO folder defined for this database.\r\n\r\nIn order to import a procedure, you need to assign a RO folder path.\r\n\r\nImport process will terminate.");
|
MessageBox.Show("There has been no RO folder defined for this database.\r\n\r\nIn order to import a procedure, you need to assign a RO folder path.\r\n\r\nImport process will terminate.");
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
return false;// Return False to Indicate that the Import did not succeed
|
return false;// Return False to Indicate that the Import did not succeed
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
dlgPickROFolder dlg = new dlgPickROFolder();
|
dlgPickROFolder dlg = new dlgPickROFolder
|
||||||
dlg.ImportedROFolder = rofolderpath;
|
{
|
||||||
dlg.LocalROFolders = localROPaths;
|
ImportedROFolder = rofolderpath,
|
||||||
|
LocalROFolders = localROPaths
|
||||||
|
};
|
||||||
dlg.ShowDialog(this);
|
dlg.ShowDialog(this);
|
||||||
if ((dlg.SelectedROFolder ?? string.Empty) != string.Empty) // B2015-216 If the return value is null treat it like an empty string
|
if ((dlg.SelectedROFolder ?? string.Empty) != string.Empty) // B2015-216 If the return value is null treat it like an empty string
|
||||||
{
|
{
|
||||||
@@ -645,7 +628,7 @@ namespace VEPROMS
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
MessageBox.Show("Since you did not pick an existing RO folder defined for this database, the import process will terminate.");
|
MessageBox.Show("Since you did not pick an existing RO folder defined for this database, the import process will terminate.");
|
||||||
this.Close();// Close the Import Window
|
Close();// Close the Import Window
|
||||||
return false;// Return False to Indicate that the Import did not succeed
|
return false;// Return False to Indicate that the Import did not succeed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -655,9 +638,9 @@ namespace VEPROMS
|
|||||||
bool didImp = LoadFormats(xd, "procedure/formats/format");
|
bool didImp = LoadFormats(xd, "procedure/formats/format");
|
||||||
if (!didImp)
|
if (!didImp)
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
this.btnImport.Enabled = true; // allow user to select a different export file to import
|
btnImport.Enabled = true; // allow user to select a different export file to import
|
||||||
this.btnDoImport.Enabled = true; // allow user to change mind and perform the import
|
btnDoImport.Enabled = true; // allow user to change mind and perform the import
|
||||||
return false; // Return False to Indicate that the Import did not succeed
|
return false; // Return False to Indicate that the Import did not succeed
|
||||||
}
|
}
|
||||||
// use resolvedProcNum to determine if procedure is 'unique', i.e. if the procedure number exists
|
// use resolvedProcNum to determine if procedure is 'unique', i.e. if the procedure number exists
|
||||||
@@ -763,7 +746,7 @@ namespace VEPROMS
|
|||||||
ProcedureInfo lastProcedure = null;
|
ProcedureInfo lastProcedure = null;
|
||||||
foreach (ProcedureInfo pi in MyDocVersion.Procedures.OfType<ProcedureInfo>())
|
foreach (ProcedureInfo pi in MyDocVersion.Procedures.OfType<ProcedureInfo>())
|
||||||
lastProcedure = pi;
|
lastProcedure = pi;
|
||||||
_MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||||
//update transitions
|
//update transitions
|
||||||
AddTransitions(PendingTransitions);
|
AddTransitions(PendingTransitions);
|
||||||
PendingTransitions.Save(fn);
|
PendingTransitions.Save(fn);
|
||||||
@@ -803,7 +786,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
xd.SelectSingleNode("procedure/content/@number").InnerText = string.Format("Copy({0}) of {1}", count.ToString(), number);
|
xd.SelectSingleNode("procedure/content/@number").InnerText = string.Format("Copy({0}) of {1}", count.ToString(), number);
|
||||||
//add imported procedure and copy count
|
//add imported procedure and copy count
|
||||||
_MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||||
//update transitions
|
//update transitions
|
||||||
AddTransitions(PendingTransitions);
|
AddTransitions(PendingTransitions);
|
||||||
FixFloatingFoldouts();
|
FixFloatingFoldouts();
|
||||||
@@ -861,7 +844,7 @@ namespace VEPROMS
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//add imported procedure
|
//add imported procedure
|
||||||
_MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||||
//update transitions
|
//update transitions
|
||||||
AddTransitions(PendingTransitions);
|
AddTransitions(PendingTransitions);
|
||||||
FixFloatingFoldouts();
|
FixFloatingFoldouts();
|
||||||
@@ -884,9 +867,9 @@ namespace VEPROMS
|
|||||||
bool didImp = LoadFormats(xd, "folder/formats/format");
|
bool didImp = LoadFormats(xd, "folder/formats/format");
|
||||||
if (!didImp)
|
if (!didImp)
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
this.btnImport.Enabled = true; // allow user to select a different export file to import
|
btnImport.Enabled = true; // allow user to select a different export file to import
|
||||||
this.btnDoImport.Enabled = true; // allow user to change mind and perform the import
|
btnDoImport.Enabled = true; // allow user to change mind and perform the import
|
||||||
return false; // Return False to Indicate that the Import did not succeed
|
return false; // Return False to Indicate that the Import did not succeed
|
||||||
}
|
}
|
||||||
string name = xd.DocumentElement.Attributes.GetNamedItem("name").InnerText;
|
string name = xd.DocumentElement.Attributes.GetNamedItem("name").InnerText;
|
||||||
@@ -947,14 +930,16 @@ namespace VEPROMS
|
|||||||
pi = AddProcedure(xd.DocumentElement, dvi, pi);
|
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
|
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";
|
lblImportStatus.Text = "Updating Transitions";
|
||||||
AddTransitions();
|
AddTransitions();
|
||||||
FixFloatingFoldouts();
|
FixFloatingFoldouts();
|
||||||
SaveTransitionAndItemContentIDs();
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1002,6 +987,7 @@ namespace VEPROMS
|
|||||||
c.Save();
|
c.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
Dictionary<string, string> existingCopyFCName = new Dictionary<string, string>();
|
Dictionary<string, string> existingCopyFCName = new Dictionary<string, string>();
|
||||||
// note that this is used when importing a folder or a procedure (procedure was added for UCF changes)
|
// note that this is used when importing a folder or a procedure (procedure was added for UCF changes)
|
||||||
private bool LoadFormats(XmlDocument xd, string xmlpath)
|
private bool LoadFormats(XmlDocument xd, string xmlpath)
|
||||||
@@ -1013,20 +999,19 @@ namespace VEPROMS
|
|||||||
|
|
||||||
importedFormat = new Dictionary<int, string>();
|
importedFormat = new Dictionary<int, string>();
|
||||||
XmlNodeList nl = xd.SelectNodes(xmlpath);
|
XmlNodeList nl = xd.SelectNodes(xmlpath);
|
||||||
|
|
||||||
bool conflictingUCFdata = false;
|
|
||||||
List<string> existingFC = new List<string>();
|
List<string> existingFC = new List<string>();
|
||||||
List<string> importedFC = new List<string>();
|
List<string> importedFC = new List<string>();
|
||||||
List<string> fname = new List<string>();
|
List<string> fname = new List<string>();
|
||||||
|
|
||||||
foreach (XmlNode nd in nl)
|
foreach (XmlNode nd in nl)
|
||||||
{
|
{
|
||||||
string copyOfUCF = null;
|
|
||||||
// see if any of the imported formats are 'UCF' formats, i.e. have config data. If they are UCF,
|
// see if any of the imported formats are 'UCF' formats, i.e. have config data. If they are UCF,
|
||||||
// see if this is different that what is in the database. If it is, the user needs to decide
|
// see if this is different that what is in the database. If it is, the user needs to decide
|
||||||
// whether to associate sections with existing UCF format or the new one. All UCF formats will be
|
// whether to associate sections with existing UCF format or the new one. All UCF formats will be
|
||||||
// connected the same way, i.e. existing or new.
|
// connected the same way, i.e. existing or new.
|
||||||
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - formatid for Debugging/future use
|
||||||
int formatid = int.Parse(nd.Attributes.GetNamedItem("formatid").InnerText);
|
int formatid = int.Parse(nd.Attributes.GetNamedItem("formatid").InnerText);
|
||||||
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
string name = nd.Attributes.GetNamedItem("name").InnerText;
|
string name = nd.Attributes.GetNamedItem("name").InnerText;
|
||||||
string config = null;
|
string config = null;
|
||||||
XmlNode cfg = nd.Attributes.GetNamedItem("config");
|
XmlNode cfg = nd.Attributes.GetNamedItem("config");
|
||||||
@@ -1038,7 +1023,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
// See if there are copies of this UCF format, if so, this may match (have same config) one of those and should
|
// See if there are copies of this UCF format, if so, this may match (have same config) one of those and should
|
||||||
// use it before stating there is conflicting data.
|
// use it before stating there is conflicting data.
|
||||||
copyOfUCF = ContentsOfUCFExists(name, config);
|
string copyOfUCF = ContentsOfUCFExists(name, config);
|
||||||
if (copyOfUCF == null)
|
if (copyOfUCF == null)
|
||||||
{
|
{
|
||||||
existingFC.Add(exFI.Config);
|
existingFC.Add(exFI.Config);
|
||||||
@@ -1067,11 +1052,12 @@ namespace VEPROMS
|
|||||||
if (pnameAttrib != null)
|
if (pnameAttrib != null)
|
||||||
pname = pnameAttrib.InnerText;
|
pname = pnameAttrib.InnerText;
|
||||||
if (pname == null) continue;
|
if (pname == null) continue;
|
||||||
string description = null;
|
|
||||||
XmlNode descript = nd.Attributes.GetNamedItem("description");
|
XmlNode descript = nd.Attributes.GetNamedItem("description");
|
||||||
if (descript != null) description = descript.InnerText;
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - description, userid, dts for future use
|
||||||
|
string description = descript?.InnerText;
|
||||||
string userid = nd.Attributes.GetNamedItem("userid").InnerText;
|
string userid = nd.Attributes.GetNamedItem("userid").InnerText;
|
||||||
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
|
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
|
||||||
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
// If the format that is being imported exists as a copy (already was imported and a 'Copy x of name' was created) and the imported and
|
// If the format that is being imported exists as a copy (already was imported and a 'Copy x of name' was created) and the imported and
|
||||||
// existing config match, use the existing (copied) format's name rather than importing it again (the dictionary was set up during
|
// existing config match, use the existing (copied) format's name rather than importing it again (the dictionary was set up during
|
||||||
// the import formats process.
|
// the import formats process.
|
||||||
@@ -1096,7 +1082,7 @@ namespace VEPROMS
|
|||||||
// parent format will always be in there, if it is a new format, it will be added before the child. Check just in case (no null reference).
|
// parent format will always be in there, if it is a new format, it will be added before the child. Check just in case (no null reference).
|
||||||
if (!existingFormat.ContainsKey(pname)) break;
|
if (!existingFormat.ContainsKey(pname)) break;
|
||||||
int pid = existingFormat[pname];
|
int pid = existingFormat[pname];
|
||||||
Format pformat = Format.Get(pid);
|
_ = Format.Get(pid);
|
||||||
|
|
||||||
// if the new format doesn't exist, it will be added (after these other checks). Otherwise, handle the
|
// if the new format doesn't exist, it will be added (after these other checks). Otherwise, handle the
|
||||||
// various cases listed above:
|
// various cases listed above:
|
||||||
@@ -1219,7 +1205,6 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText);
|
int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText);
|
||||||
int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText);
|
int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText);
|
||||||
//if (!Old2NewContent.ContainsKey(oldid))
|
|
||||||
Old2NewLibDoc.Add(oldid, newid);
|
Old2NewLibDoc.Add(oldid, newid);
|
||||||
}
|
}
|
||||||
File.Delete(fn);
|
File.Delete(fn);
|
||||||
@@ -1360,7 +1345,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
private void ExportFormats(FormatInfoList fil, XmlElement xn, string nodename, bool doElement)
|
private void ExportFormats(FormatInfoList fil, XmlElement xn, string nodename, bool doElement)
|
||||||
{
|
{
|
||||||
XmlElement xe = null;
|
XmlElement xe;
|
||||||
if (doElement) xe = xn.OwnerDocument.CreateElement(nodename);
|
if (doElement) xe = xn.OwnerDocument.CreateElement(nodename);
|
||||||
else xe = xn;
|
else xe = xn;
|
||||||
foreach (FormatInfo fi in fil)
|
foreach (FormatInfo fi in fil)
|
||||||
@@ -1487,7 +1472,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
pbExportProcedure.Value = 0;
|
pbExportProcedure.Value = 0;
|
||||||
pbExportProcedure.Maximum = dvi.Procedures.Count;
|
pbExportProcedure.Maximum = dvi.Procedures.Count;
|
||||||
lblExportProcedure.Text = pbExportProcedure.Maximum.ToString() + " Procedures";
|
lblExportProcedure.Text = $"{pbExportProcedure.Maximum} Procedures";
|
||||||
foreach (ItemInfo ii in dvi.Procedures)
|
foreach (ItemInfo ii in dvi.Procedures)
|
||||||
{
|
{
|
||||||
XmlDocument xd = new XmlDocument();
|
XmlDocument xd = new XmlDocument();
|
||||||
@@ -1645,7 +1630,7 @@ namespace VEPROMS
|
|||||||
ContentID
|
ContentID
|
||||||
DTS
|
DTS
|
||||||
*/
|
*/
|
||||||
XmlElement xe = null;
|
XmlElement xe;
|
||||||
if (xn.Name == "procedure")
|
if (xn.Name == "procedure")
|
||||||
xe = xn;
|
xe = xn;
|
||||||
else
|
else
|
||||||
@@ -2432,10 +2417,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddTransitions()
|
private void AddTransitions() => AddTransitions(PendingTransitions);
|
||||||
{
|
|
||||||
AddTransitions(PendingTransitions);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AddTransitions(XmlDocument xd)
|
private void AddTransitions(XmlDocument xd)
|
||||||
{
|
{
|
||||||
@@ -2457,7 +2439,7 @@ namespace VEPROMS
|
|||||||
type,id,toid,rangeid
|
type,id,toid,rangeid
|
||||||
*/
|
*/
|
||||||
XmlNodeList nl = xd.SelectNodes("//transition");
|
XmlNodeList nl = xd.SelectNodes("//transition");
|
||||||
lblImportStatus.Text = string.Format("Updating {0} Tranistions", nl.Count.ToString());
|
lblImportStatus.Text = $"Updating {nl.Count} Tranistions";
|
||||||
|
|
||||||
foreach (XmlNode nd in nl)
|
foreach (XmlNode nd in nl)
|
||||||
{
|
{
|
||||||
@@ -2520,7 +2502,6 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
else //transition to existing itemid (external)
|
else //transition to existing itemid (external)
|
||||||
{
|
{
|
||||||
bool forceConvertToText = false;
|
|
||||||
int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText);
|
int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText);
|
||||||
int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText);
|
int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText);
|
||||||
string config = nd.Attributes.GetNamedItem("config").InnerText;
|
string config = nd.Attributes.GetNamedItem("config").InnerText;
|
||||||
@@ -2537,6 +2518,7 @@ namespace VEPROMS
|
|||||||
Content cc = Content.Get(fromid);
|
Content cc = Content.Get(fromid);
|
||||||
Transition tt = Transition.MakeTransition(cc, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid);
|
Transition tt = Transition.MakeTransition(cc, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid);
|
||||||
|
|
||||||
|
bool forceConvertToText;
|
||||||
if (tt.TransitionID < 0)
|
if (tt.TransitionID < 0)
|
||||||
{
|
{
|
||||||
forceConvertToText = true;
|
forceConvertToText = true;
|
||||||
@@ -2618,7 +2600,6 @@ namespace VEPROMS
|
|||||||
if (formatID >= importedFormat.Count) return null; // formatID not found, use default file name
|
if (formatID >= importedFormat.Count) return null; // formatID not found, use default file name
|
||||||
formatName = importedFormat[formatID]; // for backwards compatibility with older export files
|
formatName = importedFormat[formatID]; // for backwards compatibility with older export files
|
||||||
}
|
}
|
||||||
if (renamedUCFFormatName != null && renamedUCFFormatName.ContainsKey(formatFileName)) formatName = renamedUCFFormatName[formatName];
|
|
||||||
formatID = existingFormat[formatName];
|
formatID = existingFormat[formatName];
|
||||||
return Format.Get(formatID);
|
return Format.Get(formatID);
|
||||||
}
|
}
|
||||||
@@ -2666,7 +2647,9 @@ namespace VEPROMS
|
|||||||
MyRODb = AddRODb(xrodb);
|
MyRODb = AddRODb(xrodb);
|
||||||
ROFst rofst = AddROFst(xrofst);
|
ROFst rofst = AddROFst(xrofst);
|
||||||
|
|
||||||
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - dva kept for side effect code
|
||||||
DocVersionAssociation dva = dv.DocVersionAssociations.Add(rofst);
|
DocVersionAssociation dva = dv.DocVersionAssociations.Add(rofst);
|
||||||
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
|
|
||||||
dv.Save();
|
dv.Save();
|
||||||
}
|
}
|
||||||
@@ -2903,7 +2886,9 @@ namespace VEPROMS
|
|||||||
foreach (XmlNode nd in xn.SelectNodes("rousage"))
|
foreach (XmlNode nd in xn.SelectNodes("rousage"))
|
||||||
{
|
{
|
||||||
string rousageid = nd.Attributes.GetNamedItem("rousageid").InnerText;
|
string rousageid = nd.Attributes.GetNamedItem("rousageid").InnerText;
|
||||||
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - roid for Debugging/future use
|
||||||
string roid = nd.Attributes.GetNamedItem("roid").InnerText;
|
string roid = nd.Attributes.GetNamedItem("roid").InnerText;
|
||||||
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
|
|
||||||
string findLink = @"<START\].*?\[END>";
|
string findLink = @"<START\].*?\[END>";
|
||||||
content.Text = content.Text.Replace("<START]<START]", "<START]").Replace(@"[END><START]", @"[END>\v0 \v <START]"); //B2020-057 bad RO link - remove extra START and insert comment off/on between <END]<START]
|
content.Text = content.Text.Replace("<START]<START]", "<START]").Replace(@"[END><START]", @"[END>\v0 \v <START]"); //B2020-057 bad RO link - remove extra START and insert comment off/on between <END]<START]
|
||||||
@@ -2941,7 +2926,7 @@ namespace VEPROMS
|
|||||||
if (prefix == @"\v ")
|
if (prefix == @"\v ")
|
||||||
part1 = part1.Substring(0, part1.Length - 3);
|
part1 = part1.Substring(0, part1.Length - 3);
|
||||||
else
|
else
|
||||||
part1 = part1.Substring(0, part1.Length - 3) + " ";
|
part1 = $"{part1.Substring(0, part1.Length - 3)} ";
|
||||||
//modify part3 based on suffix
|
//modify part3 based on suffix
|
||||||
if (suffix == @"\v0 ")
|
if (suffix == @"\v0 ")
|
||||||
part3 = part3.Substring(4);
|
part3 = part3.Substring(4);
|
||||||
@@ -3112,7 +3097,9 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
foreach (XmlNode nd in xn.SelectNodes("annotation"))
|
foreach (XmlNode nd in xn.SelectNodes("annotation"))
|
||||||
{
|
{
|
||||||
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - typeid for debugging/future use
|
||||||
int typeid = int.Parse(nd.Attributes.GetNamedItem("typeid").InnerText);
|
int typeid = int.Parse(nd.Attributes.GetNamedItem("typeid").InnerText);
|
||||||
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
string rtftext = nd.Attributes.GetNamedItem("rtftext").InnerText;
|
string rtftext = nd.Attributes.GetNamedItem("rtftext").InnerText;
|
||||||
string searchtext = nd.Attributes.GetNamedItem("searchtext").InnerText;
|
string searchtext = nd.Attributes.GetNamedItem("searchtext").InnerText;
|
||||||
string config = nd.Attributes.GetNamedItem("config").InnerText;
|
string config = nd.Attributes.GetNamedItem("config").InnerText;
|
||||||
@@ -3848,7 +3835,7 @@ namespace VEPROMS
|
|||||||
if (d == null)
|
if (d == null)
|
||||||
{
|
{
|
||||||
// B2019-035 better memory management. Prior logic would eat up memory (and not free it).
|
// B2019-035 better memory management. Prior logic would eat up memory (and not free it).
|
||||||
string libkey = libtitle + "_" + dts.ToString();
|
string libkey = $"{libtitle}_{dts}";
|
||||||
if (ExistingLibDocs.ContainsKey(libkey))
|
if (ExistingLibDocs.ContainsKey(libkey))
|
||||||
d = Document.Get(ExistingLibDocs[libkey]); // found library document in existing database
|
d = Document.Get(ExistingLibDocs[libkey]); // found library document in existing database
|
||||||
}
|
}
|
||||||
@@ -3861,7 +3848,7 @@ namespace VEPROMS
|
|||||||
string config = xn.Attributes.GetNamedItem("config").InnerText;
|
string config = xn.Attributes.GetNamedItem("config").InnerText;
|
||||||
string userid = xn.Attributes.GetNamedItem("userid").InnerText;
|
string userid = xn.Attributes.GetNamedItem("userid").InnerText;
|
||||||
string fileextension = xn.Attributes.GetNamedItem("fileextension").InnerText;
|
string fileextension = xn.Attributes.GetNamedItem("fileextension").InnerText;
|
||||||
if (libtitle != "") libtitle = libtitle + "_" + dts.ToString(); // if a lib document, append the date/time to the title incase there are duplicate titles
|
if (libtitle != "") libtitle = $"{libtitle}_{dts}"; // if a lib document, append the date/time to the title incase there are duplicate titles
|
||||||
d = Document.MakeDocument(libtitle, doccontent, docascii, config, dts, userid, fileextension);
|
d = Document.MakeDocument(libtitle, doccontent, docascii, config, dts, userid, fileextension);
|
||||||
d.Save();
|
d.Save();
|
||||||
Old2NewLibDoc.Add(docid, d.DocID);
|
Old2NewLibDoc.Add(docid, d.DocID);
|
||||||
@@ -3873,15 +3860,9 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void btnCloseExport_Click(object sender, EventArgs e)
|
private void btnCloseExport_Click(object sender, EventArgs e) => Close();
|
||||||
{
|
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnCloseImport_Click(object sender, EventArgs e)
|
private void btnCloseImport_Click(object sender, EventArgs e) => Close();
|
||||||
{
|
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
//unset the unit (SelectedSlave)
|
//unset the unit (SelectedSlave)
|
||||||
private void RemoveUnit_OnClose(object sender, EventArgs e)
|
private void RemoveUnit_OnClose(object sender, EventArgs e)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace VEPROMS
|
|||||||
private readonly AnnotationTypeInfo _AnnotationType;
|
private readonly AnnotationTypeInfo _AnnotationType;
|
||||||
private readonly string multiseparator = ",";
|
private readonly string multiseparator = ",";
|
||||||
|
|
||||||
private static Regex _ROAccPageTokenPattern = new Regex("[<][^<>-]+-[^<>]+[>]");
|
private static readonly Regex _ROAccPageTokenPattern = new Regex("[<][^<>-]+-[^<>]+[>]");
|
||||||
|
|
||||||
public dlgExportImportEP(string mode, FolderInfo folderInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex = 0) : base(mode, folderInfo, myFrmVEPROMS, ( unitIndex))
|
public dlgExportImportEP(string mode, FolderInfo folderInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex = 0) : base(mode, folderInfo, myFrmVEPROMS, ( unitIndex))
|
||||||
{
|
{
|
||||||
@@ -261,9 +261,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
string rodbpath = rodb.FolderPath;
|
string rodbpath = rodb.FolderPath;
|
||||||
|
|
||||||
string rocval = roc.value;
|
string rocval = roc.value ?? Array.Find(roc.children, x => x.value.Contains('.')).value;
|
||||||
if (rocval == null) rocval = Array.Find(roc.children, x => x.value.Contains('.')).value;
|
|
||||||
|
|
||||||
if (rocval == null) return "";
|
if (rocval == null) return "";
|
||||||
string imgname;
|
string imgname;
|
||||||
if (isMulti)
|
if (isMulti)
|
||||||
|
|||||||
@@ -1,52 +1,21 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
{
|
{
|
||||||
public partial class dlgImpHowToHandleROs : Form
|
public partial class dlgImpHowToHandleROs : Form
|
||||||
{
|
{
|
||||||
private string _ImportedROFolder;
|
public string ImportedROFolder { get; set; }
|
||||||
public string ImportedROFolder
|
public string WorkingDraftROFolder { get; set; }
|
||||||
{
|
|
||||||
get { return _ImportedROFolder; }
|
|
||||||
set { _ImportedROFolder = value; }
|
|
||||||
}
|
|
||||||
private string _WorkingDraftROFolder;
|
|
||||||
public string WorkingDraftROFolder
|
|
||||||
{
|
|
||||||
get { return _WorkingDraftROFolder; }
|
|
||||||
set { _WorkingDraftROFolder = value; }
|
|
||||||
}
|
|
||||||
private bool _CancelImport = true; // default to truen in case the dialog is closed with the red X in the upper right corner
|
private bool _CancelImport = true; // default to truen in case the dialog is closed with the red X in the upper right corner
|
||||||
public bool CancelImport
|
public bool CancelImport => _CancelImport;
|
||||||
{
|
|
||||||
get { return _CancelImport; }
|
|
||||||
}
|
|
||||||
private bool _ConvertROsToText = false;
|
private bool _ConvertROsToText = false;
|
||||||
public bool ConvertROsToText
|
public bool ConvertROsToText => _ConvertROsToText;
|
||||||
{
|
public dlgImpHowToHandleROs() => InitializeComponent();
|
||||||
get { return _ConvertROsToText; }
|
|
||||||
}
|
|
||||||
public dlgImpHowToHandleROs()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void dlgImpHowToHandleROs_Load(object sender, EventArgs e)
|
private void dlgImpHowToHandleROs_Load(object sender, EventArgs e) => rtbROPathInfo.Text = string.Format("The current Working Draft RO folder path is:\n\n {0}\n\nThe procedure you are trying to import is from a database that has the RO folder path:\n\n {1}\n\nSelect from the options below on how to handle the RO values when importing this procedure.", WorkingDraftROFolder, ImportedROFolder);
|
||||||
{
|
|
||||||
rtbROPathInfo.Text = string.Format("The current Working Draft RO folder path is:\n\n {0}\n\nThe procedure you are trying to import is from a database that has the RO folder path:\n\n {1}\n\nSelect from the options below on how to handle the RO values when importing this procedure.", _WorkingDraftROFolder, _ImportedROFolder);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnUseCurrentROs_Click(object sender, EventArgs e)
|
private void btnUseCurrentROs_Click(object sender, EventArgs e) => _ConvertROsToText = _CancelImport = false;
|
||||||
{
|
|
||||||
_ConvertROsToText = _CancelImport = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnROsToText_Click(object sender, EventArgs e)
|
private void btnROsToText_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -60,9 +29,6 @@ namespace VEPROMS
|
|||||||
_ConvertROsToText = false;
|
_ConvertROsToText = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dlgImpHowToHandleROs_Resize(object sender, EventArgs e)
|
private void dlgImpHowToHandleROs_Resize(object sender, EventArgs e) => rtbROPathInfo.Refresh();
|
||||||
{
|
|
||||||
rtbROPathInfo.Refresh();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using Volian.Base.Library;
|
using Volian.Base.Library;
|
||||||
@@ -38,7 +31,7 @@ namespace VEPROMS
|
|||||||
usersettings.SetUserSetting_MSWord_Summary_Prompt(false);
|
usersettings.SetUserSetting_MSWord_Summary_Prompt(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using Volian.Base.Library;
|
|
||||||
using Volian.Controls.Library;
|
using Volian.Controls.Library;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
@@ -26,10 +21,7 @@ namespace VEPROMS
|
|||||||
private List<MembershipInfo> myMembershipInfoList;
|
private List<MembershipInfo> myMembershipInfoList;
|
||||||
private Folder myFolder;
|
private Folder myFolder;
|
||||||
|
|
||||||
public dlgManageSecurity()
|
public dlgManageSecurity() => InitializeComponent();
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
private void dlgManageSecurity_Load(object sender, EventArgs e)
|
private void dlgManageSecurity_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//load all folders
|
//load all folders
|
||||||
@@ -331,9 +323,11 @@ namespace VEPROMS
|
|||||||
private void addUserToolStripMenuItem_Click(object sender, EventArgs e)
|
private void addUserToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
User u = User.MakeUser("[Enter New UserID]", "", "", "", "", "", "", "", "", "", "", DateTime.Now, "");
|
User u = User.MakeUser("[Enter New UserID]", "", "", "", "", "", "", "", "", "", "", DateTime.Now, "");
|
||||||
frmManageUser frm = new frmManageUser("add");
|
frmManageUser frm = new frmManageUser("add")
|
||||||
frm.MyUser = u;
|
{
|
||||||
frm.Text = "Enter New UserID"; //C2026-002 Change Title bar on Add/Edit User
|
MyUser = u,
|
||||||
|
Text = "Enter New UserID" //C2026-002 Change Title bar on Add/Edit User
|
||||||
|
};
|
||||||
if (frm.ShowDialog(this) == DialogResult.OK)
|
if (frm.ShowDialog(this) == DialogResult.OK)
|
||||||
{
|
{
|
||||||
u = frm.MyUser;
|
u = frm.MyUser;
|
||||||
@@ -362,8 +356,10 @@ namespace VEPROMS
|
|||||||
UserInfo ui = myUserInfoList[lstUsers.SelectedIndex];
|
UserInfo ui = myUserInfoList[lstUsers.SelectedIndex];
|
||||||
using (User u = User.Get(ui.UID))
|
using (User u = User.Get(ui.UID))
|
||||||
{
|
{
|
||||||
frmManageUser frm = new frmManageUser("edit");
|
frmManageUser frm = new frmManageUser("edit")
|
||||||
frm.MyUser = u;
|
{
|
||||||
|
MyUser = u
|
||||||
|
};
|
||||||
if (frm.ShowDialog(this) == DialogResult.OK)
|
if (frm.ShowDialog(this) == DialogResult.OK)
|
||||||
{
|
{
|
||||||
frm.MyUser.Save();
|
frm.MyUser.Save();
|
||||||
@@ -505,11 +501,13 @@ namespace VEPROMS
|
|||||||
pnlGroups.Controls.Clear();
|
pnlGroups.Controls.Clear();
|
||||||
foreach (GroupInfo gi in myGroupInfoList)
|
foreach (GroupInfo gi in myGroupInfoList)
|
||||||
{
|
{
|
||||||
RadioButton rb = new RadioButton();
|
RadioButton rb = new RadioButton
|
||||||
rb.Text = gi.GroupName;
|
{
|
||||||
rb.Parent = pnlGroups;
|
Text = gi.GroupName,
|
||||||
rb.Dock = DockStyle.Top;
|
Parent = pnlGroups,
|
||||||
rb.Tag = gi;
|
Dock = DockStyle.Top,
|
||||||
|
Tag = gi
|
||||||
|
};
|
||||||
rb.CheckedChanged -= new EventHandler(rb_CheckedChanged);
|
rb.CheckedChanged -= new EventHandler(rb_CheckedChanged);
|
||||||
rb.CheckedChanged += new EventHandler(rb_CheckedChanged);
|
rb.CheckedChanged += new EventHandler(rb_CheckedChanged);
|
||||||
pnlGroups.Controls.Add(rb);
|
pnlGroups.Controls.Add(rb);
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
|
|
||||||
@@ -11,8 +6,8 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
public partial class dlgPhoneList : Form
|
public partial class dlgPhoneList : Form
|
||||||
{
|
{
|
||||||
private DocVersionConfig _docVersionConfig;
|
private readonly DocVersionConfig _docVersionConfig;
|
||||||
private string _origPhoneList;
|
private readonly string _origPhoneList;
|
||||||
public dlgPhoneList(DocVersionConfig dvc)
|
public dlgPhoneList(DocVersionConfig dvc)
|
||||||
{
|
{
|
||||||
_docVersionConfig = dvc;
|
_docVersionConfig = dvc;
|
||||||
|
|||||||
@@ -1,57 +1,24 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
{
|
{
|
||||||
public partial class dlgPickROFolder : Form
|
public partial class dlgPickROFolder : Form
|
||||||
{
|
{
|
||||||
private string _ImportedROFolder;
|
public string ImportedROFolder { get; set; }
|
||||||
public string ImportedROFolder
|
public List<string> LocalROFolders { get; set; }
|
||||||
{
|
public string SelectedROFolder { get; set; }
|
||||||
get { return _ImportedROFolder; }
|
public dlgPickROFolder() => InitializeComponent();
|
||||||
set { _ImportedROFolder = value; }
|
|
||||||
}
|
|
||||||
private List<string> _LocalROFolders;
|
|
||||||
public List<string> LocalROFolders
|
|
||||||
{
|
|
||||||
get { return _LocalROFolders; }
|
|
||||||
set { _LocalROFolders = value; }
|
|
||||||
}
|
|
||||||
private string _SelectedROFolder;
|
|
||||||
public string SelectedROFolder
|
|
||||||
{
|
|
||||||
get { return _SelectedROFolder; }
|
|
||||||
set { _SelectedROFolder = value; }
|
|
||||||
}
|
|
||||||
public dlgPickROFolder()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void dlgPickROFolder_Load(object sender, EventArgs e)
|
private void dlgPickROFolder_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
lblImportRO.Text = string.Format("The procedure you are trying to import was exported from a database that had the following RO folder path:\r\n\r\n{0}\r\n\r\nSelect from the following RO Folders that exist in the database you are trying to import this procedure into so that the import process can continue", _ImportedROFolder);
|
lblImportRO.Text = string.Format("The procedure you are trying to import was exported from a database that had the following RO folder path:\r\n\r\n{0}\r\n\r\nSelect from the following RO Folders that exist in the database you are trying to import this procedure into so that the import process can continue", ImportedROFolder);
|
||||||
clbLocalROFolders.DataSource = LocalROFolders;
|
clbLocalROFolders.DataSource = LocalROFolders;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clbLocalROFolders_SelectedIndexChanged(object sender, EventArgs e)
|
private void clbLocalROFolders_SelectedIndexChanged(object sender, EventArgs e) => btnOkay.Enabled = clbLocalROFolders.CheckedItems.Count > 0;
|
||||||
{
|
|
||||||
if (clbLocalROFolders.CheckedItems.Count > 0)
|
|
||||||
{
|
|
||||||
btnOkay.Enabled = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
btnOkay.Enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnOkay_Click(object sender, EventArgs e)
|
private void btnOkay_Click(object sender, EventArgs e) => SelectedROFolder = clbLocalROFolders.CheckedItems[0].ToString();
|
||||||
{
|
|
||||||
SelectedROFolder = clbLocalROFolders.CheckedItems[0].ToString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,19 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using JR.Utils.GUI.Forms;
|
using JR.Utils.GUI.Forms;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
{
|
{
|
||||||
public partial class dlgPrintAllApprovedProcedures : DevComponents.DotNetBar.Office2007Form
|
public partial class dlgPrintAllApprovedProcedures : DevComponents.DotNetBar.Office2007Form
|
||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private StringBuilder NotApproved;
|
private readonly StringBuilder NotApproved;
|
||||||
private DocVersionInfo _DocVersionInfo = null;
|
private readonly DocVersionInfo _DocVersionInfo = null;
|
||||||
private int unitId = 0;
|
private readonly int unitId = 0;
|
||||||
public dlgPrintAllApprovedProcedures(DocVersionInfo dvi)
|
public dlgPrintAllApprovedProcedures(DocVersionInfo dvi)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -43,7 +38,7 @@ namespace VEPROMS
|
|||||||
// if SelectedSlave is > 0 then we are printing Approved Child Procedures and
|
// if SelectedSlave is > 0 then we are printing Approved Child Procedures and
|
||||||
// subtract one from the index (unitId) into the list of child names (UnitNames)
|
// subtract one from the index (unitId) into the list of child names (UnitNames)
|
||||||
if (unitId > 0)
|
if (unitId > 0)
|
||||||
rtnstr += "\\" + _DocVersionInfo.UnitNames[unitId - 1]; // append Child name to path
|
rtnstr += $"\\{_DocVersionInfo.UnitNames[unitId - 1]}"; // append Child name to path
|
||||||
return rtnstr;
|
return rtnstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +86,7 @@ namespace VEPROMS
|
|||||||
int pdfCount = 0;
|
int pdfCount = 0;
|
||||||
DeleteExistingPDFs(); // delete existing PDFs in the target folder
|
DeleteExistingPDFs(); // delete existing PDFs in the target folder
|
||||||
// Get the Child index for Parent/Child procedure - if not Parent/Child this will be zero
|
// Get the Child index for Parent/Child procedure - if not Parent/Child this will be zero
|
||||||
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures)
|
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures.OfType<ProcedureInfo>())
|
||||||
{
|
{
|
||||||
RevisionInfoList ril = RevisionInfoList.GetByItemID(myProc.ItemID);
|
RevisionInfoList ril = RevisionInfoList.GetByItemID(myProc.ItemID);
|
||||||
if (ril.Count == 0)
|
if (ril.Count == 0)
|
||||||
@@ -144,7 +139,7 @@ namespace VEPROMS
|
|||||||
_MyLog.Error("Print All Approved PDFs", ex);// save error in PROMS error log
|
_MyLog.Error("Print All Approved PDFs", ex);// save error in PROMS error log
|
||||||
MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
}
|
}
|
||||||
this.Close(); // close dialog
|
Close(); // close dialog
|
||||||
}
|
}
|
||||||
private void SaveApprovedPDFToFolder(RevisionInfo revInfo,string PDFName)
|
private void SaveApprovedPDFToFolder(RevisionInfo revInfo,string PDFName)
|
||||||
{
|
{
|
||||||
@@ -168,10 +163,6 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
DirectoryInfo di = new DirectoryInfo(txbApprovedPDFsPath.Text);
|
DirectoryInfo di = new DirectoryInfo(txbApprovedPDFsPath.Text);
|
||||||
FileInfo[] fis;
|
FileInfo[] fis;
|
||||||
//DirectoryInfo[] diAry = di.GetDirectories(txbApprovedPDFsPath.Text);
|
|
||||||
//DirectoryInfo di_fmtgen;
|
|
||||||
// remove all of the PDF fils
|
|
||||||
//di_fmtgen = diAry[0];
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fis = di.GetFiles("*.pdf");
|
fis = di.GetFiles("*.pdf");
|
||||||
@@ -189,14 +180,8 @@ namespace VEPROMS
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void txbApprovedPDFsPath_TextChanged(object sender, EventArgs e)
|
private void txbApprovedPDFsPath_TextChanged(object sender, EventArgs e) => btnPrntAllAprv.Enabled = txbApprovedPDFsPath.Text.Length > 0;
|
||||||
{
|
|
||||||
btnPrntAllAprv.Enabled = txbApprovedPDFsPath.Text.Length > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnCancel_Click(object sender, EventArgs e)
|
private void btnCancel_Click(object sender, EventArgs e) => Close();
|
||||||
{
|
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@@ -29,7 +28,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
if (tmp[0] == null || tmp[0] == "") // First time date set.
|
if (tmp[0] == null || tmp[0] == "") // First time date set.
|
||||||
{
|
{
|
||||||
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + DateTime.Now.ToString("HH:mm:ss");
|
cbdt = $"{DateTime.Now:MM/dd/yyyy} {DateTime.Now:HH:mm:ss}";
|
||||||
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -43,13 +42,13 @@ namespace VEPROMS
|
|||||||
var time = tmpdt.TimeOfDay;
|
var time = tmpdt.TimeOfDay;
|
||||||
if (start < time) // If time is greater than 12:00:00 AM
|
if (start < time) // If time is greater than 12:00:00 AM
|
||||||
{
|
{
|
||||||
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + tmpdt.TimeOfDay.ToString();
|
cbdt = $"{DateTime.Now:MM/dd/yyyy} {tmpdt.TimeOfDay}";
|
||||||
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else // if time is 12:00:00 AM
|
else // if time is 12:00:00 AM
|
||||||
{
|
{
|
||||||
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + " 00:00:00";
|
cbdt = $"{DateTime.Now:MM/dd/yyyy} 00:00:00";
|
||||||
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -68,15 +67,30 @@ namespace VEPROMS
|
|||||||
MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");// ("MM/dd/yyyy HH:mm:ss");
|
MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");// ("MM/dd/yyyy HH:mm:ss");
|
||||||
|
|
||||||
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
|
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
|
||||||
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({ dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({ VlnSettings.UserID}) on ({DateTime.Now})", DateTime.Now, VlnSettings.UserID, 0);
|
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({dateTimeInput1.Value:MM/dd/yyyy HH:mm:ss}) by ({VlnSettings.UserID}) on ({DateTime.Now})", DateTime.Now, VlnSettings.UserID, 0);
|
||||||
|
|
||||||
}
|
//CSM C2026-014 if multi-unit, set for each unit
|
||||||
|
System.Data.DataTable dt = RevisionData.GetRevisionDataByUnit(MyProcInfo.ItemID);
|
||||||
|
if (RevisionData.HasUnits(dt))
|
||||||
private void btnNow_Click(object sender, EventArgs e)
|
|
||||||
{
|
{
|
||||||
dateTimeInput1.Value = DateTime.Now;
|
//Change the ChangeBarDate for each unit
|
||||||
|
foreach (DataRow r in dt.Rows)
|
||||||
|
{
|
||||||
|
if (!r.IsNull("UnitID"))
|
||||||
|
{
|
||||||
|
MyProcConfig.SelectedSlave = Convert.ToInt32(r["UnitID"]);
|
||||||
|
MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");
|
||||||
|
|
||||||
|
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
|
||||||
|
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({dateTimeInput1.Value:MM/dd/yyyy HH:mm:ss}) by ({VlnSettings.UserID}) on ({DateTime.Now}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
MyProcConfig.SelectedSlave = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void btnNow_Click(object sender, EventArgs e) => dateTimeInput1.Value = DateTime.Now;
|
||||||
|
|
||||||
//C2026-009 Add Option to Reset Change Bar to Last Approved Date/Time
|
//C2026-009 Add Option to Reset Change Bar to Last Approved Date/Time
|
||||||
private void btnResetToApproved_Click(object sender, EventArgs e)
|
private void btnResetToApproved_Click(object sender, EventArgs e)
|
||||||
@@ -107,13 +121,16 @@ namespace VEPROMS
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.Append($" The Procedure Viewer Change Bar Date will be set to ({maxDTS}).");
|
sb.Append($" The Procedure Viewer Change Bar Date will be set to ({maxDTS}).");
|
||||||
foreach (DataRow r in dt.Rows)
|
foreach (DataRow r in dt.Rows)
|
||||||
|
{
|
||||||
|
if (!r.IsNull("UnitID"))
|
||||||
{
|
{
|
||||||
sb.Append($"\r\n The Change Bar Date for Unit ({r["UnitName"]}) will be set to ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}).");
|
sb.Append($"\r\n The Change Bar Date for Unit ({r["UnitName"]}) will be set to ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}).");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sb.Append("\r\n Any Change Bars for Units not listed above will use the Overall/Procedure Viewer Change Bar Date (as these Units have no approvals).");
|
sb.Append("\r\n Any Change Bars for Units not listed above will use the Overall/Procedure Viewer Change Bar Date (as these Units have no approvals).");
|
||||||
|
|
||||||
if (CustomMessageBox.Show($"This will reset ChangeBars to show for changes newer than the last approval.\r\nThis includes the following changes:\r\n{sb.ToString()}\r\n\r\nAre you sure you wish to reset ChangeBars?", "Reset ChangeBar Date", "Yes", "No") == DialogResult.Yes)
|
if (CustomMessageBox.Show($"This will reset ChangeBars to show for changes newer than the last approval.\r\nThis includes the following changes:\r\n{sb}\r\n\r\nAre you sure you wish to reset ChangeBars?", "Reset ChangeBar Date", "Yes", "No") == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
//Change the overall ChangeBarDate
|
//Change the overall ChangeBarDate
|
||||||
MyProcConfig.Print_ChangeBarDate = maxDTS;
|
MyProcConfig.Print_ChangeBarDate = maxDTS;
|
||||||
@@ -121,12 +138,14 @@ namespace VEPROMS
|
|||||||
//Change the ChangeBarDate for each unit
|
//Change the ChangeBarDate for each unit
|
||||||
foreach (DataRow r in dt.Rows)
|
foreach (DataRow r in dt.Rows)
|
||||||
{
|
{
|
||||||
|
if (!r.IsNull("UnitID"))
|
||||||
|
{
|
||||||
MyProcConfig.SelectedSlave = Convert.ToInt32(r["UnitID"]);
|
MyProcConfig.SelectedSlave = Convert.ToInt32(r["UnitID"]);
|
||||||
MyProcConfig.Print_ChangeBarDate = Convert.ToDateTime(r["DTS"]).ToString("MM / dd / yyyy HH: mm: ss");
|
MyProcConfig.Print_ChangeBarDate = Convert.ToDateTime(r["DTS"]).ToString("MM / dd / yyyy HH: mm: ss");
|
||||||
|
|
||||||
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
|
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
|
||||||
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show since last approval ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave);
|
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show since last approval ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
MyProcConfig.SelectedSlave = 0;
|
MyProcConfig.SelectedSlave = 0;
|
||||||
DialogResult = DialogResult.OK;
|
DialogResult = DialogResult.OK;
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using Volian.Print.Library;
|
using Volian.Print.Library;
|
||||||
@@ -13,9 +9,10 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
public partial class dlgTransitionReport : Form
|
public partial class dlgTransitionReport : Form
|
||||||
{
|
{
|
||||||
private FolderInfo folderInfo = null;
|
private readonly FolderInfo folderInfo = null;
|
||||||
private ProcedureInfo procedureInfo = null;
|
private readonly ProcedureInfo procedureInfo = null;
|
||||||
private PDFTransitionReport rpt;
|
private PDFTransitionReport rpt;
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private List<DocVersionInfo> lstDocVersions;
|
private List<DocVersionInfo> lstDocVersions;
|
||||||
public dlgTransitionReport(FolderInfo fi)
|
public dlgTransitionReport(FolderInfo fi)
|
||||||
{
|
{
|
||||||
@@ -26,7 +23,7 @@ namespace VEPROMS
|
|||||||
if (lstDocVersions.Count == 1)
|
if (lstDocVersions.Count == 1)
|
||||||
{
|
{
|
||||||
pnlVersions.Visible = false;
|
pnlVersions.Visible = false;
|
||||||
this.Height = this.Height - pnlVersions.Height;
|
Height -= pnlVersions.Height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public dlgTransitionReport(ProcedureInfo pi)
|
public dlgTransitionReport(ProcedureInfo pi)
|
||||||
@@ -34,15 +31,16 @@ namespace VEPROMS
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
procedureInfo = pi;
|
procedureInfo = pi;
|
||||||
pnlVersions.Visible = pnlProcs.Visible = false;
|
pnlVersions.Visible = pnlProcs.Visible = false;
|
||||||
this.Height = this.Height - pnlVersions.Height - pnlProcs.Height;
|
Height = Height - pnlVersions.Height - pnlProcs.Height;
|
||||||
}
|
}
|
||||||
//private DocVersionInfo docVersionInfo;
|
|
||||||
private void dlgTransitionReport_Load(object sender, EventArgs e)
|
private void dlgTransitionReport_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (folderInfo != null)
|
if (folderInfo != null)
|
||||||
{
|
{
|
||||||
rpt = new PDFTransitionReport(folderInfo, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf");
|
rpt = new PDFTransitionReport(folderInfo, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf")
|
||||||
rpt.MyDocVersionList = lstDocVersions;
|
{
|
||||||
|
MyDocVersionList = lstDocVersions
|
||||||
|
};
|
||||||
if (lstDocVersions.Count == 1)
|
if (lstDocVersions.Count == 1)
|
||||||
pbProcs.Maximum = lstDocVersions[0].Procedures.Count;
|
pbProcs.Maximum = lstDocVersions[0].Procedures.Count;
|
||||||
else
|
else
|
||||||
@@ -54,7 +52,7 @@ namespace VEPROMS
|
|||||||
if (VlnSettings.GetCommandFlag("PROFILE")) ProfileTimer.TurnOnTracking("Profile.txt");
|
if (VlnSettings.GetCommandFlag("PROFILE")) ProfileTimer.TurnOnTracking("Profile.txt");
|
||||||
VEPROMS.CSLA.Library.Database.TrackDBUsage = VlnSettings.GetCommandFlag("DBTrack");
|
VEPROMS.CSLA.Library.Database.TrackDBUsage = VlnSettings.GetCommandFlag("DBTrack");
|
||||||
ProfileTimer.Reset();
|
ProfileTimer.Reset();
|
||||||
int profileDepth = ProfileTimer.Push(">>>> transitionreport");
|
_ = ProfileTimer.Push(">>>> transitionreport");
|
||||||
rpt = new PDFTransitionReport(procedureInfo, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf");
|
rpt = new PDFTransitionReport(procedureInfo, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf");
|
||||||
pbTrans.Maximum = rpt.TransitionInfoCount;
|
pbTrans.Maximum = rpt.TransitionInfoCount;
|
||||||
tmrReportStart.Enabled = true;
|
tmrReportStart.Enabled = true;
|
||||||
@@ -131,7 +129,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
tmrReportFinish.Enabled = false;
|
tmrReportFinish.Enabled = false;
|
||||||
System.Diagnostics.Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf");
|
System.Diagnostics.Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf");
|
||||||
this.Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,32 +1,22 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using Volian.Base.Library;
|
|
||||||
//using Volian.Pipe.Library;
|
|
||||||
using System.Xml;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using JR.Utils.GUI.Forms;
|
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
{
|
{
|
||||||
public partial class frmAnnotationsCleanup : Form
|
public partial class frmAnnotationsCleanup : Form
|
||||||
{
|
{
|
||||||
Label mylab = new Label();
|
|
||||||
string procList = "";
|
string procList = "";
|
||||||
string docvList = "";
|
string docvList = "";
|
||||||
int AnnotationTyp;
|
int AnnotationTyp;
|
||||||
string AnnotationName = "";
|
string AnnotationName = "";
|
||||||
string totalDeleteCnt = "";
|
string totalDeleteCnt = "";
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
List<ProcedureInfo> pil2 = new List<ProcedureInfo>();
|
List<ProcedureInfo> pil2 = new List<ProcedureInfo>();
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
List<DocVersionInfo> dvil2 = new List<DocVersionInfo>();
|
List<DocVersionInfo> dvil2 = new List<DocVersionInfo>();
|
||||||
private frmBatchRefresh mainForm = null;
|
private readonly frmBatchRefresh mainForm = null;
|
||||||
// frmAnnotationsCleanup constructor passes users procedure and docversion selections from frmBatchRefresh
|
// frmAnnotationsCleanup constructor passes users procedure and docversion selections from frmBatchRefresh
|
||||||
public frmAnnotationsCleanup(Form callingForm, List<ProcedureInfo> pil, List<DocVersionInfo> dvil)
|
public frmAnnotationsCleanup(Form callingForm, List<ProcedureInfo> pil, List<DocVersionInfo> dvil)
|
||||||
|
|
||||||
@@ -47,7 +37,6 @@ namespace VEPROMS
|
|||||||
foreach (LocalAnnotationTypeInfo lati in myLocalAnnotationTypeInfoList)
|
foreach (LocalAnnotationTypeInfo lati in myLocalAnnotationTypeInfoList)
|
||||||
{
|
{
|
||||||
AnnotationsList.Add(lati.TypeID.ToString(), lati.Name);
|
AnnotationsList.Add(lati.TypeID.ToString(), lati.Name);
|
||||||
//cbAnnotationTypes.Items.Add(new { Name = lati.Name, Value = lati.TypeID });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lbAnnotationTypes.DataSource = new BindingSource(AnnotationsList, null);
|
lbAnnotationTypes.DataSource = new BindingSource(AnnotationsList, null);
|
||||||
@@ -67,11 +56,11 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
if (procList == "")
|
if (procList == "")
|
||||||
{
|
{
|
||||||
procList = procList + p.ItemID.ToString();
|
procList += p.ItemID.ToString();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
procList = procList + "," + p.ItemID.ToString();
|
procList = $"{procList},{p.ItemID}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,18 +77,19 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
if (docvList == "")
|
if (docvList == "")
|
||||||
{
|
{
|
||||||
docvList = docvList + d.VersionID.ToString();
|
docvList += d.VersionID.ToString();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
docvList = docvList + "," + d.VersionID.ToString();
|
docvList = $"{docvList},{d.VersionID}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return docvList;
|
return docvList;
|
||||||
}
|
}
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private AnnotationTypeInfoList myAnnotationTypeInfoList = null;
|
private AnnotationTypeInfoList myAnnotationTypeInfoList = null;
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private LocalAnnotationTypeInfoList myLocalAnnotationTypeInfoList = null;
|
private LocalAnnotationTypeInfoList myLocalAnnotationTypeInfoList = null;
|
||||||
|
|
||||||
// Process used to cleanup annotations "(Proceed?" button)
|
// Process used to cleanup annotations "(Proceed?" button)
|
||||||
@@ -112,21 +102,15 @@ namespace VEPROMS
|
|||||||
TextBox frm3 = mainForm.GettxtResults();
|
TextBox frm3 = mainForm.GettxtResults();
|
||||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||||
AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
||||||
frm3.AppendText("Deleting Annotations: Annotation Type: " + '"' + AnnotationName + '"');
|
frm3.AppendText($"Deleting Annotations: Annotation Type: \"{AnnotationName}\"");
|
||||||
frm3.AppendText(Environment.NewLine + "P = Procedure, F = Folder" + Environment.NewLine);
|
frm3.AppendText($"{Environment.NewLine}P = Procedure, F = Folder{Environment.NewLine}");
|
||||||
int deletecountProc = 0;
|
|
||||||
int deletecountDocv = 0;
|
|
||||||
foreach (var p in pil2)
|
foreach (var p in pil2)
|
||||||
{
|
{
|
||||||
if (p.IsProcedure)
|
if (p.IsProcedure)
|
||||||
{
|
{
|
||||||
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
int deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, p.ItemID.ToString());
|
||||||
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
frm2.AppendText($"{Environment.NewLine}{p.DisplayNumber} {p.DisplayText}");
|
||||||
//deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, getAnnotationProcItems(p));
|
frm3.AppendText($"{Environment.NewLine}P: {p.DisplayNumber}\"{p.DisplayText}\" Delete count: {deletecountProc}");
|
||||||
deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, p.ItemID.ToString());
|
|
||||||
frm2.AppendText(Environment.NewLine + p.DisplayNumber + ' ' + p.DisplayText);
|
|
||||||
//frm3.AppendText(Environment.NewLine + "P: " + p.DisplayNumber + '"' + p.DisplayText + '"' + " Type: " + '"' + AnnotationName + '"' + " count: " + deletecountProc);
|
|
||||||
frm3.AppendText(Environment.NewLine + "P: " + p.DisplayNumber + '"' + p.DisplayText + '"' + " Delete count: " + deletecountProc);
|
|
||||||
Annotation.DeleteAnnotationProcByType(AnnotationTyp, p.ItemID.ToString());
|
Annotation.DeleteAnnotationProcByType(AnnotationTyp, p.ItemID.ToString());
|
||||||
lblCountNumber.Text = "0";
|
lblCountNumber.Text = "0";
|
||||||
}
|
}
|
||||||
@@ -136,18 +120,16 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
if (d.IsDocVersion)
|
if (d.IsDocVersion)
|
||||||
{
|
{
|
||||||
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
int deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, d.VersionID.ToString());
|
||||||
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
|
||||||
deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, d.VersionID.ToString());
|
|
||||||
frm2.AppendText(Environment.NewLine + d.ActiveParent.ToString());
|
frm2.AppendText(Environment.NewLine + d.ActiveParent.ToString());
|
||||||
frm3.AppendText(Environment.NewLine + "F: " + '"' + d.ActiveParent.ToString() + '"' + " Delete count: " + deletecountDocv);
|
frm3.AppendText($"{Environment.NewLine}F: \"{d.ActiveParent.ToString()}\" Delete count: {deletecountDocv}");
|
||||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||||
Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString());
|
Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString());
|
||||||
|
|
||||||
lblCountNumber.Text = "0";
|
lblCountNumber.Text = "0";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
frm3.AppendText(Environment.NewLine + Environment.NewLine + "Total Annotations Deleted: " + totalDeleteCnt + Environment.NewLine + Environment.NewLine);
|
frm3.AppendText($"{Environment.NewLine}{Environment.NewLine}Total Annotations Deleted: {totalDeleteCnt}{Environment.NewLine}{Environment.NewLine}");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -179,10 +161,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
}
|
}
|
||||||
// Close form.
|
// Close form.
|
||||||
private void btnClose_Click(object sender, EventArgs e)
|
private void btnClose_Click(object sender, EventArgs e) => Close();
|
||||||
{
|
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+46
-8
@@ -113,6 +113,8 @@
|
|||||||
this.lblAdmToolProgressType = new DevComponents.DotNetBar.LabelX();
|
this.lblAdmToolProgressType = new DevComponents.DotNetBar.LabelX();
|
||||||
this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem();
|
this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem();
|
||||||
this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip();
|
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();
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
|
||||||
this.splitContainer3.Panel1.SuspendLayout();
|
this.splitContainer3.Panel1.SuspendLayout();
|
||||||
this.splitContainer3.Panel2.SuspendLayout();
|
this.splitContainer3.Panel2.SuspendLayout();
|
||||||
@@ -902,6 +904,8 @@
|
|||||||
//
|
//
|
||||||
// sideNavPanel2
|
// sideNavPanel2
|
||||||
//
|
//
|
||||||
|
this.sideNavPanel2.Controls.Add(this.swRegenWordAttmts);
|
||||||
|
this.sideNavPanel2.Controls.Add(this.labelX1);
|
||||||
this.sideNavPanel2.Controls.Add(this.swRefreshTblsForSrch);
|
this.sideNavPanel2.Controls.Add(this.swRefreshTblsForSrch);
|
||||||
this.sideNavPanel2.Controls.Add(this.lblRefreshTblForSrch);
|
this.sideNavPanel2.Controls.Add(this.lblRefreshTblForSrch);
|
||||||
this.sideNavPanel2.Controls.Add(this.warningBox4);
|
this.sideNavPanel2.Controls.Add(this.warningBox4);
|
||||||
@@ -930,11 +934,11 @@
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
this.swRefreshTblsForSrch.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
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.Name = "swRefreshTblsForSrch";
|
||||||
this.swRefreshTblsForSrch.Size = new System.Drawing.Size(91, 22);
|
this.swRefreshTblsForSrch.Size = new System.Drawing.Size(91, 22);
|
||||||
this.swRefreshTblsForSrch.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
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.SwitchClickTogglesValue = true;
|
||||||
this.swRefreshTblsForSrch.TabIndex = 32;
|
this.swRefreshTblsForSrch.TabIndex = 32;
|
||||||
this.swRefreshTblsForSrch.Value = true;
|
this.swRefreshTblsForSrch.Value = true;
|
||||||
@@ -949,10 +953,10 @@
|
|||||||
//
|
//
|
||||||
this.lblRefreshTblForSrch.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
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.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.Name = "lblRefreshTblForSrch";
|
||||||
this.lblRefreshTblForSrch.Size = new System.Drawing.Size(186, 22);
|
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.TabIndex = 31;
|
||||||
this.lblRefreshTblForSrch.Text = "Refresh Tables For Search";
|
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.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(219)))), ((int)(((byte)(249)))));
|
||||||
this.warningBox4.CloseButtonVisible = false;
|
this.warningBox4.CloseButtonVisible = false;
|
||||||
this.warningBox4.Image = ((System.Drawing.Image)(resources.GetObject("warningBox4.Image")));
|
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.Margin = new System.Windows.Forms.Padding(4);
|
||||||
this.warningBox4.Name = "warningBox4";
|
this.warningBox4.Name = "warningBox4";
|
||||||
this.warningBox4.OptionsButtonVisible = false;
|
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.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(219)))), ((int)(((byte)(249)))));
|
||||||
this.warningBox2.CloseButtonVisible = false;
|
this.warningBox2.CloseButtonVisible = false;
|
||||||
this.warningBox2.Image = ((System.Drawing.Image)(resources.GetObject("warningBox2.Image")));
|
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.Margin = new System.Windows.Forms.Padding(4);
|
||||||
this.warningBox2.Name = "warningBox2";
|
this.warningBox2.Name = "warningBox2";
|
||||||
this.warningBox2.OptionsButtonVisible = false;
|
this.warningBox2.OptionsButtonVisible = false;
|
||||||
@@ -1128,7 +1132,7 @@
|
|||||||
// line2
|
// line2
|
||||||
//
|
//
|
||||||
this.line2.BackColor = System.Drawing.Color.Transparent;
|
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.Name = "line2";
|
||||||
this.line2.Size = new System.Drawing.Size(281, 12);
|
this.line2.Size = new System.Drawing.Size(281, 12);
|
||||||
this.line2.TabIndex = 20;
|
this.line2.TabIndex = 20;
|
||||||
@@ -1140,7 +1144,7 @@
|
|||||||
this.btnRunRepair.Checked = true;
|
this.btnRunRepair.Checked = true;
|
||||||
this.btnRunRepair.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
|
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.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.Name = "btnRunRepair";
|
||||||
this.btnRunRepair.Size = new System.Drawing.Size(280, 23);
|
this.btnRunRepair.Size = new System.Drawing.Size(280, 23);
|
||||||
this.btnRunRepair.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
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.DefaultTooltipSettings = new DevComponents.DotNetBar.SuperTooltipInfo("", "", "", null, null, DevComponents.DotNetBar.eTooltipColor.Gray);
|
||||||
this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
|
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
|
// frmBatchRefresh
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
@@ -1430,6 +1466,8 @@
|
|||||||
private DevComponents.DotNetBar.PanelEx itemPanel2;
|
private DevComponents.DotNetBar.PanelEx itemPanel2;
|
||||||
private DevComponents.DotNetBar.PanelEx itemPanel3;
|
private DevComponents.DotNetBar.PanelEx itemPanel3;
|
||||||
private DevComponents.DotNetBar.ButtonX btnROsNotUsed;
|
private DevComponents.DotNetBar.ButtonX btnROsNotUsed;
|
||||||
|
private DevComponents.DotNetBar.Controls.SwitchButton swRegenWordAttmts;
|
||||||
|
private DevComponents.DotNetBar.LabelX labelX1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,28 +15,23 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
public partial class frmBatchRefresh : Form
|
public partial class frmBatchRefresh : Form
|
||||||
{
|
{
|
||||||
private SessionInfo _MySessionInfo;
|
public SessionInfo MySessionInfo { get; set; }
|
||||||
public SessionInfo MySessionInfo
|
private readonly bool IsAdministratorUser = false; //C2020-035 used to control what Set Amins can do
|
||||||
{
|
|
||||||
get { return _MySessionInfo; }
|
|
||||||
set { _MySessionInfo = value; }
|
|
||||||
}
|
|
||||||
private bool IsAdministratorUser = false; //C2020-035 used to control what Set Amins can do
|
|
||||||
// C2017-030 - new Admin Tools user interface
|
// C2017-030 - new Admin Tools user interface
|
||||||
// pass in session info to constructor
|
// pass in session info to constructor
|
||||||
|
|
||||||
private frmVEPROMS _veProms;
|
private readonly frmVEPROMS _veProms;
|
||||||
|
|
||||||
public frmBatchRefresh(SessionInfo sessionInfo, frmVEPROMS veProms)
|
public frmBatchRefresh(SessionInfo sessionInfo, frmVEPROMS veProms)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_MySessionInfo = sessionInfo;
|
MySessionInfo = sessionInfo;
|
||||||
|
|
||||||
_veProms = veProms;
|
_veProms = veProms;
|
||||||
|
|
||||||
|
|
||||||
// When opening Admin tools Repair tab will be default.
|
// When opening Admin tools Repair tab will be default.
|
||||||
this.sideNavItmRepair.Checked = true;
|
sideNavItmRepair.Checked = true;
|
||||||
|
|
||||||
if (sideNavItmDelete.Checked)
|
if (sideNavItmDelete.Checked)
|
||||||
{
|
{
|
||||||
@@ -62,6 +57,8 @@ namespace VEPROMS
|
|||||||
swRmObsoleteROData.Enabled = false;
|
swRmObsoleteROData.Enabled = false;
|
||||||
swRmOrphanDataRecs.Enabled = false;
|
swRmOrphanDataRecs.Enabled = false;
|
||||||
swRefreshWordAttmts.Enabled = false;
|
swRefreshWordAttmts.Enabled = false;
|
||||||
|
swRegenWordAttmts.Enabled = false;
|
||||||
|
swRefreshTblsForSrch.Enabled = false;
|
||||||
swStandardHypenChars.Enabled = false;
|
swStandardHypenChars.Enabled = false;
|
||||||
|
|
||||||
//if not full admin, disable Purge Change History
|
//if not full admin, disable Purge Change History
|
||||||
@@ -72,16 +69,10 @@ namespace VEPROMS
|
|||||||
dtePurge.Value = DateTime.Now.AddYears(-10);
|
dtePurge.Value = DateTime.Now.AddYears(-10);
|
||||||
}
|
}
|
||||||
// Make txtProcess text box available to frmAnnotationsClean form.
|
// Make txtProcess text box available to frmAnnotationsClean form.
|
||||||
internal TextBox GettxtProcess()
|
internal TextBox GettxtProcess() => txtProcess;
|
||||||
{
|
|
||||||
return txtProcess;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make txtResults text box available to frmAnnotationsClean form.
|
// Make txtResults text box available to frmAnnotationsClean form.
|
||||||
internal TextBox GettxtResults()
|
internal TextBox GettxtResults() => txtResults;
|
||||||
{
|
|
||||||
return txtResults;
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE: removed the Refresh ROs and Refresh Transitions and ROs options (now only Transitions can be refreshed)
|
// NOTE: removed the Refresh ROs and Refresh Transitions and ROs options (now only Transitions can be refreshed)
|
||||||
// the Update ROs and Refresh ROs logic was merged together. The Update ROs will functionally do both
|
// the Update ROs and Refresh ROs logic was merged together. The Update ROs will functionally do both
|
||||||
@@ -92,7 +83,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private void FixHyphens()
|
private void FixHyphens()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Standardizing Hyphens");
|
txtProcess.AppendText("Standardizing Hyphens");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
@@ -110,22 +101,19 @@ namespace VEPROMS
|
|||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private Dictionary<TreeNode, ProcedureInfo> myProcedures = new Dictionary<TreeNode, ProcedureInfo>();
|
private Dictionary<TreeNode, ProcedureInfo> myProcedures = new Dictionary<TreeNode, ProcedureInfo>();
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private Dictionary<TreeNode, DocVersionInfo> myDocVersions = new Dictionary<TreeNode, DocVersionInfo>();
|
private Dictionary<TreeNode, DocVersionInfo> myDocVersions = new Dictionary<TreeNode, DocVersionInfo>();
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private Dictionary<TreeNode, FolderInfo> myFolders = new Dictionary<TreeNode, FolderInfo>();
|
private Dictionary<TreeNode, FolderInfo> myFolders = new Dictionary<TreeNode, FolderInfo>();
|
||||||
|
|
||||||
private void frmBatchRefresh_Load(object sender, EventArgs e)
|
private void frmBatchRefresh_Load(object sender, EventArgs e) => IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||||
{
|
|
||||||
IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
|
||||||
}
|
|
||||||
private bool IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
private bool IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||||
private void frmBatchRefresh_FormClosing(object sender, EventArgs e)
|
private void frmBatchRefresh_FormClosing(object sender, EventArgs e) => IsClosing = true;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||||
{
|
|
||||||
IsClosing = true;//B2017-221 Allow the batch dialog to close when waiting to process.
|
|
||||||
}
|
|
||||||
// C2017-030 - new Admin Tools user interface
|
// C2017-030 - new Admin Tools user interface
|
||||||
// check to see if at least one tree node is checked.
|
// check to see if at least one tree node is checked.
|
||||||
// Used to determin whether to make the process button active for
|
// Used to determin whether to make the process button active for
|
||||||
@@ -152,7 +140,7 @@ namespace VEPROMS
|
|||||||
//C2026-002 Enhancements to new admin Tool for ROs not used.
|
//C2026-002 Enhancements to new admin Tool for ROs not used.
|
||||||
private void ResetmyTV_RO_DBs()
|
private void ResetmyTV_RO_DBs()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
myTV_RO_DBs.Nodes.Clear();
|
myTV_RO_DBs.Nodes.Clear();
|
||||||
|
|
||||||
TreeNode tn = myTV_RO_DBs.Nodes.Add("Select All");
|
TreeNode tn = myTV_RO_DBs.Nodes.Add("Select All");
|
||||||
@@ -167,13 +155,13 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
tn.Expand();
|
tn.Expand();
|
||||||
|
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ResetTV(bool noProcs)
|
private void ResetTV(bool noProcs)
|
||||||
{
|
{
|
||||||
btnFixLinks.Enabled = false;
|
btnFixLinks.Enabled = false;
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
myTV.Nodes.Clear();
|
myTV.Nodes.Clear();
|
||||||
myDocVersions.Clear();
|
myDocVersions.Clear();
|
||||||
myFolders.Clear();
|
myFolders.Clear();
|
||||||
@@ -182,14 +170,13 @@ namespace VEPROMS
|
|||||||
tn.Tag = fi;
|
tn.Tag = fi;
|
||||||
if (fi.ChildFolderCount > 0)
|
if (fi.ChildFolderCount > 0)
|
||||||
LoadChildFolders(fi, tn, noProcs);
|
LoadChildFolders(fi, tn, noProcs);
|
||||||
if (myTV.SelectedNode != null)
|
myTV.SelectedNode?.Expand();
|
||||||
myTV.SelectedNode.Expand();
|
Cursor = Cursors.Default;
|
||||||
this.Cursor = Cursors.Default;
|
|
||||||
}
|
}
|
||||||
private void ResetDelTV(bool noProcs)
|
private void ResetDelTV(bool noProcs)
|
||||||
{
|
{
|
||||||
btnFixLinks.Enabled = false;
|
btnFixLinks.Enabled = false;
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
myTVdel.Nodes.Clear();
|
myTVdel.Nodes.Clear();
|
||||||
myDocVersions.Clear();
|
myDocVersions.Clear();
|
||||||
FolderInfo fi = FolderInfo.GetTop();
|
FolderInfo fi = FolderInfo.GetTop();
|
||||||
@@ -198,21 +185,22 @@ namespace VEPROMS
|
|||||||
|
|
||||||
if (fi.ChildFolderCount > 0)
|
if (fi.ChildFolderCount > 0)
|
||||||
{
|
{
|
||||||
TreeNode tn = new TreeNode(fi.Name);
|
TreeNode tn = new TreeNode(fi.Name)
|
||||||
tn.Tag = fi;
|
{
|
||||||
tn.StateImageIndex = -1; // Hide the checkbox for the root node
|
Tag = fi,
|
||||||
|
StateImageIndex = -1 // Hide the checkbox for the root node
|
||||||
|
};
|
||||||
LoadChildFolders(fi, tn, noProcs);
|
LoadChildFolders(fi, tn, noProcs);
|
||||||
myTVdel.Nodes.Add(tn);
|
myTVdel.Nodes.Add(tn);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (myTVdel.SelectedNode != null)
|
myTVdel.SelectedNode?.Expand();
|
||||||
myTVdel.SelectedNode.Expand();
|
|
||||||
|
|
||||||
//Expand if folders
|
//Expand if folders
|
||||||
if (noProcs)
|
if (noProcs)
|
||||||
myTVdel.ExpandAll();
|
myTVdel.ExpandAll();
|
||||||
|
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
// B2021-060 Higher level folders where being removed from the tree even if there was a child folder that containe a working draft set
|
// B2021-060 Higher level folders where being removed from the tree even if there was a child folder that containe a working draft set
|
||||||
@@ -302,7 +290,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private void UpdateROValues()
|
private void UpdateROValues()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
List<ProcedureInfo> pil = new List<ProcedureInfo>(); // C2023-002: list of checked out procedures, used in frmBatchRefreshCheckedOut dialog
|
List<ProcedureInfo> pil = new List<ProcedureInfo>(); // C2023-002: list of checked out procedures, used in frmBatchRefreshCheckedOut dialog
|
||||||
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
|
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
|
||||||
foreach (TreeNode tn in myDocVersions.Keys)
|
foreach (TreeNode tn in myDocVersions.Keys)
|
||||||
@@ -375,14 +363,16 @@ namespace VEPROMS
|
|||||||
sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately.");
|
sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately.");
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?");
|
sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?");
|
||||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(1);
|
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(1)
|
||||||
frmCO.MySessionInfo = MySessionInfo;
|
{
|
||||||
frmCO.CheckedOutProcedures = pil; // C2023-002: set list of checked out procedures
|
MySessionInfo = MySessionInfo,
|
||||||
|
CheckedOutProcedures = pil // C2023-002: set list of checked out procedures
|
||||||
|
};
|
||||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||||
// C2023-002: Allow close of dialog that has list of procedures that are checked out
|
// C2023-002: Allow close of dialog that has list of procedures that are checked out
|
||||||
if (frmCO.ShowDialog(this) != DialogResult.Cancel)
|
if (frmCO.ShowDialog(this) != DialogResult.Cancel)
|
||||||
{
|
{
|
||||||
while (!this.Visible)
|
while (!Visible)
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -398,7 +388,7 @@ namespace VEPROMS
|
|||||||
txtProcess.AppendText(string.Format("Could Not Complete: {0} {1} Seconds Elapsed", pEnd.ToString("MM/dd/yyyy @ HH:mm"), TimeSpan.FromTicks(pEnd.Ticks - pStart.Ticks).TotalSeconds));
|
txtProcess.AppendText(string.Format("Could Not Complete: {0} {1} Seconds Elapsed", pEnd.ToString("MM/dd/yyyy @ HH:mm"), TimeSpan.FromTicks(pEnd.Ticks - pStart.Ticks).TotalSeconds));
|
||||||
pbProcess.Value = pbProcess.Maximum;
|
pbProcess.Value = pbProcess.Maximum;
|
||||||
}
|
}
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
//C2025-011 RO Update Admin Tool Memory Enhancements
|
//C2025-011 RO Update Admin Tool Memory Enhancements
|
||||||
@@ -423,7 +413,7 @@ namespace VEPROMS
|
|||||||
private void CheckROLinks()
|
private void CheckROLinks()
|
||||||
{
|
{
|
||||||
bool badLinksFound = false;
|
bool badLinksFound = false;
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
||||||
// populate a list of procedures that the user selected to process
|
// populate a list of procedures that the user selected to process
|
||||||
foreach (TreeNode tn in myProcedures.Keys)
|
foreach (TreeNode tn in myProcedures.Keys)
|
||||||
@@ -498,15 +488,17 @@ namespace VEPROMS
|
|||||||
|
|
||||||
if (piq.Count > 0)
|
if (piq.Count > 0)
|
||||||
{
|
{
|
||||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(0);
|
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(0)
|
||||||
frmCO.MySessionInfo = MySessionInfo;
|
{
|
||||||
|
MySessionInfo = MySessionInfo
|
||||||
|
};
|
||||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||||
frmCO.Show(this);
|
frmCO.Show(this);
|
||||||
while (!this.Visible)
|
while (!Visible)
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
// B2018-002 - Invalid Transitions - Define Transition Refresh Statistics
|
// B2018-002 - Invalid Transitions - Define Transition Refresh Statistics
|
||||||
@@ -526,7 +518,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
// B2018-002 - Invalid Transitions - Initialize Transition Refresh Statistics
|
// B2018-002 - Invalid Transitions - Initialize Transition Refresh Statistics
|
||||||
ResetTransNumbers();
|
ResetTransNumbers();
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
||||||
foreach (TreeNode tn in myProcedures.Keys)
|
foreach (TreeNode tn in myProcedures.Keys)
|
||||||
if (tn.Checked)
|
if (tn.Checked)
|
||||||
@@ -604,16 +596,18 @@ namespace VEPROMS
|
|||||||
sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately.");
|
sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately.");
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?");
|
sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?");
|
||||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(0);
|
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(0)
|
||||||
frmCO.MySessionInfo = MySessionInfo;
|
{
|
||||||
frmCO.CheckedOutProcedures = pil;
|
MySessionInfo = MySessionInfo,
|
||||||
|
CheckedOutProcedures = pil
|
||||||
|
};
|
||||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||||
frmCO.Show(this);
|
frmCO.Show(this);
|
||||||
while (!this.Visible)
|
while (!Visible)
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
// B2018-002 - Invalid Transitions - Display Transition Refresh Statistic
|
// B2018-002 - Invalid Transitions - Display Transition Refresh Statistic
|
||||||
if (numTransFixed == 0 && numTransConverted == 0 && numTransCantFix == 0)
|
if (numTransFixed == 0 && numTransConverted == 0 && numTransCantFix == 0)
|
||||||
MessageBox.Show(string.Format("{0} Transitions Checked.\n\nNo Transitions Modified.", numTransProcessed), "Refresh Transitions Completed");
|
MessageBox.Show(string.Format("{0} Transitions Checked.\n\nNo Transitions Modified.", numTransProcessed), "Refresh Transitions Completed");
|
||||||
@@ -627,7 +621,7 @@ namespace VEPROMS
|
|||||||
// the next time the procedures are printed. This also forces ROs to be refreshed in the attachments
|
// the next time the procedures are printed. This also forces ROs to be refreshed in the attachments
|
||||||
private void DeletePDFs()
|
private void DeletePDFs()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Refreshing Word Attachments");
|
txtProcess.AppendText("Refreshing Word Attachments");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
@@ -645,7 +639,107 @@ namespace VEPROMS
|
|||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
|
}
|
||||||
|
|
||||||
|
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()
|
||||||
|
{
|
||||||
|
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();
|
||||||
|
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
|
// B2022-047 - refresh the Content/Text field for table, i.e. Grid, Data so that search will find text in the Grid
|
||||||
@@ -654,7 +748,7 @@ namespace VEPROMS
|
|||||||
// rerun until all tables/text fields are completed.
|
// rerun until all tables/text fields are completed.
|
||||||
private void RefreshTablesForSearch()
|
private void RefreshTablesForSearch()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Refreshing Tables for Search");
|
txtProcess.AppendText("Refreshing Tables for Search");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
@@ -681,7 +775,7 @@ namespace VEPROMS
|
|||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
private int RefreshForSearch()
|
private int RefreshForSearch()
|
||||||
{
|
{
|
||||||
@@ -722,7 +816,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
return -cntfix;
|
return -cntfix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -737,7 +831,7 @@ namespace VEPROMS
|
|||||||
// tool renamed to Remove Orphan Items
|
// tool renamed to Remove Orphan Items
|
||||||
private void PurgeDisconnectedItems()
|
private void PurgeDisconnectedItems()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Purging Orphan Items");
|
txtProcess.AppendText("Purging Orphan Items");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
@@ -779,13 +873,13 @@ namespace VEPROMS
|
|||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
// C2017-030 - new Admin Tools user interface is one of two tools run from Remove Obsolete RO Data
|
// C2017-030 - new Admin Tools user interface is one of two tools run from Remove Obsolete RO Data
|
||||||
private void RemoveUnusedRoFstsAndFigures()
|
private void RemoveUnusedRoFstsAndFigures()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Purging Unused RoFSTs and Figures Items");
|
txtProcess.AppendText("Purging Unused RoFSTs and Figures Items");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
@@ -834,14 +928,14 @@ namespace VEPROMS
|
|||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
// C2017-030 - new Admin Tools user interface
|
// C2017-030 - new Admin Tools user interface
|
||||||
// is one of two tools run from Remove Obsolete RO Data
|
// is one of two tools run from Remove Obsolete RO Data
|
||||||
private void CleanUpROAssociations()
|
private void CleanUpROAssociations()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Purging Unused Referenced Object Associations");
|
txtProcess.AppendText("Purging Unused Referenced Object Associations");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
@@ -883,14 +977,14 @@ namespace VEPROMS
|
|||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
// C2017-030 - new Admin Tools user interface
|
// C2017-030 - new Admin Tools user interface
|
||||||
// tool was renamed to Show Users
|
// tool was renamed to Show Users
|
||||||
private void GetDatabaseSessions()
|
private void GetDatabaseSessions()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Show Users in PROMS");
|
txtProcess.AppendText("Show Users in PROMS");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
@@ -902,7 +996,7 @@ namespace VEPROMS
|
|||||||
DateTime pEnd = DateTime.Now;
|
DateTime pEnd = DateTime.Now;
|
||||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
MessageBox.Show("Show Users Completed", "Show Users");
|
MessageBox.Show("Show Users Completed", "Show Users");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -934,6 +1028,9 @@ namespace VEPROMS
|
|||||||
ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst;
|
ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst;
|
||||||
string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst";
|
string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst";
|
||||||
|
|
||||||
|
//must get id before ROFST gets updated so know what to refresh later
|
||||||
|
int origfstid = roFstInfo.ROFstID;
|
||||||
|
|
||||||
//if (!pathExists(rofstPath))
|
//if (!pathExists(rofstPath))
|
||||||
if (!File.Exists(rofstPath))
|
if (!File.Exists(rofstPath))
|
||||||
{
|
{
|
||||||
@@ -941,10 +1038,10 @@ namespace VEPROMS
|
|||||||
FinalProgressBarMessage = "No existing RO.FST";
|
FinalProgressBarMessage = "No existing RO.FST";
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText("No existing ro.fst in path " + roFstInfo.MyRODb.FolderPath + ". Check for invalid path");
|
txtProcess.AppendText($"No existing ro.fst in path {roFstInfo.MyRODb.FolderPath}. Check for invalid path");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtResults.AppendText("No existing ro.fst in path " + roFstInfo.MyRODb.FolderPath + ". Check for invalid path");
|
txtResults.AppendText($"No existing ro.fst in path {roFstInfo.MyRODb.FolderPath}. Check for invalid path");
|
||||||
txtResults.AppendText(Environment.NewLine);
|
txtResults.AppendText(Environment.NewLine);
|
||||||
txtResults.AppendText(Environment.NewLine);
|
txtResults.AppendText(Environment.NewLine);
|
||||||
return;
|
return;
|
||||||
@@ -961,8 +1058,28 @@ namespace VEPROMS
|
|||||||
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
|
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
|
||||||
roFstInfo = dq.DocVersionAssociations[0].MyROFst;
|
roFstInfo = dq.DocVersionAssociations[0].MyROFst;
|
||||||
}
|
}
|
||||||
|
else if (!dv.ROfstLastCompleted && origfstid == roFstInfo.ROFstID)
|
||||||
|
{
|
||||||
|
//Handle issue where load failed without completing update
|
||||||
|
//previous RO FST did not load, get last loaded ID
|
||||||
|
//if none, use -1 which will check all ROs in the Working Draft
|
||||||
|
string cfg = dv.DocVersionAssociations[0].Config;
|
||||||
|
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg);
|
||||||
|
if (dv.DocVersionAssociations[0]?.MyROFst != null)
|
||||||
|
{
|
||||||
|
if (!int.TryParse(ac.ROUpdate_PrevROFSTID, out origfstid))
|
||||||
|
{
|
||||||
|
origfstid = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
origfstid = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||||
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, txtProcess);
|
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, txtProcess, roFstInfo, origfstid, roFstInfo.ROFstID);
|
||||||
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -998,15 +1115,12 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder myFixes;
|
StringBuilder myFixes;
|
||||||
int myFixesCount = 0;
|
|
||||||
int myConvertCount = 0;
|
|
||||||
// show the changes made in the Results pannel, include the ItemId of the step element
|
// show the changes made in the Results pannel, include the ItemId of the step element
|
||||||
void ContentInfo_StaticContentInfoChange(object sender, StaticContentInfoEventArgs args)
|
void ContentInfo_StaticContentInfoChange(object sender, StaticContentInfoEventArgs args)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (args.Type == "TX")
|
if (args.Type == "TX")
|
||||||
{
|
{
|
||||||
myFixesCount++;
|
|
||||||
if (args.NewValue.StartsWith("Reason for Change:"))
|
if (args.NewValue.StartsWith("Reason for Change:"))
|
||||||
myFixes.AppendLine(string.Format("Fixed Transition for {1}({4}){0}Old Text: {2}{0}{3}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue, (sender as ItemInfo).ItemID));
|
myFixes.AppendLine(string.Format("Fixed Transition for {1}({4}){0}Old Text: {2}{0}{3}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue, (sender as ItemInfo).ItemID));
|
||||||
else
|
else
|
||||||
@@ -1030,12 +1144,14 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private void btnSave_Click(object sender, EventArgs e)
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SaveFileDialog sfd = new SaveFileDialog();
|
SaveFileDialog sfd = new SaveFileDialog
|
||||||
sfd.DefaultExt = "txt";
|
{
|
||||||
sfd.AddExtension = true;
|
DefaultExt = "txt",
|
||||||
sfd.Filter = "Text Files (*.txt)|*.txt";
|
AddExtension = true,
|
||||||
sfd.FileName = string.Format("BatchRefreshResults_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm"));
|
Filter = "Text Files (*.txt)|*.txt",
|
||||||
sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS";
|
FileName = string.Format("BatchRefreshResults_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm")),
|
||||||
|
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS"
|
||||||
|
};
|
||||||
DialogResult dr = sfd.ShowDialog();
|
DialogResult dr = sfd.ShowDialog();
|
||||||
|
|
||||||
if (dr == DialogResult.OK)
|
if (dr == DialogResult.OK)
|
||||||
@@ -1061,7 +1177,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
|
|
||||||
//Purge Change History
|
//Purge Change History
|
||||||
string statmsg = $"Purging all Change History before {dtePurge.Value.Date.ToString("MM/dd/yyyy")}";
|
string statmsg = $"Purging all Change History before {dtePurge.Value.Date:MM/dd/yyyy}";
|
||||||
InitialProgressBarMessage = statmsg;
|
InitialProgressBarMessage = statmsg;
|
||||||
txtResults.AppendText(statmsg);
|
txtResults.AppendText(statmsg);
|
||||||
txtResults.AppendText(Environment.NewLine);
|
txtResults.AppendText(Environment.NewLine);
|
||||||
@@ -1069,7 +1185,7 @@ namespace VEPROMS
|
|||||||
Maintenance.PurgeChangeHistory(dtePurge.Value);
|
Maintenance.PurgeChangeHistory(dtePurge.Value);
|
||||||
|
|
||||||
//update status
|
//update status
|
||||||
statmsg = $"Finished Purging all Change History before {dtePurge.Value.Date.ToString("MM/dd/yyyy")}. Updating indexes to reflect cleaned data.";
|
statmsg = $"Finished Purging all Change History before {dtePurge.Value.Date:MM/dd/yyyy}. Updating indexes to reflect cleaned data.";
|
||||||
DoProgressBarRefresh(50, 100, statmsg);
|
DoProgressBarRefresh(50, 100, statmsg);
|
||||||
txtProcess.AppendText(statmsg);
|
txtProcess.AppendText(statmsg);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
@@ -1214,9 +1330,9 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
if (ProgressBar == null) return;
|
if (ProgressBar == null) return;
|
||||||
|
|
||||||
ProgressBar.Value = 100;
|
|
||||||
ProgressBar.Maximum = 100;
|
|
||||||
ProgressBar.Text = value;
|
ProgressBar.Text = value;
|
||||||
|
ProgressBar.Maximum = 100;
|
||||||
|
ProgressBar.Value = 100;
|
||||||
txtProcess.AppendText(value);
|
txtProcess.AppendText(value);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
@@ -1256,10 +1372,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// C2017-030 new Admin Tools user interface
|
// C2017-030 new Admin Tools user interface
|
||||||
private void sideNavItmExit_Click(object sender, EventArgs e)
|
private void sideNavItmExit_Click(object sender, EventArgs e) => Close();
|
||||||
{
|
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
// new Admin Tools user interface for deletes
|
// new Admin Tools user interface for deletes
|
||||||
private void sideNavItmDelete_Click(object sender, EventArgs e)
|
private void sideNavItmDelete_Click(object sender, EventArgs e)
|
||||||
@@ -1301,11 +1414,12 @@ namespace VEPROMS
|
|||||||
};
|
};
|
||||||
private E_AdminToolType AdminToolType = E_AdminToolType.Repair;
|
private E_AdminToolType AdminToolType = E_AdminToolType.Repair;
|
||||||
|
|
||||||
DevComponents.DotNetBar.StepItem siOrphDatRecs = new DevComponents.DotNetBar.StepItem("siOrphDatRecs", "Orphan Data Records");
|
readonly DevComponents.DotNetBar.StepItem siOrphDatRecs = new DevComponents.DotNetBar.StepItem("siOrphDatRecs", "Orphan Data Records");
|
||||||
DevComponents.DotNetBar.StepItem siObsoleteROData = new DevComponents.DotNetBar.StepItem("siObsoleteROData", "Obsolete RO Data");
|
readonly DevComponents.DotNetBar.StepItem siObsoleteROData = new DevComponents.DotNetBar.StepItem("siObsoleteROData", "Obsolete RO Data");
|
||||||
DevComponents.DotNetBar.StepItem siStandardHyphens = new DevComponents.DotNetBar.StepItem("siStandardHyphens", "Standardize Hyphens");
|
readonly DevComponents.DotNetBar.StepItem siStandardHyphens = new DevComponents.DotNetBar.StepItem("siStandardHyphens", "Standardize Hyphens");
|
||||||
DevComponents.DotNetBar.StepItem siRefreshAttmts = new DevComponents.DotNetBar.StepItem("siRefreshAttmts", "Refresh Word Attachments");
|
readonly 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");
|
readonly DevComponents.DotNetBar.StepItem siRegenAttmts = new DevComponents.DotNetBar.StepItem("siRegenAttmts", "Regenerate Word Attachments");
|
||||||
|
readonly 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
|
// this will update/rebuild the progress bar in the bottom panel of Admin Tools
|
||||||
private void setupProgessSteps1()
|
private void setupProgessSteps1()
|
||||||
{
|
{
|
||||||
@@ -1323,6 +1437,8 @@ namespace VEPROMS
|
|||||||
progressSteps1.Items.Add(siStandardHyphens);
|
progressSteps1.Items.Add(siStandardHyphens);
|
||||||
if (swRefreshWordAttmts.Value)
|
if (swRefreshWordAttmts.Value)
|
||||||
progressSteps1.Items.Add(siRefreshAttmts);
|
progressSteps1.Items.Add(siRefreshAttmts);
|
||||||
|
if (swRegenWordAttmts.Value)
|
||||||
|
progressSteps1.Items.Add(siRegenAttmts);
|
||||||
if (swRefreshTblsForSrch.Value)
|
if (swRefreshTblsForSrch.Value)
|
||||||
progressSteps1.Items.Add(siRefreshTblsSrchTxt);
|
progressSteps1.Items.Add(siRefreshTblsSrchTxt);
|
||||||
splitContainer3.Panel2Collapsed = false;
|
splitContainer3.Panel2Collapsed = false;
|
||||||
@@ -1356,10 +1472,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// used for all of the Switch buttons (ON/OFF buttons)
|
// used for all of the Switch buttons (ON/OFF buttons)
|
||||||
private void swCk_ValueChanged(object sender, EventArgs e)
|
private void swCk_ValueChanged(object sender, EventArgs e) => setupProgessSteps1();
|
||||||
{
|
|
||||||
setupProgessSteps1();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void swUpdateROVals_ValueChanged(object sender, EventArgs e)
|
private void swUpdateROVals_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -1385,10 +1498,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
// C2017-030 New Admin Tools user interface
|
// C2017-030 New Admin Tools user interface
|
||||||
// functions to handle the progress bar in the bottom panel of Admin Tools
|
// functions to handle the progress bar in the bottom panel of Admin Tools
|
||||||
private void StepProgress(int prgStpIdx, int val)
|
private void StepProgress(int prgStpIdx, int val) => ((DevComponents.DotNetBar.StepItem)progressSteps1.Items[prgStpIdx]).Value = val;
|
||||||
{
|
|
||||||
((DevComponents.DotNetBar.StepItem)progressSteps1.Items[prgStpIdx]).Value = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ClearStepProgress()
|
private void ClearStepProgress()
|
||||||
{
|
{
|
||||||
@@ -1487,6 +1597,12 @@ namespace VEPROMS
|
|||||||
DeletePDFs(); // refresh word attachments
|
DeletePDFs(); // refresh word attachments
|
||||||
StepProgress(prgStpIdx, 100);
|
StepProgress(prgStpIdx, 100);
|
||||||
}
|
}
|
||||||
|
if (swRegenWordAttmts.Value)
|
||||||
|
{
|
||||||
|
StepProgress(++prgStpIdx, 50);
|
||||||
|
RegenPDFs(); // generate missing pdfs
|
||||||
|
StepProgress(prgStpIdx, 100);
|
||||||
|
}
|
||||||
if (swRefreshTblsForSrch.Value)
|
if (swRefreshTblsForSrch.Value)
|
||||||
{
|
{
|
||||||
StepProgress(++prgStpIdx, 50);
|
StepProgress(++prgStpIdx, 50);
|
||||||
@@ -1539,7 +1655,7 @@ namespace VEPROMS
|
|||||||
txtResults.Clear();
|
txtResults.Clear();
|
||||||
txtProcess.Clear();
|
txtProcess.Clear();
|
||||||
|
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
|
|
||||||
//Create checked proce and doc info lists.
|
//Create checked proce and doc info lists.
|
||||||
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
||||||
@@ -1622,7 +1738,7 @@ namespace VEPROMS
|
|||||||
sb.AppendLine("If you want to delete annotations from these working drafts, please contact the respective users and have them close any procedures in the working draft.");
|
sb.AppendLine("If you want to delete annotations from these working drafts, please contact the respective users and have them close any procedures in the working draft.");
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
txtProcess.AppendText(sb.ToString());
|
txtProcess.AppendText(sb.ToString());
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1656,7 +1772,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProcessDelete(List<DocVersionInfo> foldersToDelete, List<FolderInfo> emptyFoldersToDelete)
|
private void ProcessDelete(List<DocVersionInfo> foldersToDelete, List<FolderInfo> emptyFoldersToDelete)
|
||||||
@@ -1819,12 +1935,14 @@ namespace VEPROMS
|
|||||||
private void btnROsNotUsed_Click(object sender, EventArgs e)
|
private void btnROsNotUsed_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//Get the path to save the Image to
|
//Get the path to save the Image to
|
||||||
SaveFileDialog sfd = new SaveFileDialog();
|
SaveFileDialog sfd = new SaveFileDialog
|
||||||
sfd.DefaultExt = "bmp";
|
{
|
||||||
sfd.AddExtension = true;
|
DefaultExt = "bmp",
|
||||||
sfd.Filter = "Image Files (*.bmp)|*.bmp";
|
AddExtension = true,
|
||||||
sfd.FileName = string.Format("ROsNotUsed_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm"));
|
Filter = "Image Files (*.bmp)|*.bmp",
|
||||||
sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS";
|
FileName = string.Format("ROsNotUsed_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm")),
|
||||||
|
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS"
|
||||||
|
};
|
||||||
DialogResult dr = sfd.ShowDialog();
|
DialogResult dr = sfd.ShowDialog();
|
||||||
|
|
||||||
if (dr == DialogResult.OK)
|
if (dr == DialogResult.OK)
|
||||||
|
|||||||
@@ -117,108 +117,30 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="btnPurgeChange.Tooltip" xml:space="preserve">
|
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<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">
|
|
||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</data>
|
</metadata>
|
||||||
<data name="swDeleteFolder.SuperTooltip" xml:space="preserve">
|
<data name="swRegenWordAttmts.SuperTooltip" xml:space="preserve">
|
||||||
<value>This allows the user to remove folders and sub folders as well as their 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. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time.
|
||||||
|
|
||||||
Be sure a current backup of the database exists prior performing this function.
|
|
||||||
|
|
||||||
It is recommended that this be done during off hours.
|
|
||||||
|
|
||||||
|
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>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="labelX13.SuperTooltip" xml:space="preserve">
|
<data name="labelX1.SuperTooltip" xml:space="preserve">
|
||||||
<value>This allows the user to remove folders and sub folders as well as their 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. Certain actions like loading a new RO.FST require that these PDFs be regenerated which is normally done at print time.
|
||||||
|
|
||||||
Be sure a current backup of the database exists prior performing this function.
|
|
||||||
|
|
||||||
It is recommended that this be done during off hours.
|
|
||||||
|
|
||||||
|
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>
|
</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>
|
||||||
<data name="swRefreshTblsForSrch.SuperTooltip" xml:space="preserve">
|
<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.
|
<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.
|
||||||
|
|
||||||
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>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="lblRefreshTblForSrch.SuperTooltip" xml:space="preserve">
|
<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.
|
<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.
|
||||||
|
|
||||||
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>
|
</value>
|
||||||
</data>
|
</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">
|
<data name="warningBox4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAp5JREFUOE+F
|
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>
|
Be sure a current backup exists prior to running this function!!</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="swRefreshWordAttmts.SuperTooltip" xml:space="preserve">
|
<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.
|
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>
|
</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>
|
Be sure a current backup exists prior to running this function!!</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="labelX5.SuperTooltip" xml:space="preserve">
|
<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>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="labelX9.SuperTooltip" xml:space="preserve">
|
<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.
|
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>
|
</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>
|
||||||
<data name="swCheckROLinks.SuperTooltip" xml:space="preserve">
|
<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.
|
<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=
|
ud8AKwnMnBpmYFAAAAAASUVORK5CYII=
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
<data name="swDeleteFolder.SuperTooltip" xml:space="preserve">
|
||||||
<data name="$this.TrayHeight" type="System.Int32, mscorlib">
|
<value>This allows the user to remove folders and sub folders as well as their contents.
|
||||||
<value>25</value>
|
|
||||||
|
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>
|
||||||
|
<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>
|
</root>
|
||||||
@@ -1,35 +1,18 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using LBOutlookLibrary;
|
using LBOutlookLibrary;
|
||||||
using System.Reflection;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Net.Mail;
|
|
||||||
using System.Net;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
{
|
{
|
||||||
public partial class frmBatchRefreshCheckedOut : Form
|
public partial class frmBatchRefreshCheckedOut : Form
|
||||||
{
|
{
|
||||||
private SessionInfo _MySessionInfo;
|
public SessionInfo MySessionInfo { get; set; }
|
||||||
public SessionInfo MySessionInfo
|
public List<ProcedureInfo> CheckedOutProcedures { get; set; }
|
||||||
{
|
private readonly int RType = -1; // C2023-002: Flag type of checkout, docversion -1 or procedures 0
|
||||||
get { return _MySessionInfo; }
|
|
||||||
set { _MySessionInfo = value; }
|
|
||||||
}
|
|
||||||
private List<ProcedureInfo> _CheckedOutProcedures;
|
|
||||||
public List<ProcedureInfo> CheckedOutProcedures
|
|
||||||
{
|
|
||||||
get { return _CheckedOutProcedures; }
|
|
||||||
set { _CheckedOutProcedures = value; }
|
|
||||||
}
|
|
||||||
private int RType = -1; // C2023-002: Flag type of checkout, docversion -1 or procedures 0
|
|
||||||
public frmBatchRefreshCheckedOut(int type)
|
public frmBatchRefreshCheckedOut(int type)
|
||||||
{
|
{
|
||||||
RType = type;
|
RType = type;
|
||||||
@@ -53,31 +36,38 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
private void AddToDisplayList(ProcedureInfo pi)
|
private void AddToDisplayList(ProcedureInfo pi)
|
||||||
{
|
{
|
||||||
Panel p = new Panel();
|
Panel p = new Panel
|
||||||
p.BorderStyle = BorderStyle.FixedSingle;
|
{
|
||||||
p.Dock = DockStyle.Top;
|
BorderStyle = BorderStyle.FixedSingle,
|
||||||
p.Height = 28;
|
Dock = DockStyle.Top,
|
||||||
|
Height = 28
|
||||||
|
};
|
||||||
if (RType != 1) // C2023-002: only put out ForceCheckin & sendemail buttons if on procedures (can't check in a docversion)
|
if (RType != 1) // C2023-002: only put out ForceCheckin & sendemail buttons if on procedures (can't check in a docversion)
|
||||||
{
|
{
|
||||||
Button b = new Button();
|
Button b = new Button
|
||||||
//b.FlatStyle = FlatStyle.Popup;
|
{
|
||||||
b.Dock = DockStyle.Right;
|
Dock = DockStyle.Right,
|
||||||
b.Text = "Force Check In";
|
Text = "Force Check In",
|
||||||
b.Tag = pi;
|
Tag = pi
|
||||||
|
};
|
||||||
b.Click += new EventHandler(ForceCheckIn_Click);
|
b.Click += new EventHandler(ForceCheckIn_Click);
|
||||||
p.Controls.Add(b);
|
p.Controls.Add(b);
|
||||||
b = new Button();
|
b = new Button
|
||||||
|
{
|
||||||
//b.FlatStyle = FlatStyle.Popup;
|
//b.FlatStyle = FlatStyle.Popup;
|
||||||
b.Dock = DockStyle.Right;
|
Dock = DockStyle.Right,
|
||||||
b.Text = "Send Email";
|
Text = "Send Email",
|
||||||
b.Tag = pi;
|
Tag = pi
|
||||||
|
};
|
||||||
b.Click += new EventHandler(SendEmail_Click);
|
b.Click += new EventHandler(SendEmail_Click);
|
||||||
p.Controls.Add(b);
|
p.Controls.Add(b);
|
||||||
}
|
}
|
||||||
Label l = new Label();
|
Label l = new Label
|
||||||
l.Dock = DockStyle.Fill;
|
{
|
||||||
l.TextAlign = ContentAlignment.MiddleLeft;
|
Dock = DockStyle.Fill,
|
||||||
l.Text = string.Format("Procedure {0} is checked out to {1}", pi.DisplayNumber, UserInfo.GetByUserID(OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure).SessionUserID).UserID);
|
TextAlign = ContentAlignment.MiddleLeft,
|
||||||
|
Text = $"Procedure {pi.DisplayNumber} is checked out to {UserInfo.GetByUserID(OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure).SessionUserID).UserID}"
|
||||||
|
};
|
||||||
p.Controls.Add(l);
|
p.Controls.Add(l);
|
||||||
pnlList.Controls.Add(p);
|
pnlList.Controls.Add(p);
|
||||||
p.BringToFront();
|
p.BringToFront();
|
||||||
@@ -103,15 +93,7 @@ namespace VEPROMS
|
|||||||
private string BuildEmailMessageBody(ProcedureInfo pi)
|
private string BuildEmailMessageBody(ProcedureInfo pi)
|
||||||
{
|
{
|
||||||
StringBuilder body = new StringBuilder();
|
StringBuilder body = new StringBuilder();
|
||||||
//body.AppendLine("THIS IS A TEST MESSAGE FROM JIM BODINE");
|
body.AppendLine($"The administrator needs you to check in procedure {pi.DisplayNumber} so the administrator can continue an administrative tool process");
|
||||||
//body.AppendLine();
|
|
||||||
body.AppendLine(string.Format("The administrator needs you to check in procedure {0} so the administrator can continue an administrative tool process", pi.DisplayNumber));
|
|
||||||
//body.AppendLine();
|
|
||||||
//body.AppendLine("Obviously, you do not really have this procedure checked out, so you really do not have to do anything.");
|
|
||||||
//body.AppendLine();
|
|
||||||
//body.AppendLine("However, I would appreciate it if you would reply to this email so I know the email worked");
|
|
||||||
//body.AppendLine();
|
|
||||||
//body.AppendLine("I will try NOT to overwhelm your email system :-)");
|
|
||||||
return body.ToString();
|
return body.ToString();
|
||||||
}
|
}
|
||||||
void ForceCheckIn_Click(object sender, EventArgs e)
|
void ForceCheckIn_Click(object sender, EventArgs e)
|
||||||
@@ -134,15 +116,7 @@ namespace VEPROMS
|
|||||||
private string BuildForcedMessageBody(ProcedureInfo pi)
|
private string BuildForcedMessageBody(ProcedureInfo pi)
|
||||||
{
|
{
|
||||||
StringBuilder body = new StringBuilder();
|
StringBuilder body = new StringBuilder();
|
||||||
//body.AppendLine("THIS IS A TEST MESSAGE FROM JIM BODINE");
|
body.AppendLine($"The administrator needed to force check in procedure {pi.DisplayNumber} so the administrator could continue an administrative tool process");
|
||||||
//body.AppendLine();
|
|
||||||
body.AppendLine(string.Format("The administrator needed to force check in procedure {0} so the administrator could continue an administrative tool process", pi.DisplayNumber));
|
|
||||||
//body.AppendLine();
|
|
||||||
//body.AppendLine("Obviously, you do not really have this procedure checked out, so nothing really got forced checked in.");
|
|
||||||
//body.AppendLine();
|
|
||||||
//body.AppendLine("However, I would appreciate it if you would reply to this email so I know the email worked");
|
|
||||||
//body.AppendLine();
|
|
||||||
//body.AppendLine("I will try NOT to overwhelm your email system :-)");
|
|
||||||
return body.ToString();
|
return body.ToString();
|
||||||
}
|
}
|
||||||
private bool SendOutlookEmail(string email, string subject, string body)
|
private bool SendOutlookEmail(string email, string subject, string body)
|
||||||
@@ -163,7 +137,7 @@ namespace VEPROMS
|
|||||||
if (ex.Message.ToLower().Contains("failed due to the following error: 80080005"))
|
if (ex.Message.ToLower().Contains("failed due to the following error: 80080005"))
|
||||||
MessageBox.Show("You cannot send email via a running instance of Outlook from VE PROMS running from within Visual Studio.");
|
MessageBox.Show("You cannot send email via a running instance of Outlook from VE PROMS running from within Visual Studio.");
|
||||||
else
|
else
|
||||||
MessageBox.Show(string.Format("{0} - {1}", ex.GetType().Name, ex.Message));
|
MessageBox.Show($"{ex.GetType().Name} - {ex.Message}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -180,7 +154,7 @@ namespace VEPROMS
|
|||||||
CheckedOutProcedures = tmp;
|
CheckedOutProcedures = tmp;
|
||||||
if (CheckedOutProcedures.Count == 0)
|
if (CheckedOutProcedures.Count == 0)
|
||||||
{
|
{
|
||||||
this.Close();
|
Close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
foreach (ProcedureInfo pi in CheckedOutProcedures)
|
foreach (ProcedureInfo pi in CheckedOutProcedures)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using System.IO;
|
|
||||||
using Volian.Controls.Library;
|
using Volian.Controls.Library;
|
||||||
using DevComponents.DotNetBar;
|
using DevComponents.DotNetBar;
|
||||||
using JR.Utils.GUI.Forms;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using xls = Microsoft.Office.Interop.Excel;
|
using xls = Microsoft.Office.Interop.Excel;
|
||||||
|
|
||||||
@@ -16,52 +11,42 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
public partial class frmGenTools : Form
|
public partial class frmGenTools : Form
|
||||||
{
|
{
|
||||||
private SessionInfo _MySessionInfo;
|
public SessionInfo MySessionInfo { get; set; }
|
||||||
public SessionInfo MySessionInfo
|
|
||||||
{
|
|
||||||
get { return _MySessionInfo; }
|
|
||||||
set { _MySessionInfo = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping veProms for potential future use")]
|
||||||
public frmGenTools(SessionInfo sessionInfo, frmVEPROMS veProms)
|
public frmGenTools(SessionInfo sessionInfo, frmVEPROMS veProms)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_MySessionInfo = sessionInfo;
|
MySessionInfo = sessionInfo;
|
||||||
|
|
||||||
// When opening General tools Check tab will be default.
|
// When opening General tools Check tab will be default.
|
||||||
this.sideNavItmCheck.Checked = true;
|
sideNavItmCheck.Checked = true;
|
||||||
|
|
||||||
setupProgessSteps1(); // C2017-030 - new Tools user interface
|
setupProgessSteps1(); // C2017-030 - new Tools user interface
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void frmGenTools_Load(object sender, EventArgs e)
|
private void frmGenTools_Load(object sender, EventArgs e) => IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||||
{
|
|
||||||
IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
|
||||||
}
|
|
||||||
private bool IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
private bool IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||||
private void frmGenTools_FormClosing(object sender, EventArgs e)
|
private void frmGenTools_FormClosing(object sender, EventArgs e) => IsClosing = true;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||||
{
|
|
||||||
IsClosing = true;//B2017-221 Allow the batch dialog to close when waiting to process.
|
|
||||||
}
|
|
||||||
|
|
||||||
// C2017-030 - new Tools user interface
|
// C2017-030 - new Tools user interface
|
||||||
// tool renamed to Identify Orphan Items
|
// tool renamed to Identify Orphan Items
|
||||||
private void IdentifyDisconnectedItems()
|
private void IdentifyDisconnectedItems()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Identifing Orphan Items");
|
txtProcess.AppendText("Identifing Orphan Items");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
int rowCount = ESP_IdentifyDisconnectedItems.Execute("vesp_GetDisconnectedItemsCount");
|
int rowCount = ESP_IdentifyDisconnectedItems.Execute("vesp_GetDisconnectedItemsCount");
|
||||||
txtProcess.AppendText(string.Format("Orphan Items Count: {0}", rowCount));
|
txtProcess.AppendText($"Orphan Items Count: {rowCount}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
if (rowCount > 0)
|
if (rowCount > 0)
|
||||||
{
|
{
|
||||||
txtResults.AppendText(string.Format("The database contains {0} Orphan items.", rowCount));
|
txtResults.AppendText($"The database contains {rowCount} Orphan items.");
|
||||||
txtResults.AppendText(Environment.NewLine);
|
txtResults.AppendText(Environment.NewLine);
|
||||||
txtResults.AppendText("These can be removed via the Remove Orphan Data Records in the Repair tools");
|
txtResults.AppendText("These can be removed via the Remove Orphan Data Records in the Repair tools");
|
||||||
txtResults.AppendText(Environment.NewLine);
|
txtResults.AppendText(Environment.NewLine);
|
||||||
@@ -74,33 +59,33 @@ namespace VEPROMS
|
|||||||
txtResults.AppendText(Environment.NewLine);
|
txtResults.AppendText(Environment.NewLine);
|
||||||
}
|
}
|
||||||
DateTime pEnd = DateTime.Now;
|
DateTime pEnd = DateTime.Now;
|
||||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Completed: {pEnd:MM/dd/yyyy @ HH:mm}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
// C2017-030 - new Tools user interface
|
// C2017-030 - new Tools user interface
|
||||||
// is one of two tools run from Check Obsolete RO Data
|
// is one of two tools run from Check Obsolete RO Data
|
||||||
private void IdentifyUnusedRoFstsAndFigures()
|
private void IdentifyUnusedRoFstsAndFigures()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Identifing Unused RoFsts and Figures");
|
txtProcess.AppendText("Identifing Unused RoFsts and Figures");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
int rowCountRoFst = ESP_GetUnusedRoFsts.Execute("vesp_GetUnusedRoFstsCount");
|
int rowCountRoFst = ESP_GetUnusedRoFsts.Execute("vesp_GetUnusedRoFstsCount");
|
||||||
int rowCountFigures = ESP_GetUnusedFigures.Execute("vesp_GetUnusedFiguresCount");
|
int rowCountFigures = ESP_GetUnusedFigures.Execute("vesp_GetUnusedFiguresCount");
|
||||||
txtProcess.AppendText(string.Format("Unused RoFsts Count: {0}, Unused Figures Count: {1}", rowCountRoFst, rowCountFigures));
|
txtProcess.AppendText($"Unused RoFsts Count: {rowCountRoFst}, Unused Figures Count: {rowCountFigures}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
if (rowCountRoFst > 0 || rowCountFigures > 0)
|
if (rowCountRoFst > 0 || rowCountFigures > 0)
|
||||||
{
|
{
|
||||||
txtResults.AppendText(string.Format("The database contains {0} unused RoFsts.", rowCountRoFst));
|
txtResults.AppendText($"The database contains {rowCountRoFst} unused RoFsts.");
|
||||||
txtResults.AppendText(Environment.NewLine);
|
txtResults.AppendText(Environment.NewLine);
|
||||||
txtResults.AppendText(string.Format("The database contains {0} unused Figures items.", rowCountFigures));
|
txtResults.AppendText($"The database contains {rowCountFigures} unused Figures items.");
|
||||||
txtResults.AppendText(Environment.NewLine);
|
txtResults.AppendText(Environment.NewLine);
|
||||||
txtResults.AppendText(Environment.NewLine);
|
txtResults.AppendText(Environment.NewLine);
|
||||||
}
|
}
|
||||||
@@ -112,31 +97,31 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
|
|
||||||
DateTime pEnd = DateTime.Now;
|
DateTime pEnd = DateTime.Now;
|
||||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Completed: {pEnd:MM/dd/yyyy @ HH:mm}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
// C2017-030 - new Tools user interface
|
// C2017-030 - new Tools user interface
|
||||||
// is one of two tools run from Check Obsolete RO Data
|
// is one of two tools run from Check Obsolete RO Data
|
||||||
private void IdentifyROAssociations()
|
private void IdentifyROAssociations()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Identifing Unused RO Associations");
|
txtProcess.AppendText("Identifing Unused RO Associations");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
int rowCount = ESP_GetROAssoc.Execute("vesp_GetUnusedROAssociationsCount");
|
int rowCount = ESP_GetROAssoc.Execute("vesp_GetUnusedROAssociationsCount");
|
||||||
txtProcess.AppendText(string.Format("Unused RO Associations Count: {0}", rowCount));
|
txtProcess.AppendText($"Unused RO Associations Count: {rowCount}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
if (rowCount > 0)
|
if (rowCount > 0)
|
||||||
{
|
{
|
||||||
txtResults.AppendText(string.Format("The database contains {0} unused RO Associations.", rowCount));
|
txtResults.AppendText($"The database contains {rowCount} unused RO Associations.");
|
||||||
txtResults.AppendText(Environment.NewLine);
|
txtResults.AppendText(Environment.NewLine);
|
||||||
txtResults.AppendText(Environment.NewLine);
|
txtResults.AppendText(Environment.NewLine);
|
||||||
}
|
}
|
||||||
@@ -147,26 +132,26 @@ namespace VEPROMS
|
|||||||
txtResults.AppendText(Environment.NewLine);
|
txtResults.AppendText(Environment.NewLine);
|
||||||
}
|
}
|
||||||
DateTime pEnd = DateTime.Now;
|
DateTime pEnd = DateTime.Now;
|
||||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Completed: {pEnd:MM/dd/yyyy @ HH:mm}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
// C2017-030 - new Tools user interface
|
// C2017-030 - new Tools user interface
|
||||||
// tool was renamed to Hidden Data Locations (on Check list)
|
// tool was renamed to Hidden Data Locations (on Check list)
|
||||||
private void IdentifyNonEditableItems()
|
private void IdentifyNonEditableItems()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Identifing Hidden Item Locations");
|
txtProcess.AppendText("Identifing Hidden Item Locations");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
List<ItemInfo> myItems = ESP_IdentifyNonEditableItems.Execute("vesp_GetNonEditableItems");
|
List<ItemInfo> myItems = ESP_IdentifyNonEditableItems.Execute("vesp_GetNonEditableItems");
|
||||||
txtProcess.AppendText(string.Format("Hidden Items Count: {0}", myItems.Count));
|
txtProcess.AppendText($"Hidden Items Count: {myItems.Count}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
if (myItems.Count > 0)
|
if (myItems.Count > 0)
|
||||||
{
|
{
|
||||||
@@ -190,51 +175,45 @@ namespace VEPROMS
|
|||||||
//clear the list since no longer using it
|
//clear the list since no longer using it
|
||||||
myItems.Clear();
|
myItems.Clear();
|
||||||
DateTime pEnd = DateTime.Now;
|
DateTime pEnd = DateTime.Now;
|
||||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Completed: {pEnd:MM/dd/yyyy @ HH:mm}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
// C2017-030 - new Tools user interface
|
// C2017-030 - new Tools user interface
|
||||||
// tool was renamed to Show Users
|
// tool was renamed to Show Users
|
||||||
private void GetDatabaseSessions()
|
private void GetDatabaseSessions()
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Show Users in PROMS");
|
txtProcess.AppendText("Show Users in PROMS");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
txtResults.Clear();
|
txtResults.Clear();
|
||||||
txtResults.AppendText(ESP_GetDatabaseSessions.Execute("vesp_GetDatabaseSessions"));
|
txtResults.AppendText(ESP_GetDatabaseSessions.Execute("vesp_GetDatabaseSessions"));
|
||||||
DateTime pEnd = DateTime.Now;
|
DateTime pEnd = DateTime.Now;
|
||||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Completed: {pEnd:MM/dd/yyyy @ HH:mm}");
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
MessageBox.Show("Show Users Completed", "Show Users");
|
MessageBox.Show("Show Users Completed", "Show Users");
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<string> roFstInfo_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args)
|
private void btnClear_Click(object sender, EventArgs e) => txtResults.Clear();
|
||||||
{
|
|
||||||
return VlnFlexGrid.ROTableUpdate(sender, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnClear_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
txtResults.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnSave_Click(object sender, EventArgs e)
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
SaveFileDialog sfd = new SaveFileDialog();
|
SaveFileDialog sfd = new SaveFileDialog
|
||||||
sfd.DefaultExt = "txt";
|
{
|
||||||
sfd.AddExtension = true;
|
DefaultExt = "txt",
|
||||||
sfd.Filter = "Text Files (*.txt)|*.txt";
|
AddExtension = true,
|
||||||
sfd.FileName = string.Format("BatchRefreshResults_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm"));
|
Filter = "Text Files (*.txt)|*.txt",
|
||||||
sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS";
|
FileName = $"BatchRefreshResults_{DateTime.Now:yyyyMMdd_HHmm}",
|
||||||
|
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS"
|
||||||
|
};
|
||||||
DialogResult dr = sfd.ShowDialog();
|
DialogResult dr = sfd.ShowDialog();
|
||||||
|
|
||||||
if (dr == DialogResult.OK)
|
if (dr == DialogResult.OK)
|
||||||
@@ -257,10 +236,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void chkLater_CheckedChanged(object sender, EventArgs e)
|
private void chkLater_CheckedChanged(object sender, EventArgs e) => pnlLater.Enabled = chkLater.Checked;
|
||||||
{
|
|
||||||
pnlLater.Enabled = chkLater.Checked;
|
|
||||||
}
|
|
||||||
|
|
||||||
// C2017-030 new Tools user interface
|
// C2017-030 new Tools user interface
|
||||||
private void sideNavItmCheck_Click(object sender, EventArgs e)
|
private void sideNavItmCheck_Click(object sender, EventArgs e)
|
||||||
@@ -285,10 +261,7 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// C2017-030 new Tools user interface
|
// C2017-030 new Tools user interface
|
||||||
private void sideNavItmExit_Click(object sender, EventArgs e)
|
private void sideNavItmExit_Click(object sender, EventArgs e) => Close();
|
||||||
{
|
|
||||||
this.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
#region On/Off Swiches
|
#region On/Off Swiches
|
||||||
|
|
||||||
@@ -301,9 +274,9 @@ namespace VEPROMS
|
|||||||
};
|
};
|
||||||
private E_GenToolType GenToolType = 0;
|
private E_GenToolType GenToolType = 0;
|
||||||
|
|
||||||
DevComponents.DotNetBar.StepItem siOrphDatRecs = new DevComponents.DotNetBar.StepItem("siOrphDatRecs", "Orphan Data Records");
|
readonly DevComponents.DotNetBar.StepItem siOrphDatRecs = new DevComponents.DotNetBar.StepItem("siOrphDatRecs", "Orphan Data Records");
|
||||||
DevComponents.DotNetBar.StepItem siHiddenDataLocs = new DevComponents.DotNetBar.StepItem("siHiddenDataLocs", "Hidden Data");
|
readonly DevComponents.DotNetBar.StepItem siHiddenDataLocs = new DevComponents.DotNetBar.StepItem("siHiddenDataLocs", "Hidden Data");
|
||||||
DevComponents.DotNetBar.StepItem siObsoleteROData = new DevComponents.DotNetBar.StepItem("siObsoleteROData", "Obsolete RO Data");
|
readonly DevComponents.DotNetBar.StepItem siObsoleteROData = new DevComponents.DotNetBar.StepItem("siObsoleteROData", "Obsolete RO Data");
|
||||||
|
|
||||||
// this will update/rebuild the progress bar in the bottom panel of Tools
|
// this will update/rebuild the progress bar in the bottom panel of Tools
|
||||||
private void setupProgessSteps1()
|
private void setupProgessSteps1()
|
||||||
@@ -333,19 +306,13 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
|
|
||||||
// used for all of the Switch buttons (ON/OFF buttons)
|
// used for all of the Switch buttons (ON/OFF buttons)
|
||||||
private void swCk_ValueChanged(object sender, EventArgs e)
|
private void swCk_ValueChanged(object sender, EventArgs e) => setupProgessSteps1();
|
||||||
{
|
|
||||||
setupProgessSteps1();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
// C2017-030 New Tools user interface
|
// C2017-030 New Tools user interface
|
||||||
// functions to handle the progress bar in the bottom panel of Tools
|
// functions to handle the progress bar in the bottom panel of Tools
|
||||||
private void StepProgress(int prgStpIdx, int val)
|
private void StepProgress(int prgStpIdx, int val) => ((DevComponents.DotNetBar.StepItem)progressSteps1.Items[prgStpIdx]).Value = val;
|
||||||
{
|
|
||||||
((DevComponents.DotNetBar.StepItem)progressSteps1.Items[prgStpIdx]).Value = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ClearStepProgress()
|
private void ClearStepProgress()
|
||||||
{
|
{
|
||||||
@@ -362,7 +329,7 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
if (chkLater.Checked)
|
if (chkLater.Checked)
|
||||||
{
|
{
|
||||||
long later = long.Parse(dtpDate.Value.ToString("yyyyMMdd") + dtpTime.Value.ToString("HHmm"));
|
long later = long.Parse($"{dtpDate.Value:yyyyMMdd}{dtpTime.Value:HHmm}");
|
||||||
long now = long.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
|
long now = long.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
|
||||||
|
|
||||||
while (now < later)
|
while (now < later)
|
||||||
@@ -435,9 +402,11 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(UACfilename))
|
if (string.IsNullOrEmpty(UACfilename))
|
||||||
{
|
{
|
||||||
SaveFileDialog sfd = new SaveFileDialog();
|
SaveFileDialog sfd = new SaveFileDialog
|
||||||
sfd.Filter = "Excel XLS (*.xlsx)|*.xlsx";
|
{
|
||||||
sfd.FileName = "UACReport.xlsx";
|
Filter = "Excel XLS (*.xlsx)|*.xlsx",
|
||||||
|
FileName = "UACReport.xlsx"
|
||||||
|
};
|
||||||
if (sfd.ShowDialog() == DialogResult.OK)
|
if (sfd.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
UACfilename = sfd.FileName;
|
UACfilename = sfd.FileName;
|
||||||
@@ -462,11 +431,11 @@ namespace VEPROMS
|
|||||||
//Get Datatable of results then loop through outputting into excel
|
//Get Datatable of results then loop through outputting into excel
|
||||||
private void Generate_UAC_Report(string filename)
|
private void Generate_UAC_Report(string filename)
|
||||||
{
|
{
|
||||||
this.Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText("Generate User Access Control Report in PROMS");
|
txtProcess.AppendText("Generate User Access Control Report in PROMS");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
txtResults.Clear();
|
txtResults.Clear();
|
||||||
@@ -525,9 +494,9 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
|
|
||||||
DateTime pEnd = DateTime.Now;
|
DateTime pEnd = DateTime.Now;
|
||||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
txtProcess.AppendText($"Completed: {pEnd:MM/dd/yyyy @ HH:mm}");
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
this.Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
MessageBox.Show("Generate User Access Control Report Completed", "User Access Control Report");
|
MessageBox.Show("Generate User Access Control Report Completed", "User Access Control Report");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -544,7 +513,7 @@ namespace VEPROMS
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
obj = null;
|
obj = null;
|
||||||
MessageBox.Show("Exception Occurred while releasing object " + ex.ToString());
|
MessageBox.Show($"Exception Occurred while releasing object {ex}");
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@@ -553,17 +522,10 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
|
|
||||||
//C2025-011 RO Update Tool Memory Enhancements
|
//C2025-011 RO Update Tool Memory Enhancements
|
||||||
private void txtProcess_TextChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
//clears the stack to help with memory - should never need to undo text changes to this.
|
//clears the stack to help with memory - should never need to undo text changes to this.
|
||||||
txtProcess.ClearUndo();
|
private void txtProcess_TextChanged(object sender, EventArgs e) => txtProcess.ClearUndo();
|
||||||
}
|
|
||||||
|
|
||||||
private void txtResults_TextChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
//clears the stack to help with memory - should never need to undo text changes to this.
|
//clears the stack to help with memory - should never need to undo text changes to this.
|
||||||
txtResults.ClearUndo();
|
private void txtResults_TextChanged(object sender, EventArgs e) => txtResults.ClearUndo();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user