Compare commits
304
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 | ||
|
|
ed615dbb31 | ||
|
|
e9ad57f588 | ||
|
|
7fee639b53 | ||
|
|
c2a5a8ec7d | ||
|
|
ec823cab97 | ||
|
|
83f88b6df3 | ||
|
|
7636fe7686 | ||
|
|
1e12c82be4 | ||
|
|
9879a80569 | ||
|
|
13b03f4f89 | ||
|
|
331de6ecfe | ||
|
|
7b649c4a62 | ||
|
|
9ccdaef354 | ||
|
|
fa114f4467 | ||
|
|
33cc650871 | ||
|
|
95737d05e1 | ||
|
|
955ffc48d3 | ||
|
|
d79dd908f6 | ||
|
|
4656ec30af | ||
|
|
a0be60a1b9 | ||
|
|
d296d6f000 | ||
|
|
8df4bd2537 | ||
|
|
cc5cdb88ff | ||
|
|
f66c6a93c5 | ||
|
|
a7b5ee33e2 | ||
|
|
fe90af5aa4 | ||
|
|
7e672d91e9 | ||
|
|
09f472bee2 | ||
|
|
30da0c5105 | ||
|
|
d2082cdbea | ||
|
|
c42596811e | ||
|
|
d095a19187 | ||
|
|
8089e2c898 | ||
|
|
a657d03fb0 | ||
|
|
4e829200f5 | ||
|
|
bef9be5cbe | ||
|
|
56f14323d1 | ||
|
|
4fcd22ca68 | ||
|
|
21890e74fe | ||
|
|
ef32564fba | ||
|
|
d95505726f | ||
|
|
bb7b892f7c | ||
|
|
836cdaf087 | ||
|
|
6f5c41abb8 | ||
|
|
6379321785 | ||
|
|
e4c6e4393e | ||
|
|
3e6bb81e39 | ||
|
|
ded6f18dd5 | ||
|
|
81643e2aef | ||
|
|
8a186f9f0c | ||
|
|
14aa39976a | ||
|
|
c077e0ddc2 | ||
|
|
d198a7b63a | ||
|
|
7f36a33dea | ||
|
|
db3d9fc65f | ||
|
|
f9738451db | ||
|
|
ec73b5cbea | ||
|
|
f3bd6b6469 | ||
|
|
fd50993fb9 | ||
|
|
079381dbb0 | ||
|
|
85bdc35342 | ||
|
|
2aaaa55e42 | ||
|
|
e999bea228 | ||
|
|
287c06383b | ||
|
|
202409c140 | ||
|
|
34886beccb | ||
|
|
3d200cc34e | ||
|
|
b13883530a | ||
|
|
032e04bc50 | ||
|
|
625b715832 | ||
|
|
e1ac360271 | ||
|
|
7eda88bdbe | ||
|
|
90fdb94e95 | ||
|
|
15979203ce | ||
|
|
53360a03af | ||
|
|
9f6f7c23f6 | ||
|
|
7419f4e886 | ||
|
|
f90a80c366 | ||
|
|
d9ec756e22 | ||
|
|
9f7c24c540 | ||
|
|
fe2833395d | ||
|
|
a181cf3815 | ||
|
|
dfce44a47a | ||
|
|
22280bf1e3 | ||
|
|
30aedb6eec | ||
|
|
12f175740f | ||
|
|
5c0f11aea1 | ||
|
|
879518c4a9 | ||
|
|
7afca6a254 | ||
|
|
1c56aa2eb1 | ||
|
|
ecaf00c5b3 | ||
|
|
bfdc77da97 | ||
|
|
f38aa4595f | ||
|
|
aa0b906a9f |
@@ -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)
|
if(dtMax < dt) dtMax = dt;
|
||||||
//{
|
|
||||||
//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;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
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)
|
if(dtChild > dtMax) dtMax = dtChild;
|
||||||
//{
|
|
||||||
//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(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
|
||||||
|
|||||||
+221
-266
@@ -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,13 +70,8 @@ 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
|
private LastWas myLast = LastWas.Search;
|
||||||
{
|
|
||||||
get { return _MyIgnore; }
|
|
||||||
set { _MyIgnore = value; }
|
|
||||||
}
|
|
||||||
private LastWas myLast = LastWas.Search;
|
|
||||||
private Settings MySettings;
|
private Settings MySettings;
|
||||||
public string MyStatus
|
public string MyStatus
|
||||||
{
|
{
|
||||||
@@ -151,9 +143,11 @@ 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>();
|
{
|
||||||
splitContainer1.SplitterDistance = Properties.Settings.Default.Split1;
|
IgnoreLines = new BindingList<string>()
|
||||||
|
};
|
||||||
|
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;
|
||||||
if (Properties.Settings.Default.MRU1 != null && Properties.Settings.Default.MRU1.Count > 0)
|
if (Properties.Settings.Default.MRU1 != null && Properties.Settings.Default.MRU1.Count > 0)
|
||||||
@@ -240,28 +234,27 @@ 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)
|
{
|
||||||
{
|
case LastWas.Pagination:
|
||||||
case LastWas.Pagination:
|
CompareContent(ff.File1, ff.File2);// Compare DebugPagination
|
||||||
CompareContent(ff.File1, ff.File2);// Compare DebugPagination
|
break;
|
||||||
break;
|
case LastWas.Baseline:
|
||||||
case LastWas.Baseline:
|
CompareContent3(ff.File1, ff.File2);// Compare DebugMeta
|
||||||
CompareContent3(ff.File1, ff.File2);// Compare DebugMeta
|
break;
|
||||||
break;
|
case LastWas.Search:
|
||||||
case LastWas.Search:
|
ShowSearchResults(ff.File1, ff.File2);// Perform search on DebugMeta
|
||||||
ShowSearchResults(ff.File1, ff.File2);// Perform search on DebugMeta
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
CompareContent(ff.File1, ff.File2);//Default DebugPagination
|
||||||
CompareContent(ff.File1, ff.File2);//Default DebugPagination
|
break;
|
||||||
break;
|
}
|
||||||
}
|
//CompareOneFile(ff.File1, ff.File2);
|
||||||
//CompareOneFile(ff.File1, ff.File2);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Procedures MyProcs1;
|
Procedures MyProcs1;
|
||||||
Procedures MyProcs2;
|
Procedures MyProcs2;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -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.
|
||||||
|
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.
|
// 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 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
|
||||||
exePath = TryToGetPath(p);
|
{
|
||||||
p.Kill(); // No need to keep it open
|
System.Diagnostics.Process p = System.Diagnostics.Process.Start(PDFfileName1);
|
||||||
|
exePath = TryToGetPath(p);
|
||||||
|
p.Kill(); // No need to keep it open
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Application.DoEvents();
|
||||||
|
string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||||
|
Console.WriteLine(msg);
|
||||||
|
MessageBox.Show(msg, "Error opening default PDF Viewer");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open the first PDF on a Specific Page
|
// 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,9 +616,11 @@ namespace Baseline
|
|||||||
{
|
{
|
||||||
if (queueTimer == null)
|
if (queueTimer == null)
|
||||||
{
|
{
|
||||||
queueTimer = new Timer();
|
queueTimer = new Timer
|
||||||
queueTimer.Enabled = false;
|
{
|
||||||
queueTimer.Tick += queueTimer_Tick;
|
Enabled = false
|
||||||
|
};
|
||||||
|
queueTimer.Tick += queueTimer_Tick;
|
||||||
queueTimer.Interval = 1000;
|
queueTimer.Interval = 1000;
|
||||||
}
|
}
|
||||||
myQueue.Add(proc, x, y);
|
myQueue.Add(proc, x, y);
|
||||||
@@ -594,41 +645,55 @@ 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)
|
||||||
|
{
|
||||||
|
FileInfo fi1 = new FileInfo(ff.File1);
|
||||||
|
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)
|
if (exePath == null)
|
||||||
{
|
{
|
||||||
System.Diagnostics.Process p = System.Diagnostics.Process.Start(fi1.DirectoryName + "\\" + proc + ".pdf");
|
try
|
||||||
while (exePath == null)
|
|
||||||
{
|
{
|
||||||
try
|
System.Diagnostics.Process tp = System.Diagnostics.Process.Start(PDFfileName);
|
||||||
{
|
exePath = TryToGetPath(tp);
|
||||||
|
tp.Kill();
|
||||||
exePath = p.MainModule.FileName;
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
catch (Exception ex)
|
{
|
||||||
{
|
Application.DoEvents();
|
||||||
Application.DoEvents();
|
string msg = string.Format("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||||
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
Console.WriteLine(msg);
|
||||||
}
|
MessageBox.Show(msg, "Error opening default PDF Viewer");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
p.Kill();
|
|
||||||
}
|
}
|
||||||
if (list == 1)
|
// 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))
|
||||||
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", pagenum) + fi1.DirectoryName + "\\" + proc + ".pdf ");
|
{
|
||||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
|
UseShellExecute = false
|
||||||
}
|
};
|
||||||
else
|
_ = System.Diagnostics.Process.Start(psi1);
|
||||||
{
|
}
|
||||||
System.Diagnostics.ProcessStartInfo psi2 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A page={0} ", pagenum) + fi2.DirectoryName + "\\" + proc + ".pdf ");
|
|
||||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Perform Debug Meta file comparison for all of the folders within the automated testing folders
|
/// Perform Debug Meta file comparison for all of the folders within the automated testing folders
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -708,12 +773,12 @@ namespace Baseline
|
|||||||
}
|
}
|
||||||
private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e)
|
private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//Initialize Results List Box
|
//Initialize Results List Box
|
||||||
lbResults1.Items.Clear();
|
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,28 +823,13 @@ 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; }
|
||||||
{
|
public FindFile(string file1, string file2)
|
||||||
get { return _File1; }
|
|
||||||
set { _File1 = value; }
|
|
||||||
}
|
|
||||||
private string _File2;
|
|
||||||
public string File2
|
|
||||||
{
|
|
||||||
get { return _File2; }
|
|
||||||
set { _File2 = value; }
|
|
||||||
}
|
|
||||||
public FindFile(string file1, string file2)
|
|
||||||
{
|
{
|
||||||
File1 = file1;
|
File1 = file1;
|
||||||
File2 = file2;
|
File2 = file2;
|
||||||
@@ -787,19 +837,16 @@ 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;
|
||||||
{
|
/// <summary>
|
||||||
get { return _FileName; }
|
/// Build list of DocVersion Folders with differences
|
||||||
}
|
/// </summary>
|
||||||
/// <summary>
|
/// <param name="path1">Base path</param>
|
||||||
/// Build list of DocVersion Folders with differences
|
/// <param name="path2">Compare path</param>
|
||||||
/// </summary>
|
/// <param name="fileName">filename</param>
|
||||||
/// <param name="path1">Base path</param>
|
/// <param name="myIgnore">Ignore list</param>
|
||||||
/// <param name="path2">Compare path</param>
|
public FindFiles(string path1, string path2, string fileName,IgnoreLines myIgnore)
|
||||||
/// <param name="fileName">filename</param>
|
|
||||||
/// <param name="myIgnore">Ignore list</param>
|
|
||||||
public FindFiles(string path1, string path2, string fileName,IgnoreLines myIgnore)
|
|
||||||
{
|
{
|
||||||
DirectoryInfo di1 = new DirectoryInfo(path1);
|
DirectoryInfo di1 = new DirectoryInfo(path1);
|
||||||
DirectoryInfo di2 = new DirectoryInfo(path2);
|
DirectoryInfo di2 = new DirectoryInfo(path2);
|
||||||
@@ -1025,34 +1072,16 @@ 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();
|
||||||
|
public Procedure(string number, string title)
|
||||||
{
|
{
|
||||||
get { return _Number; }
|
Number = number;
|
||||||
set { _Number = value; }
|
Title = title;
|
||||||
}
|
}
|
||||||
private string _Title;
|
public override string ToString() => string.Format("{0} - {1}", Number, 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)
|
|
||||||
{
|
|
||||||
_Number = number;
|
|
||||||
_Title = title;
|
|
||||||
}
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return string.Format("{0} - {1}", Number, Title);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public partial class Procedures : List<Procedure>
|
public partial class Procedures : List<Procedure>
|
||||||
{
|
{
|
||||||
// Sample data for a Procedure Number line
|
// Sample data for a Procedure Number line
|
||||||
@@ -1083,77 +1112,34 @@ 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; }
|
||||||
|
public Line(string text) => Text = text;
|
||||||
|
public Line(string text, Procedure myProc, Page myPage)
|
||||||
{
|
{
|
||||||
get { return _MyProc; }
|
Text = text;
|
||||||
set { _MyProc = value; }
|
MyProc = myProc;
|
||||||
|
MyPage = myPage;
|
||||||
}
|
}
|
||||||
private Page _MyPage;
|
public override string ToString() => Text;
|
||||||
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)
|
|
||||||
{
|
|
||||||
_Text = text;
|
|
||||||
_MyProc = myProc;
|
|
||||||
_MyPage = myPage;
|
|
||||||
}
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return 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,21 +1177,12 @@ 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));
|
||||||
{
|
// Convert IgnoreLines to string (XML)
|
||||||
Add(new IgnoreLine(text, searchType, active));
|
public override string ToString() => GenericSerializer<IgnoreLines>.StringSerialize(this);
|
||||||
}
|
// Convert string to IgnoreLines
|
||||||
// Convert IgnoreLines to string (XML)
|
public static IgnoreLines Get(string xml) => GenericSerializer<IgnoreLines>.StringDeserialize(xml);
|
||||||
public override string ToString()
|
}
|
||||||
{
|
|
||||||
return GenericSerializer<IgnoreLines>.StringSerialize(this);
|
|
||||||
}
|
|
||||||
// Convert string to IgnoreLines
|
|
||||||
public static IgnoreLines Get(string 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)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -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);
|
||||||
@@ -1247,12 +1224,9 @@ namespace Baseline
|
|||||||
public class NonXsiTextWriter : XmlTextWriter
|
public class NonXsiTextWriter : XmlTextWriter
|
||||||
{
|
{
|
||||||
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;
|
||||||
{
|
public NonXsiTextWriter(string filename, Encoding encoding) : base(filename, encoding) { }
|
||||||
this.Formatting = Formatting.Indented;
|
|
||||||
}
|
|
||||||
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; }
|
||||||
{
|
public ProcessLocation(System.Diagnostics.Process process, int x, int y)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
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,11 +1298,8 @@ 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));
|
||||||
{
|
public void ProcessNext()
|
||||||
Enqueue(new ProcessLocation(process,x,y));
|
|
||||||
}
|
|
||||||
public void ProcessNext()
|
|
||||||
{
|
{
|
||||||
ProcessLocation pl = Dequeue();
|
ProcessLocation pl = Dequeue();
|
||||||
pl.MoveIt();
|
pl.MoveIt();
|
||||||
|
|||||||
@@ -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");
|
||||||
|
private void btnOK_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Here");
|
DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||||
}
|
Close();
|
||||||
private void btnOK_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
this.DialogResult = System.Windows.Forms.DialogResult.OK;
|
|
||||||
this.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,30 +137,21 @@ 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);
|
||||||
{
|
#endregion
|
||||||
if (this.ValueChanged != null)
|
#region Public Properties
|
||||||
{
|
/// <summary>
|
||||||
this.ValueChanged(this, e);
|
/// Get or set the control (has to implement IDropDownAware) that is to
|
||||||
}
|
/// be displayed as the dropdown portion of the combobox.
|
||||||
}
|
/// </summary>
|
||||||
#endregion
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
#region Public Properties
|
|
||||||
/// <summary>
|
|
||||||
/// Get or set the control (has to implement IDropDownAware) that is to
|
|
||||||
/// be displayed as the dropdown portion of the combobox.
|
|
||||||
/// </summary>
|
|
||||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
|
||||||
public IDropDownAware DropDownControl
|
public IDropDownAware DropDownControl
|
||||||
{
|
{
|
||||||
get { return _dropDownControl; }
|
get { return _dropDownControl; }
|
||||||
@@ -169,24 +159,21 @@ 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;
|
||||||
{
|
#endregion
|
||||||
return this.Name;
|
#region Private Methods
|
||||||
}
|
/// <summary>
|
||||||
#endregion
|
/// Calculate an acceptable position of the DropDownForm even in a
|
||||||
#region Private Methods
|
/// multi screen environment.
|
||||||
/// <summary>
|
/// </summary>
|
||||||
/// Calculate an acceptable position of the DropDownForm even in a
|
/// <param name="DropDown"></param>
|
||||||
/// multi screen environment.
|
/// <returns></returns>
|
||||||
/// </summary>
|
private Point GetDropDownPosition(DropDownForm DropDown)
|
||||||
/// <param name="DropDown"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private Point GetDropDownPosition(DropDownForm DropDown)
|
|
||||||
{
|
{
|
||||||
Point lt = Parent.PointToScreen(new Point(Left, Top));
|
Point lt = Parent.PointToScreen(new Point(Left, Top));
|
||||||
Point rb = Parent.PointToScreen(new Point(Right, Bottom));
|
Point rb = Parent.PointToScreen(new Point(Right, Bottom));
|
||||||
|
|||||||
@@ -35,10 +35,9 @@ namespace AT.STO.UI.Win
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
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 readonly Form _dropDown = null;
|
||||||
private Form _dropDown = null;
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor / Destructor
|
#region Constructor / Destructor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -51,36 +50,26 @@ namespace AT.STO.UI.Win
|
|||||||
{
|
{
|
||||||
_dropDown = DropDown;
|
_dropDown = DropDown;
|
||||||
_cursorLocation = CursorLocation;
|
_cursorLocation = CursorLocation;
|
||||||
_cancel = false;
|
Cancel = false;
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
#region Public Properties
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public bool Cancel
|
|
||||||
{
|
|
||||||
get { return _cancel; }
|
|
||||||
set { _cancel = value; }
|
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
#region Public Properties
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public bool Cancel { get; set; } = false;
|
||||||
|
|
||||||
/// <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;
|
||||||
{
|
#endregion
|
||||||
get { return _dropDown; }
|
}
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Contains event information for a <see cref="DropDownClosed"/> event.
|
/// Contains event information for a <see cref="DropDownClosed"/> event.
|
||||||
@@ -91,64 +80,50 @@ 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>
|
||||||
/// Constructs a new instance of this class for the specified
|
/// Constructs a new instance of this class for the specified
|
||||||
/// 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;
|
||||||
{
|
#endregion
|
||||||
_dropDown = DropDown;
|
#region Public Properties
|
||||||
}
|
/// <summary>
|
||||||
#endregion
|
/// Gets the dropdown form which is being closed.
|
||||||
#region Public Properties
|
/// </summary>
|
||||||
/// <summary>
|
public Form DropDown => _dropDown;
|
||||||
/// Gets the dropdown form which is being closed.
|
#endregion
|
||||||
/// </summary>
|
}
|
||||||
public Form DropDown
|
|
||||||
{
|
|
||||||
get { return _dropDown; }
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Contains event information for DropDownValueChangedEventHandler.
|
/// Contains event information for DropDownValueChangedEventHandler.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
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>
|
/// Default Constructor
|
||||||
/// Default Constructor
|
/// </summary>
|
||||||
/// </summary>
|
public DropDownValueChangedEventArgs()
|
||||||
public DropDownValueChangedEventArgs()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 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;
|
||||||
{
|
#endregion
|
||||||
_value = Value;
|
#region Public Properties
|
||||||
}
|
/// <summary>
|
||||||
#endregion
|
/// Gets or sets the control's value.
|
||||||
#region Public Properties
|
/// </summary>
|
||||||
/// <summary>
|
public object Value { get; set; } = null;
|
||||||
/// Gets or sets the control's value.
|
#endregion
|
||||||
/// </summary>
|
}
|
||||||
public object Value
|
|
||||||
{
|
|
||||||
get { return _value; }
|
|
||||||
set { _value = value; }
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,22 +13,19 @@ 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.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Ctrl">The control to display.</param>
|
/// <param name="Ctrl">The control to display.</param>
|
||||||
public DropDownForm(IDropDownAware Ctrl) : this()
|
public DropDownForm(IDropDownAware Ctrl) : this()
|
||||||
{
|
{
|
||||||
if (Ctrl != null)
|
if (Ctrl != null)
|
||||||
{
|
{
|
||||||
@@ -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,29 +55,20 @@ 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);
|
||||||
{
|
#endregion
|
||||||
if (this.ValueChanged != null)
|
#region IDropDownAware Implementation
|
||||||
{
|
/// <summary>
|
||||||
this.ValueChanged(this, e);
|
/// Fired either on OK, Cancel or a click outside the control to indicate
|
||||||
}
|
/// that the user has finished editing.
|
||||||
}
|
/// </summary>
|
||||||
#endregion
|
public event DropDownValueChangedEventHandler FinishEditing;
|
||||||
#region IDropDownAware Implementation
|
|
||||||
/// <summary>
|
|
||||||
/// Fired either on OK, Cancel or a click outside the control to indicate
|
|
||||||
/// that the user has finished editing.
|
|
||||||
/// </summary>
|
|
||||||
public event DropDownValueChangedEventHandler FinishEditing;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fired on any change of the controls's value during the editing process.
|
/// Fired on any change of the controls's value during the editing process.
|
||||||
@@ -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;
|
||||||
|
|
||||||
@@ -21,59 +20,48 @@ namespace AT.STO.UI.Win
|
|||||||
private const int WM_NCLBUTTONDOWN = 0x0A1;
|
private const int WM_NCLBUTTONDOWN = 0x0A1;
|
||||||
private const int WM_NCRBUTTONDOWN = 0x0A4;
|
private const int WM_NCRBUTTONDOWN = 0x0A4;
|
||||||
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;
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor / Destructor
|
#region Constructor / Destructor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructs a new instance of this class and sets the owning
|
/// Constructs a new instance of this class and sets the owning
|
||||||
/// object.
|
/// object.
|
||||||
/// </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;
|
||||||
{
|
#endregion
|
||||||
_owner = Owner;
|
#region Public Properties
|
||||||
}
|
/// <summary>
|
||||||
#endregion
|
/// Gets/sets the dropdown form which is being displayed.
|
||||||
#region Public Properties
|
/// </summary>
|
||||||
/// <summary>
|
public Form DropDown { get; set; } = null;
|
||||||
/// Gets/sets the dropdown form which is being displayed.
|
#endregion
|
||||||
/// </summary>
|
#region Private Methods
|
||||||
public Form DropDown
|
private void OnMouseDown()
|
||||||
{
|
|
||||||
get { return _dropDown; }
|
|
||||||
set { _dropDown = value; }
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
#region Private Methods
|
|
||||||
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
|
||||||
@@ -42,31 +41,25 @@ namespace AT.STO.UI.Win
|
|||||||
_filter.DropDownCancel -= new DropDownCancelEventHandler(Popup_Cancel);
|
_filter.DropDownCancel -= new DropDownCancelEventHandler(Popup_Cancel);
|
||||||
_filter.DropDownCancel += new DropDownCancelEventHandler(Popup_Cancel);
|
_filter.DropDownCancel += new DropDownCancelEventHandler(Popup_Cancel);
|
||||||
}
|
}
|
||||||
#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"/>
|
||||||
/// event from the popup form.
|
/// event from the popup form.
|
||||||
/// </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
|
||||||
/// title bar to remain active when a popup is show, and to detect if
|
/// title bar to remain active when a popup is show, and to detect if
|
||||||
/// the user clicks onto another application whilst the popup is visible.
|
/// the user clicks onto another application whilst the popup is visible.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="m">Window Procedure Message</param>
|
/// <param name="m">Window Procedure Message</param>
|
||||||
protected override void WndProc(ref Message m)
|
protected override void WndProc(ref Message m)
|
||||||
{
|
{
|
||||||
base.WndProc(ref m);
|
base.WndProc(ref m);
|
||||||
|
|
||||||
@@ -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:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,22 +161,19 @@ namespace AT.STO.UI.Win
|
|||||||
_owner = null;
|
_owner = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicator weither the DropDown is showing.
|
/// Indicator weither the DropDown is showing.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool DropDownShowing
|
public bool DropDownShowing => _dropDownShowing;
|
||||||
|
#endregion
|
||||||
|
#region Event Implementation
|
||||||
|
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
||||||
{
|
{
|
||||||
get { return _dropDownShowing; }
|
if (DropDownCancel != null)
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
#region Event Implementation
|
|
||||||
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
|
||||||
{
|
|
||||||
if (this.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);
|
||||||
{
|
#endregion
|
||||||
if (this.DropDownClosed != null)
|
}
|
||||||
{
|
|
||||||
this.DropDownClosed(this, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#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.
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,9 +35,8 @@ 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();
|
||||||
di.CreateSubdirectory("fmtall");
|
di.CreateSubdirectory("fmtall");
|
||||||
@@ -86,10 +80,11 @@ 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();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonX2_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Application.Exit();
|
Application.Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
private void buttonX2_Click(object sender, EventArgs e) => Application.Exit();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
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")]
|
||||||
+313
-883
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -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,64 +1,45 @@
|
|||||||
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; }
|
||||||
{
|
protected LBComObject() { }
|
||||||
get { return _MyType; }
|
|
||||||
set { _MyType = value; }
|
|
||||||
}
|
|
||||||
protected LBComObject() { }
|
|
||||||
protected LBComObject(string ProgID)
|
protected LBComObject(string ProgID)
|
||||||
{
|
{
|
||||||
Type objClassType;
|
Type objClassType;
|
||||||
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,45 +52,15 @@ 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
|
||||||
{
|
{
|
||||||
olMailItem = 0,
|
olMailItem = 0,
|
||||||
@@ -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,29 +91,20 @@ 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
|
||||||
{
|
{
|
||||||
olFormatUnspecified = 0,
|
olFormatUnspecified = 0,
|
||||||
@@ -173,79 +115,40 @@ 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 Add(object Source, object Type, object Position, object DisplayName)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
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
|
||||||
{
|
{
|
||||||
olByValue = 1,
|
olByValue = 1,
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,19 +49,13 @@ namespace Read64bitRegistryFrom32bitApp
|
|||||||
ref uint lpType,
|
ref uint lpType,
|
||||||
System.Text.StringBuilder lpData,
|
System.Text.StringBuilder lpData,
|
||||||
ref uint lpcbData);
|
ref uint lpcbData);
|
||||||
#endregion
|
#endregion
|
||||||
#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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,6 @@ namespace ROEditor
|
|||||||
private System.Windows.Forms.TextBox tbVariableTxtWid;
|
private System.Windows.Forms.TextBox tbVariableTxtWid;
|
||||||
private System.Windows.Forms.TextBox tbTableWid;
|
private System.Windows.Forms.TextBox tbTableWid;
|
||||||
private System.Windows.Forms.TextBox tbXYPlotWid;
|
private System.Windows.Forms.TextBox tbXYPlotWid;
|
||||||
|
|
||||||
private System.Windows.Forms.Button btnOK;
|
private System.Windows.Forms.Button btnOK;
|
||||||
private System.Windows.Forms.Button btnCancel;
|
private System.Windows.Forms.Button btnCancel;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -224,7 +223,6 @@ namespace ROEditor
|
|||||||
this.tbTableWid = new System.Windows.Forms.TextBox();
|
this.tbTableWid = new System.Windows.Forms.TextBox();
|
||||||
this.tbVariableTxtWid = new System.Windows.Forms.TextBox();
|
this.tbVariableTxtWid = new System.Windows.Forms.TextBox();
|
||||||
this.tbSingleTxtWid = new System.Windows.Forms.TextBox();
|
this.tbSingleTxtWid = new System.Windows.Forms.TextBox();
|
||||||
|
|
||||||
this.lblW4 = new System.Windows.Forms.Label();
|
this.lblW4 = new System.Windows.Forms.Label();
|
||||||
this.lblW3 = new System.Windows.Forms.Label();
|
this.lblW3 = new System.Windows.Forms.Label();
|
||||||
this.lblW2 = new System.Windows.Forms.Label();
|
this.lblW2 = new System.Windows.Forms.Label();
|
||||||
@@ -607,3 +605,4 @@ namespace ROEditor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -445,3 +445,4 @@ namespace ROEditor
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -455,3 +455,4 @@ namespace ROEditor
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -440,3 +440,4 @@ namespace ROEditor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1627,3 +1627,4 @@ namespace ROEditor
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -313,7 +313,6 @@ namespace ROEditor
|
|||||||
/// Summary description for Form1.
|
/// Summary description for Form1.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
///
|
///
|
||||||
|
|
||||||
public class Form1 : System.Windows.Forms.Form
|
public class Form1 : System.Windows.Forms.Form
|
||||||
{
|
{
|
||||||
private ctlXMLEditLib.ctlXMLEdit ctlXMLEdit2;
|
private ctlXMLEditLib.ctlXMLEdit ctlXMLEdit2;
|
||||||
@@ -344,7 +343,6 @@ namespace ROEditor
|
|||||||
private System.Windows.Forms.MenuItem menuROProperties;
|
private System.Windows.Forms.MenuItem menuROProperties;
|
||||||
private System.Windows.Forms.MenuItem menuROExit;
|
private System.Windows.Forms.MenuItem menuROExit;
|
||||||
private System.Windows.Forms.MenuItem menuItem1;
|
private System.Windows.Forms.MenuItem menuItem1;
|
||||||
|
|
||||||
private XmlDocument myroXmlDoc;
|
private XmlDocument myroXmlDoc;
|
||||||
private VlnXmlElement newone;
|
private VlnXmlElement newone;
|
||||||
private TreeNode TreeNewparent;
|
private TreeNode TreeNewparent;
|
||||||
@@ -357,7 +355,7 @@ namespace ROEditor
|
|||||||
private roRichTextBox _CurrentTextBox; // currently selected TextBox field
|
private roRichTextBox _CurrentTextBox; // currently selected TextBox field
|
||||||
public static string[] PCChildren; //C2021-026 list of Parent/Child Children
|
public static string[] PCChildren; //C2021-026 list of Parent/Child Children
|
||||||
|
|
||||||
public roRichTextBox CurrentTextBox
|
public roRichTextBox CurrentTextBox
|
||||||
{
|
{
|
||||||
get { return _CurrentTextBox; }
|
get { return _CurrentTextBox; }
|
||||||
set { _CurrentTextBox = value; }
|
set { _CurrentTextBox = value; }
|
||||||
@@ -474,7 +472,7 @@ namespace ROEditor
|
|||||||
}
|
}
|
||||||
myroXmlDoc = myrodb.RODB_GetRoot();
|
myroXmlDoc = myrodb.RODB_GetRoot();
|
||||||
rootXml = (VlnXmlElement)myroXmlDoc.FirstChild;
|
rootXml = (VlnXmlElement)myroXmlDoc.FirstChild;
|
||||||
rootNode = new TreeNode("Referenced Objects", ROGROUPIMAGE, ROGROUPIMAGE);
|
rootNode = new TreeNode("Referenced Objects",ROGROUPIMAGE,ROGROUPIMAGE);
|
||||||
rootNode.Tag = rootXml;
|
rootNode.Tag = rootXml;
|
||||||
roTreeView.Nodes.Add(rootNode);
|
roTreeView.Nodes.Add(rootNode);
|
||||||
roTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.roTreeView_AfterSelect);
|
roTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.roTreeView_AfterSelect);
|
||||||
@@ -491,7 +489,7 @@ namespace ROEditor
|
|||||||
while (group != null)
|
while (group != null)
|
||||||
{
|
{
|
||||||
// Add the top groups to tree control as a node.
|
// Add the top groups to tree control as a node.
|
||||||
TreeNode grnode = new TreeNode(CvtFldToUserFld(group.InnerText), ROGROUPIMAGE, ROGROUPIMAGE);
|
TreeNode grnode = new TreeNode(CvtFldToUserFld(group.InnerText),ROGROUPIMAGE,ROGROUPIMAGE);
|
||||||
grnode.Tag = group;
|
grnode.Tag = group;
|
||||||
rootNode.Nodes.Add(grnode);
|
rootNode.Nodes.Add(grnode);
|
||||||
string haskids = group.GetAttribute("HasChild");
|
string haskids = group.GetAttribute("HasChild");
|
||||||
@@ -516,11 +514,11 @@ namespace ROEditor
|
|||||||
// edit it through the ctlXmledit.
|
// edit it through the ctlXmledit.
|
||||||
// from the input tbl string, get a table name.
|
// from the input tbl string, get a table name.
|
||||||
ArrayList levelRecids = new ArrayList();
|
ArrayList levelRecids = new ArrayList();
|
||||||
int itbl = System.Convert.ToInt32(specificro.Substring(0, 4), 16);
|
int itbl = System.Convert.ToInt32(specificro.Substring(0,4),16);
|
||||||
string stbl = System.Convert.ToString(itbl, 10);
|
string stbl = System.Convert.ToString(itbl,10);
|
||||||
string pstbl = stbl.PadLeft(6, '0');
|
string pstbl = stbl.PadLeft(6,'0');
|
||||||
string tbname = "RO" + pstbl;
|
string tbname = "RO" + pstbl;
|
||||||
string recid = specificro.Substring(4, 8);
|
string recid = specificro.Substring(4,8);
|
||||||
|
|
||||||
// read in this element from the table.
|
// read in this element from the table.
|
||||||
VlnXmlElement spro;
|
VlnXmlElement spro;
|
||||||
@@ -561,20 +559,20 @@ namespace ROEditor
|
|||||||
string attrspro;
|
string attrspro;
|
||||||
TreeNode trnd = rootNode.FirstNode;
|
TreeNode trnd = rootNode.FirstNode;
|
||||||
VlnXmlElement ele;
|
VlnXmlElement ele;
|
||||||
for (int i = levelRecids.Count - 1; i >= 0; i--)
|
for (int i = levelRecids.Count-1;i>=0;i--)
|
||||||
{
|
{
|
||||||
ele = (VlnXmlElement)trnd.Tag;
|
ele = (VlnXmlElement) trnd.Tag;
|
||||||
attrele = ele.GetAttribute((i == levelRecids.Count - 1) ? "Table" : "RecID");
|
attrele = ele.GetAttribute((i==levelRecids.Count-1)?"Table":"RecID");
|
||||||
if (i == levelRecids.Count - 1)
|
if (i == levelRecids.Count-1)
|
||||||
attrspro = spro.GetAttribute("Table");
|
attrspro = spro.GetAttribute("Table");
|
||||||
else
|
else
|
||||||
attrspro = (string)levelRecids[i];
|
attrspro = (string) levelRecids[i];
|
||||||
while (attrele != attrspro)
|
while (attrele != attrspro)
|
||||||
{
|
{
|
||||||
// get next one.
|
// get next one.
|
||||||
trnd = trnd.NextNode;
|
trnd = trnd.NextNode;
|
||||||
ele = (VlnXmlElement)trnd.Tag;
|
ele = (VlnXmlElement)trnd.Tag;
|
||||||
attrele = ele.GetAttribute((i == levelRecids.Count - 1) ? "Table" : "RecID");
|
attrele = ele.GetAttribute((i==levelRecids.Count - 1)?"Table":"RecID");
|
||||||
}
|
}
|
||||||
if (trnd == null)
|
if (trnd == null)
|
||||||
{
|
{
|
||||||
@@ -590,12 +588,12 @@ namespace ROEditor
|
|||||||
MessageBox.Show("Error editting RO");
|
MessageBox.Show("Error editting RO");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ele = (VlnXmlElement)trnd.Tag;
|
ele = (VlnXmlElement) trnd.Tag;
|
||||||
attrele = ele.GetAttribute("RecID");
|
attrele = ele.GetAttribute("RecID");
|
||||||
while (attrele != spro.GetAttribute("RecID"))
|
while (attrele != spro.GetAttribute("RecID"))
|
||||||
{
|
{
|
||||||
trnd = trnd.NextNode;
|
trnd = trnd.NextNode;
|
||||||
ele = (VlnXmlElement)trnd.Tag;
|
ele = (VlnXmlElement) trnd.Tag;
|
||||||
attrele = ele.GetAttribute("RecID");
|
attrele = ele.GetAttribute("RecID");
|
||||||
}
|
}
|
||||||
if (trnd == null)
|
if (trnd == null)
|
||||||
@@ -606,7 +604,7 @@ namespace ROEditor
|
|||||||
roTreeView.SelectedNode = trnd;
|
roTreeView.SelectedNode = trnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void roTreeView_AfterSelect(object sender,
|
protected void roTreeView_AfterSelect (object sender,
|
||||||
System.Windows.Forms.TreeViewEventArgs e)
|
System.Windows.Forms.TreeViewEventArgs e)
|
||||||
{
|
{
|
||||||
TreeNode PreviousNode = LastSelectedNode;
|
TreeNode PreviousNode = LastSelectedNode;
|
||||||
@@ -632,7 +630,7 @@ namespace ROEditor
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if selected to make new, but didn't add any data, remove it.
|
// if selected to make new, but didn't add any data, remove it.
|
||||||
if (newone != null)
|
if (newone!=null)
|
||||||
{
|
{
|
||||||
XmlNode parent = newone.ParentNode;
|
XmlNode parent = newone.ParentNode;
|
||||||
parent.RemoveChild(newone);
|
parent.RemoveChild(newone);
|
||||||
@@ -647,7 +645,7 @@ namespace ROEditor
|
|||||||
roTreeView.ContextMenu.MenuItems[6].Enabled = rbtnSave.Enabled;
|
roTreeView.ContextMenu.MenuItems[6].Enabled = rbtnSave.Enabled;
|
||||||
|
|
||||||
// Should the properties menu item be available?
|
// Should the properties menu item be available?
|
||||||
VlnXmlElement curelem = (VlnXmlElement)CurrentNode.Tag;
|
VlnXmlElement curelem = (VlnXmlElement) CurrentNode.Tag;
|
||||||
if (curelem.Name == "vlnGroup")
|
if (curelem.Name == "vlnGroup")
|
||||||
menuROProperties.Enabled = true;
|
menuROProperties.Enabled = true;
|
||||||
else
|
else
|
||||||
@@ -757,12 +755,12 @@ namespace ROEditor
|
|||||||
return fldname;
|
return fldname;
|
||||||
// a digit cannot start an xml fieldname, prepend a "__" to it.
|
// a digit cannot start an xml fieldname, prepend a "__" to it.
|
||||||
string tmp0;
|
string tmp0;
|
||||||
if (char.IsDigit(fldname, 0))
|
if (char.IsDigit(fldname,0))
|
||||||
tmp0 = "__" + fldname;
|
tmp0 = "__" + fldname;
|
||||||
else
|
else
|
||||||
tmp0 = fldname;
|
tmp0 = fldname;
|
||||||
// an xml fieldname cannot have a space, change it to a "__"
|
// an xml fieldname cannot have a space, change it to a "__"
|
||||||
string tmpstr = tmp0.Replace(" ", "__");
|
string tmpstr = tmp0.Replace(" ","__");
|
||||||
int len = tmpstr.Length;
|
int len = tmpstr.Length;
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
|
||||||
@@ -795,12 +793,12 @@ namespace ROEditor
|
|||||||
string tmpstr0;
|
string tmpstr0;
|
||||||
if (fldname.Length < 2) return fldname;
|
if (fldname.Length < 2) return fldname;
|
||||||
// an xml element name cannot begin with a digit. we had prepended a "__"
|
// an xml element name cannot begin with a digit. we had prepended a "__"
|
||||||
if (fldname.Substring(0, 2) == "__" && char.IsDigit(fldname, 2))
|
if (fldname.Substring(0,2) == "__" && char.IsDigit(fldname,2))
|
||||||
tmpstr0 = fldname.Substring(2, fldname.Length - 2);
|
tmpstr0 = fldname.Substring(2,fldname.Length-2);
|
||||||
else
|
else
|
||||||
tmpstr0 = fldname;
|
tmpstr0 = fldname;
|
||||||
// an xml element name cannot have a space, we converted to a "__"
|
// an xml element name cannot have a space, we converted to a "__"
|
||||||
string tmpstr = tmpstr0.Replace("__", " ");
|
string tmpstr = tmpstr0.Replace("__"," ");
|
||||||
int len = tmpstr.Length;
|
int len = tmpstr.Length;
|
||||||
int cur = 0;
|
int cur = 0;
|
||||||
|
|
||||||
@@ -810,24 +808,24 @@ namespace ROEditor
|
|||||||
|
|
||||||
string outstr = "";
|
string outstr = "";
|
||||||
int decval, indx;
|
int decval, indx;
|
||||||
if (tmpstr.Length < 6)
|
if (tmpstr.Length <6)
|
||||||
indx = -1;
|
indx = -1;
|
||||||
else
|
else
|
||||||
indx = tmpstr.IndexOf(OKpunch, cur);
|
indx=tmpstr.IndexOf(OKpunch, cur);
|
||||||
string asc_spchar;
|
string asc_spchar;
|
||||||
while (indx >= 0)
|
while (indx>=0)
|
||||||
{
|
{
|
||||||
outstr += tmpstr.Substring(cur, indx - cur);
|
outstr += tmpstr.Substring(cur,indx-cur);
|
||||||
asc_spchar = tmpstr.Substring(indx + 3, 3);
|
asc_spchar = tmpstr.Substring(indx+3,3);
|
||||||
decval = System.Convert.ToInt16(asc_spchar, 10);
|
decval = System.Convert.ToInt16(asc_spchar,10);
|
||||||
outstr += System.Convert.ToChar(decval).ToString();
|
outstr += System.Convert.ToChar(decval).ToString();
|
||||||
cur = indx + 6;
|
cur = indx+6;
|
||||||
if (cur + 6 > len)
|
if (cur+6 > len)
|
||||||
indx = -1;
|
indx = -1;
|
||||||
else
|
else
|
||||||
indx = tmpstr.IndexOf(OKpunch, cur);
|
indx = tmpstr.IndexOf(OKpunch, cur);
|
||||||
}
|
}
|
||||||
if (cur < len) outstr += tmpstr.Substring(cur, len - cur);
|
if (cur<len) outstr += tmpstr.Substring(cur,len-cur);
|
||||||
|
|
||||||
return outstr;
|
return outstr;
|
||||||
}
|
}
|
||||||
@@ -850,7 +848,7 @@ namespace ROEditor
|
|||||||
{
|
{
|
||||||
// Get the tree node at the current mouse position and set it
|
// Get the tree node at the current mouse position and set it
|
||||||
// to be the the currently selected node (i.e. selecti that node)
|
// to be the the currently selected node (i.e. selecti that node)
|
||||||
TreeNode CurrentNode = roTreeView.GetNodeAt(e.X, e.Y);
|
TreeNode CurrentNode = roTreeView.GetNodeAt(e.X,e.Y);
|
||||||
if (CurrentNode != null)
|
if (CurrentNode != null)
|
||||||
{
|
{
|
||||||
roTreeView.SelectedNode = CurrentNode; // select this node
|
roTreeView.SelectedNode = CurrentNode; // select this node
|
||||||
@@ -884,7 +882,7 @@ namespace ROEditor
|
|||||||
menuROSave.Enabled = rbtnSave.Enabled;
|
menuROSave.Enabled = rbtnSave.Enabled;
|
||||||
|
|
||||||
// Should the properties menu item be available?
|
// Should the properties menu item be available?
|
||||||
VlnXmlElement curelem = (VlnXmlElement)CurrentNode.Tag;
|
VlnXmlElement curelem = (VlnXmlElement) CurrentNode.Tag;
|
||||||
if (curelem.Name == "vlnGroup")
|
if (curelem.Name == "vlnGroup")
|
||||||
roTreeView.ContextMenu.MenuItems[7].Enabled = true;
|
roTreeView.ContextMenu.MenuItems[7].Enabled = true;
|
||||||
else
|
else
|
||||||
@@ -916,7 +914,7 @@ namespace ROEditor
|
|||||||
{
|
{
|
||||||
bool rtnval = false;
|
bool rtnval = false;
|
||||||
TreeNode CurrentNode = roTreeView.SelectedNode;
|
TreeNode CurrentNode = roTreeView.SelectedNode;
|
||||||
VlnXmlElement curelem = (VlnXmlElement)CurrentNode.Tag;
|
VlnXmlElement curelem = (VlnXmlElement) CurrentNode.Tag;
|
||||||
if (curelem.Name != "RO_Root")
|
if (curelem.Name != "RO_Root")
|
||||||
{
|
{
|
||||||
if (curelem.Name == "vlnGroup")
|
if (curelem.Name == "vlnGroup")
|
||||||
@@ -947,7 +945,7 @@ namespace ROEditor
|
|||||||
DialogResult dr = MessageBox.Show("Do you want to save your changes?", "Warning:", MessageBoxButtons.YesNoCancel);
|
DialogResult dr = MessageBox.Show("Do you want to save your changes?", "Warning:", MessageBoxButtons.YesNoCancel);
|
||||||
if (dr == DialogResult.Yes)
|
if (dr == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
TreeNode tr = null;
|
TreeNode tr=null;
|
||||||
bool ok = SaveRO(ref tr); // savero needs a tree node
|
bool ok = SaveRO(ref tr); // savero needs a tree node
|
||||||
if (ok == false) return -1;
|
if (ok == false) return -1;
|
||||||
}
|
}
|
||||||
@@ -982,19 +980,19 @@ namespace ROEditor
|
|||||||
{
|
{
|
||||||
roListView.Dispose();
|
roListView.Dispose();
|
||||||
this.panel1.Controls.Remove(roListView);
|
this.panel1.Controls.Remove(roListView);
|
||||||
roListView = null;
|
roListView=null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateCtlXmlEdit2(VlnXmlElement curelem, XmlSchema myschema, ArrayList reqfields, ArrayList fieldsWithApplic)
|
private void CreateCtlXmlEdit2(VlnXmlElement curelem, XmlSchema myschema, ArrayList reqfields, ArrayList fieldsWithApplic)
|
||||||
{
|
{
|
||||||
ctlXMLEdit2 = new ctlXMLEditLib.ctlXMLEdit(curelem, myschema, reqfields, fieldsWithApplic, PCChildren); // C2021-026 pass in P/C enabled information
|
ctlXMLEdit2 = new ctlXMLEditLib.ctlXMLEdit(curelem,myschema,reqfields,fieldsWithApplic,PCChildren); // C2021-026 pass in P/C enabled information
|
||||||
ctlXMLEdit2.AutoScroll = true;
|
ctlXMLEdit2.AutoScroll = true;
|
||||||
ctlXMLEdit2.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
|
ctlXMLEdit2.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
|
||||||
ctlXMLEdit2.Name = "ctlXMLEdit2";
|
ctlXMLEdit2.Name = "ctlXMLEdit2";
|
||||||
ctlXMLEdit2.Size = new System.Drawing.Size(ctlXMLEdit2.GetMaxWidth(), ctlXMLEdit2.GetMaxLength());
|
ctlXMLEdit2.Size = new System.Drawing.Size(ctlXMLEdit2.GetMaxWidth(),ctlXMLEdit2.GetMaxLength());
|
||||||
this.panel2.Visible = true;
|
this.panel2.Visible = true;
|
||||||
this.panel2.Size = new System.Drawing.Size(ctlXMLEdit2.GetMaxWidth() + 20, ctlXMLEdit2.GetMaxLength() + 10);
|
this.panel2.Size = new System.Drawing.Size(ctlXMLEdit2.GetMaxWidth()+20,ctlXMLEdit2.GetMaxLength()+10);
|
||||||
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||||
ctlXMLEdit2.TabIndex = 4;
|
ctlXMLEdit2.TabIndex = 4;
|
||||||
ctlXMLEdit2.Tag = "";
|
ctlXMLEdit2.Tag = "";
|
||||||
@@ -1011,7 +1009,7 @@ namespace ROEditor
|
|||||||
TmpInfo = (Control)ctlEnumerator.Current;
|
TmpInfo = (Control)ctlEnumerator.Current;
|
||||||
if (TmpInfo is GroupBox)
|
if (TmpInfo is GroupBox)
|
||||||
{
|
{
|
||||||
System.Collections.IEnumerator ctlGroup = TmpInfo.Controls.GetEnumerator(); ;
|
System.Collections.IEnumerator ctlGroup = TmpInfo.Controls.GetEnumerator();;
|
||||||
while (ctlGroup.MoveNext())
|
while (ctlGroup.MoveNext())
|
||||||
{
|
{
|
||||||
Control tmpradio = (Control)ctlGroup.Current;
|
Control tmpradio = (Control)ctlGroup.Current;
|
||||||
@@ -1053,7 +1051,7 @@ namespace ROEditor
|
|||||||
private void EditRO(VlnXmlElement curelem)
|
private void EditRO(VlnXmlElement curelem)
|
||||||
{
|
{
|
||||||
ArrayList fieldsWithApplic = null;
|
ArrayList fieldsWithApplic = null;
|
||||||
newone = null;
|
newone=null;
|
||||||
// can't edit fields for top or top group nodes (top node not editable,
|
// can't edit fields for top or top group nodes (top node not editable,
|
||||||
// and top group node data change at properties level).
|
// and top group node data change at properties level).
|
||||||
if (curelem.Name == "RO_Root" || curelem.ParentNode.Name == "RO_Root") return;
|
if (curelem.Name == "RO_Root" || curelem.ParentNode.Name == "RO_Root") return;
|
||||||
@@ -1072,7 +1070,7 @@ namespace ROEditor
|
|||||||
fieldsWithApplic = GetApplcFieldListForElement(curelem);
|
fieldsWithApplic = GetApplcFieldListForElement(curelem);
|
||||||
|
|
||||||
myschema = myrodb.RODB_GetSchema(curelem);
|
myschema = myrodb.RODB_GetSchema(curelem);
|
||||||
if (myschema == null)
|
if (myschema==null)
|
||||||
{
|
{
|
||||||
MessageBox.Show("RO Definition does not exist, check RO Definition under Properties for the Group that contains this RO.");
|
MessageBox.Show("RO Definition does not exist, check RO Definition under Properties for the Group that contains this RO.");
|
||||||
return;
|
return;
|
||||||
@@ -1084,7 +1082,7 @@ namespace ROEditor
|
|||||||
VlnXmlElement sch = curelem;
|
VlnXmlElement sch = curelem;
|
||||||
if (curelem.ParentNode.Name != "RO_Root") sch = (VlnXmlElement)sch.ParentNode;
|
if (curelem.ParentNode.Name != "RO_Root") sch = (VlnXmlElement)sch.ParentNode;
|
||||||
myschema = myrodb.RODB_GetGroupSchema(sch);
|
myschema = myrodb.RODB_GetGroupSchema(sch);
|
||||||
if (myschema == null)
|
if (myschema==null)
|
||||||
{
|
{
|
||||||
MessageBox.Show("Subgroup Definition does not exist, check Subgroup Definition under Properties for the Group that contains this Subgroup.");
|
MessageBox.Show("Subgroup Definition does not exist, check Subgroup Definition under Properties for the Group that contains this Subgroup.");
|
||||||
return;
|
return;
|
||||||
@@ -1092,20 +1090,20 @@ namespace ROEditor
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArrayList reqfields = curelem.GetRequiredFields();
|
ArrayList reqfields = curelem.GetRequiredFields();
|
||||||
CreateCtlXmlEdit2(curelem, myschema, reqfields, fieldsWithApplic); // C2021-026 pass in P/C enabled fields
|
CreateCtlXmlEdit2(curelem,myschema, reqfields, fieldsWithApplic); // C2021-026 pass in P/C enabled fields
|
||||||
this.panel2.Controls.Add(ctlXMLEdit2);
|
this.panel2.Controls.Add(ctlXMLEdit2);
|
||||||
rbtnSave.Enabled = false; // set initial states of buttons on edit RO Editor add symbols C2025 - 003
|
rbtnSave.Enabled=false; // set initial states of buttons on edit RO Editor add symbols C2025 - 003
|
||||||
rbtnRestore.Enabled = false;
|
rbtnRestore.Enabled=false;
|
||||||
rbtnCancel.Enabled = true;
|
rbtnCancel.Enabled=true;
|
||||||
rbtnSaveAs.Enabled = false;
|
rbtnSaveAs.Enabled=false;
|
||||||
rbtnDuplicate.Enabled = true;
|
rbtnDuplicate.Enabled=true;
|
||||||
rbtnZoom.Enabled = false;
|
rbtnZoom.Enabled = false;
|
||||||
rbtnSymbols.Enabled = true;
|
rbtnSymbols.Enabled = true;
|
||||||
ctlXMLEdit2.Focus();
|
ctlXMLEdit2.Focus();
|
||||||
}
|
}
|
||||||
protected void roTreeView_OnDoubleClick(object sender, System.EventArgs e)
|
protected void roTreeView_OnDoubleClick(object sender,System.EventArgs e)
|
||||||
{
|
{
|
||||||
VlnXmlElement curelem = (VlnXmlElement)roTreeView.SelectedNode.Tag;
|
VlnXmlElement curelem = (VlnXmlElement) roTreeView.SelectedNode.Tag;
|
||||||
EditRO(curelem);
|
EditRO(curelem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1165,7 +1163,7 @@ namespace ROEditor
|
|||||||
|
|
||||||
object dataobj = System.Windows.Forms.Clipboard.GetDataObject();
|
object dataobj = System.Windows.Forms.Clipboard.GetDataObject();
|
||||||
if (dataobj != null)
|
if (dataobj != null)
|
||||||
this.menuEditPaste.Enabled = true;
|
this.menuEditPaste.Enabled=true;
|
||||||
}
|
}
|
||||||
else if (sender is RadioButton)
|
else if (sender is RadioButton)
|
||||||
{
|
{
|
||||||
@@ -1205,9 +1203,9 @@ namespace ROEditor
|
|||||||
rbtnSave.Enabled = true;
|
rbtnSave.Enabled = true;
|
||||||
rbtnRestore.Enabled = true;
|
rbtnRestore.Enabled = true;
|
||||||
if (newone == null)
|
if (newone == null)
|
||||||
{ rbtnSaveAs.Enabled = true; }
|
{ rbtnSaveAs.Enabled = true; }
|
||||||
else
|
else
|
||||||
{ rbtnSaveAs.Enabled = false; }
|
{ rbtnSaveAs.Enabled = false; }
|
||||||
rbtnCancel.Enabled = true;
|
rbtnCancel.Enabled = true;
|
||||||
|
|
||||||
menuROSave.Enabled = rbtnSave.Enabled;
|
menuROSave.Enabled = rbtnSave.Enabled;
|
||||||
@@ -1224,36 +1222,36 @@ namespace ROEditor
|
|||||||
string kidsloaded;
|
string kidsloaded;
|
||||||
haskids = elem.GetAttribute("HasChild");
|
haskids = elem.GetAttribute("HasChild");
|
||||||
kidsloaded = elem.GetAttribute("ChildLoaded");
|
kidsloaded = elem.GetAttribute("ChildLoaded");
|
||||||
if (haskids == "True" && kidsloaded == "False")
|
if (haskids == "True" && kidsloaded == "False" )
|
||||||
{
|
{
|
||||||
// if there's a dummy tree node (used to have tree control expansion for
|
// if there's a dummy tree node (used to have tree control expansion for
|
||||||
// items not yet loaded, delete child in tree control)
|
// items not yet loaded, delete child in tree control)
|
||||||
XmlNode tmpnode = (XmlNode)elem;
|
XmlNode tmpnode = (XmlNode) elem;
|
||||||
XmlNode chldnode;
|
XmlNode chldnode;
|
||||||
VlnXmlElement echild;
|
VlnXmlElement echild;
|
||||||
if (enode.FirstNode.Text == "VLN_DUMMY_FOR_TREE") enode.FirstNode.Remove();
|
if (enode.FirstNode.Text == "VLN_DUMMY_FOR_TREE") enode.FirstNode.Remove();
|
||||||
Cursor.Current = Cursors.WaitCursor;
|
Cursor.Current = Cursors.WaitCursor;
|
||||||
myrodb.RODB_GetChildData(elem, true);
|
myrodb.RODB_GetChildData(elem,true);
|
||||||
chldnode = tmpnode.FirstChild;
|
chldnode = tmpnode.FirstChild;
|
||||||
while (chldnode != null)
|
while (chldnode != null)
|
||||||
{
|
{
|
||||||
if (chldnode is VlnXmlElement)
|
if (chldnode is VlnXmlElement)
|
||||||
{
|
{
|
||||||
echild = (VlnXmlElement)chldnode;
|
echild = (VlnXmlElement) chldnode;
|
||||||
TreeNode chldnd;
|
TreeNode chldnd;
|
||||||
if (echild.Name == "vlnGroup")
|
if (echild.Name == "vlnGroup")
|
||||||
{
|
{
|
||||||
chldnd = new TreeNode(echild.GetAttribute("MenuTitle"), ROGROUPIMAGE, ROGROUPIMAGE);
|
chldnd = new TreeNode(echild.GetAttribute("MenuTitle"),ROGROUPIMAGE,ROGROUPIMAGE);
|
||||||
chldnd.Tag = echild;
|
chldnd.Tag = echild;
|
||||||
enode.Nodes.Add(chldnd);
|
enode.Nodes.Add(chldnd);
|
||||||
// add a 'dummy' node to tree if there are any children
|
// add a 'dummy' node to tree if there are any children
|
||||||
string haskids1 = "False";
|
string haskids1="False";
|
||||||
string kidsloaded1 = "False";
|
string kidsloaded1="False";
|
||||||
if (echild.HasAttribute("HasChild") == true)
|
if (echild.HasAttribute("HasChild")==true)
|
||||||
haskids1 = echild.GetAttribute("HasChild");
|
haskids1 = echild.GetAttribute("HasChild");
|
||||||
if (echild.HasAttribute("ChildLoaded") == true)
|
if (echild.HasAttribute("ChildLoaded")==true)
|
||||||
kidsloaded1 = echild.GetAttribute("ChildLoaded");
|
kidsloaded1 = echild.GetAttribute("ChildLoaded");
|
||||||
if (haskids1 == "True" && kidsloaded1 == "False")
|
if (haskids1 == "True" && kidsloaded1=="False")
|
||||||
{
|
{
|
||||||
TreeNode subch = new TreeNode("VLN_DUMMY_FOR_TREE");
|
TreeNode subch = new TreeNode("VLN_DUMMY_FOR_TREE");
|
||||||
chldnd.Nodes.Add(subch);
|
chldnd.Nodes.Add(subch);
|
||||||
@@ -1266,9 +1264,9 @@ namespace ROEditor
|
|||||||
// include these in the tree.
|
// include these in the tree.
|
||||||
int levelcnt = chldnode.ChildNodes.Count;
|
int levelcnt = chldnode.ChildNodes.Count;
|
||||||
string TheMenuTitle = echild.GetAttribute("MenuTitle");
|
string TheMenuTitle = echild.GetAttribute("MenuTitle");
|
||||||
if (levelcnt >= 1 && !TheMenuTitle.Equals(""))
|
if (levelcnt>=1 && !TheMenuTitle.Equals(""))
|
||||||
{
|
{
|
||||||
chldnd = new TreeNode(TheMenuTitle, ROIMAGE, ROIMAGE);
|
chldnd = new TreeNode(TheMenuTitle,ROIMAGE,ROIMAGE);
|
||||||
chldnd.Tag = echild;
|
chldnd.Tag = echild;
|
||||||
chldnd.Name = echild.GetAttribute("RecID");
|
chldnd.Name = echild.GetAttribute("RecID");
|
||||||
enode.Nodes.Add(chldnd);
|
enode.Nodes.Add(chldnd);
|
||||||
@@ -1290,16 +1288,16 @@ namespace ROEditor
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clean up any resources being used.
|
/// Clean up any resources being used.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose( bool disposing )
|
||||||
{
|
{
|
||||||
if (disposing)
|
if ( disposing )
|
||||||
{
|
{
|
||||||
if (components != null)
|
if (components != null)
|
||||||
{
|
{
|
||||||
components.Dispose();
|
components.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
base.Dispose(disposing);
|
base.Dispose( disposing );
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
#region Windows Form Designer generated code
|
||||||
@@ -1811,11 +1809,6 @@ namespace ROEditor
|
|||||||
this.lblDuplicateRO.Text = "Working With Duplicate RO";
|
this.lblDuplicateRO.Text = "Working With Duplicate RO";
|
||||||
this.lblDuplicateRO.Visible = false;
|
this.lblDuplicateRO.Visible = false;
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Form1
|
// Form1
|
||||||
//
|
//
|
||||||
@@ -2052,8 +2045,8 @@ namespace ROEditor
|
|||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
bool StartupROEditor = true;
|
bool StartupROEditor = true;
|
||||||
FileStream fsown = null;
|
FileStream fsown=null;
|
||||||
FileInfo fiown = null;
|
FileInfo fiown=null;
|
||||||
String specificro = null;
|
String specificro = null;
|
||||||
string ConnectionPath = "";
|
string ConnectionPath = "";
|
||||||
// Let's open the database & set up for the tree structure...
|
// Let's open the database & set up for the tree structure...
|
||||||
@@ -2091,25 +2084,25 @@ namespace ROEditor
|
|||||||
if (args.Length > 3)
|
if (args.Length > 3)
|
||||||
if (args[3].ToUpper().StartsWith("PC="))
|
if (args[3].ToUpper().StartsWith("PC="))
|
||||||
PCChildren = args[3].Substring(3).Split(','); //C2021-026 list of Parent/Child Children
|
PCChildren = args[3].Substring(3).Split(','); //C2021-026 list of Parent/Child Children
|
||||||
else if (args[3].ToUpper().Contains("DATA SOURCE")) SqlConnectionStr = args[3];
|
else if (args[3].ToUpper().Contains("DATA SOURCE")) SqlConnectionStr = args[3];
|
||||||
else specificro = args[3];
|
else specificro = args[3];
|
||||||
RODB.PCChildList = PCChildren; //C2021-026 pass the Parent/Child info to the RODB class
|
RODB.PCChildList = PCChildren; //C2021-026 pass the Parent/Child info to the RODB class
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Convert the RO data if needed
|
// Convert the RO data if needed
|
||||||
if (!CheckForDataConversion(ConnectionPath))
|
if (!CheckForDataConversion(ConnectionPath))
|
||||||
ConnectionPath = null; // force exit
|
ConnectionPath = null; // force exit
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
MessageBox.Show(e.Message, "Error on check for data conversion");
|
MessageBox.Show(e.Message, "Error on check for data conversion");
|
||||||
// Application.Exit();
|
// Application.Exit();
|
||||||
}
|
}
|
||||||
// Process the given RO Path
|
// Process the given RO Path
|
||||||
if (ConnectionPath == null)
|
if (ConnectionPath == null)
|
||||||
{
|
{
|
||||||
// no RO directory
|
// no RO directory
|
||||||
MessageBox.Show("Could not locate a Referenced Objects (RO) directory.\n\nIt should be inside your VExxx directory or at the same level as your VExxx directory.", "RO Editor");
|
MessageBox.Show("Could not locate a Referenced Objects (RO) directory.\n\nIt should be inside your VExxx directory or at the same level as your VExxx directory.","RO Editor");
|
||||||
StartupROEditor = false;
|
StartupROEditor = false;
|
||||||
}
|
}
|
||||||
else if (ConnectionPath.Equals(""))
|
else if (ConnectionPath.Equals(""))
|
||||||
@@ -2130,7 +2123,7 @@ namespace ROEditor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StartupROEditor)
|
if (StartupROEditor)
|
||||||
{
|
{
|
||||||
// The ROEditor.OWN file assures that only one individual at a time can edit the RO database.
|
// The ROEditor.OWN file assures that only one individual at a time can edit the RO database.
|
||||||
// The file is opened and kept open while the user is editing the database. The contents of the
|
// The file is opened and kept open while the user is editing the database. The contents of the
|
||||||
@@ -2138,14 +2131,13 @@ namespace ROEditor
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
fiown = new FileInfo("RoEditor.own");
|
fiown = new FileInfo("RoEditor.own");
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
// Try to delete the owner file. If another process has the file open, this delete will fail.
|
// Try to delete the owner file. If another process has the file open, this delete will fail.
|
||||||
// If the file is closed, it will be deleted, and the user will be placed in the editor. The users
|
// If the file is closed, it will be deleted, and the user will be placed in the editor. The users
|
||||||
// name and the time when this session began will be placed in the owner file.
|
// name and the time when this session began will be placed in the owner file.
|
||||||
fiown.Delete();
|
fiown.Delete();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
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);
|
||||||
@@ -2164,12 +2156,12 @@ namespace ROEditor
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
MessageBox.Show(e.Message, "fileinfo");
|
MessageBox.Show(e.Message,"fileinfo");
|
||||||
}
|
}
|
||||||
// Open the file just specified. Open it so that no-one else can use it
|
// Open the file just specified. Open it so that no-one else can use it
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fsown = fiown.Open(FileMode.Create, FileAccess.ReadWrite, FileShare.Read);
|
fsown = fiown.Open( FileMode.Create, FileAccess.ReadWrite, FileShare.Read );
|
||||||
TextWriter tw = new StreamWriter(fsown);
|
TextWriter tw = new StreamWriter(fsown);
|
||||||
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();
|
||||||
@@ -2183,17 +2175,6 @@ namespace ROEditor
|
|||||||
if (who.Contains(Environment.UserName.ToUpper()))
|
if (who.Contains(Environment.UserName.ToUpper()))
|
||||||
{
|
{
|
||||||
BringWindowToFront();
|
BringWindowToFront();
|
||||||
|
|
||||||
//Process[] p = Process.GetProcessesByName("ROEditor");
|
|
||||||
//Process cp = Process.GetCurrentProcess();
|
|
||||||
//for (int i = 0; i < p.Length; i++)
|
|
||||||
//{
|
|
||||||
// if (p[i].SessionId != cp.SessionId)
|
|
||||||
// {
|
|
||||||
// SetForegroundWindow(p[i].MainWindowHandle);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
MessageBox.Show(who, "Another user is executing the RoEditor");
|
MessageBox.Show(who, "Another user is executing the RoEditor");
|
||||||
@@ -2204,13 +2185,13 @@ namespace ROEditor
|
|||||||
if (!File.Exists("ROMaster.mdb") && !UsingSQLServer(Directory.GetCurrentDirectory()))
|
if (!File.Exists("ROMaster.mdb") && !UsingSQLServer(Directory.GetCurrentDirectory()))
|
||||||
{
|
{
|
||||||
DialogResult AnswerYN;
|
DialogResult AnswerYN;
|
||||||
string msgstr = "The RO directory (" + Directory.GetCurrentDirectory() + ") is empty.\n\n Create an empty RO database?";
|
string msgstr = "The RO directory (" + Directory.GetCurrentDirectory() +") is empty.\n\n Create an empty RO database?";
|
||||||
AnswerYN = MessageBox.Show(msgstr, "RO Editor", MessageBoxButtons.YesNo);
|
AnswerYN = MessageBox.Show(msgstr,"RO Editor",MessageBoxButtons.YesNo);
|
||||||
if (AnswerYN == DialogResult.Yes)
|
if (AnswerYN == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
string SourceRODatabase = Application.StartupPath + "\\ROMaster.mdb";
|
string SourceRODatabase = Application.StartupPath + "\\ROMaster.mdb";
|
||||||
string DestRODatabase = Directory.GetCurrentDirectory() + "\\ROMaster.mdb";
|
string DestRODatabase = Directory.GetCurrentDirectory() + "\\ROMaster.mdb";
|
||||||
File.Copy(SourceRODatabase, DestRODatabase);
|
File.Copy(SourceRODatabase,DestRODatabase);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
StartupROEditor = false;
|
StartupROEditor = false;
|
||||||
@@ -2219,7 +2200,7 @@ namespace ROEditor
|
|||||||
|
|
||||||
if (StartupROEditor)
|
if (StartupROEditor)
|
||||||
{
|
{
|
||||||
Application.Run(new Form1(ConnectionPath, specificro));
|
Application.Run(new Form1(ConnectionPath,specificro));
|
||||||
|
|
||||||
if (fsown != null)
|
if (fsown != null)
|
||||||
{
|
{
|
||||||
@@ -2324,12 +2305,11 @@ namespace ROEditor
|
|||||||
|
|
||||||
testParadoxFile += "ROMASTER.DB"; // Paradox file
|
testParadoxFile += "ROMASTER.DB"; // Paradox file
|
||||||
testAccessFile += "ROMaster.mdb"; // Access file
|
testAccessFile += "ROMaster.mdb"; // Access file
|
||||||
// if (File.Exists(testParadoxFile))
|
|
||||||
if (File.Exists(testParadoxFile) && !(File.Exists(testAccessFile) || UsingSQLServer(ROdir)))
|
if (File.Exists(testParadoxFile) && !(File.Exists(testAccessFile) || UsingSQLServer(ROdir)))
|
||||||
{
|
{
|
||||||
// Display a message to the user that the data needs converted
|
// Display a message to the user that the data needs converted
|
||||||
DialogResult AnswerYN;
|
DialogResult AnswerYN;
|
||||||
AnswerYN = MessageBox.Show("The RO data needs to be converted for the New RO Editor.\n\n Proceed with the data conversion?", "RO Editor", MessageBoxButtons.YesNo);
|
AnswerYN = MessageBox.Show("The RO data needs to be converted for the New RO Editor.\n\n Proceed with the data conversion?","RO Editor",MessageBoxButtons.YesNo);
|
||||||
if (AnswerYN == DialogResult.Yes)
|
if (AnswerYN == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
// Convert old RO Data
|
// Convert old RO Data
|
||||||
@@ -2344,7 +2324,7 @@ namespace ROEditor
|
|||||||
// create a process & wait until it exits.
|
// create a process & wait until it exits.
|
||||||
Process myProcess = new Process();
|
Process myProcess = new Process();
|
||||||
myProcess.StartInfo.FileName = ConversionExePath;
|
myProcess.StartInfo.FileName = ConversionExePath;
|
||||||
myProcess.StartInfo.Arguments = argstr;
|
myProcess.StartInfo.Arguments=argstr;
|
||||||
|
|
||||||
myProcess.Start();
|
myProcess.Start();
|
||||||
myProcess.WaitForExit();
|
myProcess.WaitForExit();
|
||||||
@@ -2381,7 +2361,7 @@ namespace ROEditor
|
|||||||
int cnt = nd.Nodes.Count;
|
int cnt = nd.Nodes.Count;
|
||||||
bool add_dummykid = false;
|
bool add_dummykid = false;
|
||||||
if (cnt > 0) add_dummykid = true;
|
if (cnt > 0) add_dummykid = true;
|
||||||
for (int i = 0; i < cnt; i++)
|
for (int i=0; i<cnt; i++)
|
||||||
nd.Nodes[0].Remove();
|
nd.Nodes[0].Remove();
|
||||||
// if haskids & kids loaded, delete them and add a VLN_DUMMY_FOR_TREE in the
|
// if haskids & kids loaded, delete them and add a VLN_DUMMY_FOR_TREE in the
|
||||||
// tree control if there isn't one. This will sink up tree with xml tree in
|
// tree control if there isn't one. This will sink up tree with xml tree in
|
||||||
@@ -2390,7 +2370,7 @@ namespace ROEditor
|
|||||||
string haskids, kidsloaded;
|
string haskids, kidsloaded;
|
||||||
haskids = curelem.GetAttribute("HasChild");
|
haskids = curelem.GetAttribute("HasChild");
|
||||||
kidsloaded = curelem.GetAttribute("ChildLoaded");
|
kidsloaded = curelem.GetAttribute("ChildLoaded");
|
||||||
if (haskids == "True" && kidsloaded == "True")
|
if (haskids == "True" && kidsloaded == "True" )
|
||||||
{
|
{
|
||||||
VlnXmlElement kid, delkid;
|
VlnXmlElement kid, delkid;
|
||||||
XmlNode ndkid;
|
XmlNode ndkid;
|
||||||
@@ -2400,7 +2380,7 @@ namespace ROEditor
|
|||||||
delkid = null;
|
delkid = null;
|
||||||
if (ndkid is VlnXmlElement)
|
if (ndkid is VlnXmlElement)
|
||||||
{
|
{
|
||||||
kid = (VlnXmlElement)ndkid;
|
kid = (VlnXmlElement) ndkid;
|
||||||
if (kid.HasAttribute("RecID")) delkid = kid;
|
if (kid.HasAttribute("RecID")) delkid = kid;
|
||||||
}
|
}
|
||||||
ndkid = ndkid.NextSibling;
|
ndkid = ndkid.NextSibling;
|
||||||
@@ -2419,13 +2399,13 @@ namespace ROEditor
|
|||||||
private void menuROProperties_Click(object sender, System.EventArgs e)
|
private void menuROProperties_Click(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
roListView_ClearListDisplay();
|
roListView_ClearListDisplay();
|
||||||
bool didcleanup = false; // flags whether we needed to remove elements from trees
|
bool didcleanup=false; // flags whether we needed to remove elements from trees
|
||||||
// to match xml data to tree.
|
// to match xml data to tree.
|
||||||
VlnXmlElement curelem = (VlnXmlElement)roTreeView.SelectedNode.Tag;
|
VlnXmlElement curelem = (VlnXmlElement)roTreeView.SelectedNode.Tag;
|
||||||
LoadKids(roTreeView.SelectedNode);
|
LoadKids(roTreeView.SelectedNode);
|
||||||
if (curelem.Name == "vlnGroup")
|
if (curelem.Name == "vlnGroup")
|
||||||
{
|
{
|
||||||
GroupDefFrm grdef = new GroupDefFrm(curelem, myrodb, roTreeView.SelectedNode.Text, -1);
|
GroupDefFrm grdef = new GroupDefFrm(curelem,myrodb,roTreeView.SelectedNode.Text,-1);
|
||||||
grdef.ShowDialog();
|
grdef.ShowDialog();
|
||||||
|
|
||||||
// if the group text was modified, update the tree. If it was a subgroup,
|
// if the group text was modified, update the tree. If it was a subgroup,
|
||||||
@@ -2457,7 +2437,7 @@ namespace ROEditor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
topele = (VlnXmlElement)topele.NextSibling;
|
topele = (VlnXmlElement) topele.NextSibling;
|
||||||
}
|
}
|
||||||
// if a fieldname changed, we may even have to check the 'top' group nodes
|
// if a fieldname changed, we may even have to check the 'top' group nodes
|
||||||
|
|
||||||
@@ -2472,7 +2452,7 @@ namespace ROEditor
|
|||||||
*/
|
*/
|
||||||
private void menuNewGroup_Click(object sender, System.EventArgs e)
|
private void menuNewGroup_Click(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
VlnXmlElement curelem = (VlnXmlElement)roTreeView.SelectedNode.Tag;
|
VlnXmlElement curelem = (VlnXmlElement) roTreeView.SelectedNode.Tag;
|
||||||
// if this is being added from the top, do a new table and main group.
|
// if this is being added from the top, do a new table and main group.
|
||||||
// otherwise, handle like a new ro.
|
// otherwise, handle like a new ro.
|
||||||
if (curelem.Name == "RO_Root")
|
if (curelem.Name == "RO_Root")
|
||||||
@@ -2487,7 +2467,7 @@ namespace ROEditor
|
|||||||
if (topele.HasAttribute("TreeNotData"))
|
if (topele.HasAttribute("TreeNotData"))
|
||||||
{
|
{
|
||||||
topele.RemoveAttribute("TreeNotData");
|
topele.RemoveAttribute("TreeNotData");
|
||||||
TreeNode topnd = new TreeNode(topele.GetAttribute("MenuTitle"), ROGROUPIMAGE, ROGROUPIMAGE);
|
TreeNode topnd = new TreeNode(topele.GetAttribute("MenuTitle"),ROGROUPIMAGE,ROGROUPIMAGE);
|
||||||
topnd.Tag = topele;
|
topnd.Tag = topele;
|
||||||
roTreeView.SelectedNode.Nodes.Add(topnd);
|
roTreeView.SelectedNode.Nodes.Add(topnd);
|
||||||
roTreeView.Refresh();
|
roTreeView.Refresh();
|
||||||
@@ -2504,7 +2484,7 @@ namespace ROEditor
|
|||||||
MessageBox.Show("Subgroup Definition does not exist, check Subgroup Definition under Properties for the Group that contains this Subgroup.");
|
MessageBox.Show("Subgroup Definition does not exist, check Subgroup Definition under Properties for the Group that contains this Subgroup.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
VlnXmlElement nelem = (VlnXmlElement)curelem.OwnerDocument.CreateElement("vlnGroup");
|
VlnXmlElement nelem = (VlnXmlElement) curelem.OwnerDocument.CreateElement("vlnGroup");
|
||||||
if (curelem.Name != "vlnGroup") // selected new group off ro, add to parent
|
if (curelem.Name != "vlnGroup") // selected new group off ro, add to parent
|
||||||
{
|
{
|
||||||
curelem.ParentNode.AppendChild((XmlNode)nelem);
|
curelem.ParentNode.AppendChild((XmlNode)nelem);
|
||||||
@@ -2513,7 +2493,7 @@ namespace ROEditor
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
curelem.AppendChild(nelem);
|
curelem.AppendChild(nelem);
|
||||||
TreeNewparent = roTreeView.SelectedNode;
|
TreeNewparent=roTreeView.SelectedNode;
|
||||||
}
|
}
|
||||||
newone = nelem;
|
newone = nelem;
|
||||||
|
|
||||||
@@ -2521,7 +2501,7 @@ namespace ROEditor
|
|||||||
int retval = roTreeView_ClearEditDisplay(false);
|
int retval = roTreeView_ClearEditDisplay(false);
|
||||||
if (retval == -1) return;
|
if (retval == -1) return;
|
||||||
roListView_ClearListDisplay();
|
roListView_ClearListDisplay();
|
||||||
CreateCtlXmlEdit2(nelem, myschema, reqfields, null);
|
CreateCtlXmlEdit2(nelem,myschema,reqfields, null);
|
||||||
|
|
||||||
ctlXMLEdit2.Focus();
|
ctlXMLEdit2.Focus();
|
||||||
rbtnSave.Enabled = false; // initial disable the save button
|
rbtnSave.Enabled = false; // initial disable the save button
|
||||||
@@ -2537,7 +2517,7 @@ namespace ROEditor
|
|||||||
private void menuNewRefObj_Click(object sender, System.EventArgs e)
|
private void menuNewRefObj_Click(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
int retval = roTreeView_ClearEditDisplay(false);
|
int retval = roTreeView_ClearEditDisplay(false);
|
||||||
ArrayList InUseApplcList = null;
|
ArrayList InUseApplcList=null;
|
||||||
if (retval == -1) return;
|
if (retval == -1) return;
|
||||||
roListView_ClearListDisplay();
|
roListView_ClearListDisplay();
|
||||||
VlnXmlElement curelem = (VlnXmlElement)roTreeView.SelectedNode.Tag;
|
VlnXmlElement curelem = (VlnXmlElement)roTreeView.SelectedNode.Tag;
|
||||||
@@ -2546,24 +2526,24 @@ namespace ROEditor
|
|||||||
// make a dummy parent which is the 'group' level so that it can be
|
// make a dummy parent which is the 'group' level so that it can be
|
||||||
// associated with a schema.
|
// associated with a schema.
|
||||||
XmlNode parent = curelem.ParentNode;
|
XmlNode parent = curelem.ParentNode;
|
||||||
VlnXmlElement nmele = curelem;
|
VlnXmlElement nmele=curelem;
|
||||||
while (parent.Name != "RO_Root")
|
while (parent.Name != "RO_Root")
|
||||||
{
|
{
|
||||||
nmele = (VlnXmlElement)parent;
|
nmele = (VlnXmlElement) parent;
|
||||||
parent = (VlnXmlElement)parent.ParentNode;
|
parent = (VlnXmlElement) parent.ParentNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the name for the new element...
|
// get the name for the new element...
|
||||||
int indx = nmele.InnerXml.IndexOf("<");
|
int indx = nmele.InnerXml.IndexOf("<");
|
||||||
string nm = null;
|
string nm = null;
|
||||||
if (indx < 0) // not found, just use innerxml
|
if (indx<0) // not found, just use innerxml
|
||||||
nm = nmele.InnerText;
|
nm = nmele.InnerText;
|
||||||
else
|
else
|
||||||
nm = nmele.InnerXml.Substring(0, indx);
|
nm = nmele.InnerXml.Substring(0,indx);
|
||||||
VlnXmlElement nelem = (VlnXmlElement)curelem.OwnerDocument.CreateElement(CvtUserFldToFld(nm));
|
VlnXmlElement nelem = (VlnXmlElement) curelem.OwnerDocument.CreateElement(CvtUserFldToFld(nm));
|
||||||
if (curelem.Name != "vlnGroup") // selected new ro off ro, add to parent
|
if (curelem.Name != "vlnGroup") // selected new ro off ro, add to parent
|
||||||
{
|
{
|
||||||
curelem.ParentNode.AppendChild((XmlNode)nelem);
|
curelem.ParentNode.AppendChild((XmlNode) nelem);
|
||||||
TreeNewparent = roTreeView.SelectedNode.Parent;
|
TreeNewparent = roTreeView.SelectedNode.Parent;
|
||||||
InUseApplcList = GetApplcFieldListForElement(curelem); //C2021-026 get list of fields with P/C enabled
|
InUseApplcList = GetApplcFieldListForElement(curelem); //C2021-026 get list of fields with P/C enabled
|
||||||
}
|
}
|
||||||
@@ -2575,7 +2555,7 @@ namespace ROEditor
|
|||||||
newone = nelem;
|
newone = nelem;
|
||||||
ArrayList reqfields = nelem.GetRequiredFields();
|
ArrayList reqfields = nelem.GetRequiredFields();
|
||||||
|
|
||||||
CreateCtlXmlEdit2(nelem, myschema, reqfields, InUseApplcList);
|
CreateCtlXmlEdit2(nelem,myschema,reqfields, InUseApplcList);
|
||||||
ctlXMLEdit2.Focus();
|
ctlXMLEdit2.Focus();
|
||||||
|
|
||||||
rbtnSave.Enabled = false; // initial disable the save button
|
rbtnSave.Enabled = false; // initial disable the save button
|
||||||
@@ -2672,16 +2652,16 @@ namespace ROEditor
|
|||||||
{
|
{
|
||||||
topele.RemoveAttribute("TreeNotData");
|
topele.RemoveAttribute("TreeNotData");
|
||||||
int cnt = rootNode.GetNodeCount(false);
|
int cnt = rootNode.GetNodeCount(false);
|
||||||
for (int i = 0; i < cnt; i++)
|
for(int i=0;i<cnt;i++)
|
||||||
{
|
{
|
||||||
TreeNode nd = rootNode.Nodes[i];
|
TreeNode nd = rootNode.Nodes[i];
|
||||||
if (nd.Tag == topele)
|
if (nd.Tag == topele)
|
||||||
{
|
{
|
||||||
CleanUpTree(topele, nd);
|
CleanUpTree(topele,nd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
topele = (VlnXmlElement)topele.NextSibling;
|
topele = (VlnXmlElement) topele.NextSibling;
|
||||||
}
|
}
|
||||||
// if a fieldname changed, we may even have to check the 'top' group nodes
|
// if a fieldname changed, we may even have to check the 'top' group nodes
|
||||||
|
|
||||||
@@ -2705,7 +2685,7 @@ namespace ROEditor
|
|||||||
*/
|
*/
|
||||||
private void menuROEdit_Click(object sender, System.EventArgs e)
|
private void menuROEdit_Click(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
roTreeView_OnDoubleClick(sender, e);
|
roTreeView_OnDoubleClick (sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2812,25 +2792,25 @@ namespace ROEditor
|
|||||||
// check for duplicates on accessory page id, if it changed.
|
// check for duplicates on accessory page id, if it changed.
|
||||||
string acctmpl = myro.GetAccPageIDTemplate();
|
string acctmpl = myro.GetAccPageIDTemplate();
|
||||||
string newacc = myro.GetAccPageIDString(acctmpl);
|
string newacc = myro.GetAccPageIDString(acctmpl);
|
||||||
if (newacc == null) return false;
|
if (newacc==null)return false;
|
||||||
if (newone != null) // if this is new, set the table for accpageid check
|
if (newone != null) // if this is new, set the table for accpageid check
|
||||||
{
|
{
|
||||||
XmlNode nd = (XmlNode)myro.ParentNode;
|
XmlNode nd = (XmlNode) myro.ParentNode;
|
||||||
VlnXmlElement end = (VlnXmlElement)nd;
|
VlnXmlElement end = (VlnXmlElement) nd;
|
||||||
string tb = end.GetAttribute("Table");
|
string tb = end.GetAttribute("Table");
|
||||||
myro.SetAttribute("Table", tb);
|
myro.SetAttribute("Table",tb);
|
||||||
}
|
}
|
||||||
string t1 = newacc.Trim();
|
string t1 = newacc.Trim();
|
||||||
string t2 = myro.GetAttribute("AccPageID");
|
string t2 = myro.GetAttribute("AccPageID");
|
||||||
string t3 = t2.Trim();
|
string t3 = t2.Trim();
|
||||||
if (t1 != t3)
|
if (t1 != t3)
|
||||||
{
|
{
|
||||||
if (myrodb.IsDuplicateAccPageID(myro, newacc) == true)
|
if (myrodb.IsDuplicateAccPageID(myro,newacc)== true)
|
||||||
{
|
{
|
||||||
MessageBox.Show("The fields used for the \"Accessory Pages Access\" values must be unique. The fields used in these values can be found under \"Properties\" of an RO Group. Cannot save.", "Problem saving data");
|
MessageBox.Show("The fields used for the \"Accessory Pages Access\" values must be unique. The fields used in these values can be found under \"Properties\" of an RO Group. Cannot save.","Problem saving data");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
myro.SetAttribute("AccPageID", myro.GetAccPageIDString(acctmpl));
|
myro.SetAttribute("AccPageID", myro.GetAccPageIDString(acctmpl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2854,8 +2834,8 @@ namespace ROEditor
|
|||||||
success = myrodb.RODB_InsertRO(myro);
|
success = myrodb.RODB_InsertRO(myro);
|
||||||
if (success == true)
|
if (success == true)
|
||||||
{
|
{
|
||||||
int img = (myro.Name == "vlnGroup") ? ROGROUPIMAGE : ROIMAGE;
|
int img = (myro.Name=="vlnGroup")?ROGROUPIMAGE:ROIMAGE;
|
||||||
newt = new TreeNode(mnutitle, img, img);
|
newt = new TreeNode(mnutitle,img,img);
|
||||||
newt.Tag = myro;
|
newt.Tag = myro;
|
||||||
newt.Name = myro.GetAttribute("RecID");
|
newt.Name = myro.GetAttribute("RecID");
|
||||||
newt.Text = Regex.Replace(newt.Text, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003
|
newt.Text = Regex.Replace(newt.Text, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); // RO Editor add symbols C2022 - 003
|
||||||
@@ -2864,9 +2844,10 @@ 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
|
||||||
}
|
}
|
||||||
newone = null;
|
newone = null;
|
||||||
return true;
|
return true;
|
||||||
@@ -2908,8 +2889,8 @@ namespace ROEditor
|
|||||||
{
|
{
|
||||||
bool dup;
|
bool dup;
|
||||||
bool success;
|
bool success;
|
||||||
VlnXmlElement newro = (VlnXmlElement)roTreeView.SelectedNode.Tag;
|
VlnXmlElement newro = (VlnXmlElement) roTreeView.SelectedNode.Tag;
|
||||||
VlnXmlElement origro = (VlnXmlElement)newro.Clone();
|
VlnXmlElement origro = (VlnXmlElement) newro.Clone();
|
||||||
string savedInnerXML = newro.InnerXml;
|
string savedInnerXML = newro.InnerXml;
|
||||||
XmlNode parent = newro.ParentNode;
|
XmlNode parent = newro.ParentNode;
|
||||||
success = ctlXMLEdit2.SaveData();
|
success = ctlXMLEdit2.SaveData();
|
||||||
@@ -2935,7 +2916,7 @@ namespace ROEditor
|
|||||||
// ros (which is what we have hear for saveas or duplicate)
|
// ros (which is what we have hear for saveas or duplicate)
|
||||||
newro.RemoveAttribute("RecID");
|
newro.RemoveAttribute("RecID");
|
||||||
dup = myrodb.IsDuplicateAccPageID(newro, newacc);
|
dup = myrodb.IsDuplicateAccPageID(newro, newacc);
|
||||||
newro.SetAttribute("RecID", savrec);
|
newro.SetAttribute("RecID",savrec);
|
||||||
if (dup == true)
|
if (dup == true)
|
||||||
{
|
{
|
||||||
MessageBox.Show("The fields used for the \"Accessory Pages Access\" values must be unique. The fields used in these values can be found under \"Properties\" of an RO Group. Cannot save.", "Problem saving data");
|
MessageBox.Show("The fields used for the \"Accessory Pages Access\" values must be unique. The fields used in these values can be found under \"Properties\" of an RO Group. Cannot save.", "Problem saving data");
|
||||||
@@ -2948,19 +2929,19 @@ namespace ROEditor
|
|||||||
else
|
else
|
||||||
mnutmp = newro.GetMenuValueTemplate("GroupMenuItem");
|
mnutmp = newro.GetMenuValueTemplate("GroupMenuItem");
|
||||||
string mnutitle = newro.GetMenuString(mnutmp, false);
|
string mnutitle = newro.GetMenuString(mnutmp, false);
|
||||||
parent.AppendChild((XmlNode)origro); // need this for duplicate check.
|
parent.AppendChild((XmlNode) origro); // need this for duplicate check.
|
||||||
dup = newro.IsDuplicateMenuTitle(mnutitle);
|
dup = newro.IsDuplicateMenuTitle(mnutitle);
|
||||||
if (dup == true)
|
if (dup==true)
|
||||||
{
|
{
|
||||||
MessageBox.Show("The fields used for the \"Menu\" values must be unique. The fields used in these values can be found under \"Properties\" of an RO Group. Cannot save.", "Problem saving data");
|
MessageBox.Show("The fields used for the \"Menu\" values must be unique. The fields used in these values can be found under \"Properties\" of an RO Group. Cannot save.","Problem saving data");
|
||||||
parent.RemoveChild(origro);
|
parent.RemoveChild(origro);
|
||||||
rbtnRestore.Enabled = false;
|
rbtnRestore.Enabled = false;
|
||||||
ctlXMLEdit2.SetNotSaved();
|
ctlXMLEdit2.SetNotSaved();
|
||||||
ctlXMLEdit2.RestoreInnerXml(savedInnerXML); //B2017-089 - restore the inner xml so orignial does not get new changes
|
ctlXMLEdit2.RestoreInnerXml(savedInnerXML); //B2017-089 - restore the inner xml so orignial does not get new changes
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (acctmpl != null) newro.SetAttribute("AccPageID", newro.GetAccPageIDString(acctmpl));
|
if (acctmpl!=null)newro.SetAttribute("AccPageID", newro.GetAccPageIDString(acctmpl));
|
||||||
newro.SetAttribute("MenuTitle", mnutitle);
|
newro.SetAttribute("MenuTitle",mnutitle);
|
||||||
newro.RemoveAttribute("RecID"); // get a new one.
|
newro.RemoveAttribute("RecID"); // get a new one.
|
||||||
|
|
||||||
success = myrodb.RODB_InsertRO(newro);
|
success = myrodb.RODB_InsertRO(newro);
|
||||||
@@ -2998,7 +2979,7 @@ namespace ROEditor
|
|||||||
rbtnDuplicate.Enabled = false;
|
rbtnDuplicate.Enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void tbar_ZoomClick(object sender, System.EventArgs e)
|
protected void tbar_ZoomClick(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
ctlXMLEdit2.btnZoom_click(sender, e);
|
ctlXMLEdit2.btnZoom_click(sender, e);
|
||||||
|
|
||||||
@@ -3039,7 +3020,7 @@ namespace ROEditor
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ele.Name != "vlnGroup" && attop == false)
|
if (ele.Name != "vlnGroup" && attop==false)
|
||||||
EditRO(ele);
|
EditRO(ele);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3047,7 +3028,7 @@ namespace ROEditor
|
|||||||
private void DisplayGroupElements(VlnXmlElement selele)
|
private void DisplayGroupElements(VlnXmlElement selele)
|
||||||
{
|
{
|
||||||
ROField rof;
|
ROField rof;
|
||||||
string nm, tmp = null;
|
string nm, tmp=null;
|
||||||
roListView.Clear();
|
roListView.Clear();
|
||||||
bool AllGroups = true;
|
bool AllGroups = true;
|
||||||
ArrayList InUseList = null;
|
ArrayList InUseList = null;
|
||||||
@@ -3061,9 +3042,9 @@ namespace ROEditor
|
|||||||
// Put out fields and their associated data.
|
// Put out fields and their associated data.
|
||||||
if (InUseList != null)
|
if (InUseList != null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < InUseList.Count; i++)
|
for (int i=0;i< InUseList.Count; i++)
|
||||||
{
|
{
|
||||||
rof = (ROField)InUseList[i];
|
rof = (ROField) InUseList[i];
|
||||||
if (rof.GetFieldname != null)
|
if (rof.GetFieldname != null)
|
||||||
{
|
{
|
||||||
uint ftype = rof.GetFieldType;
|
uint ftype = rof.GetFieldType;
|
||||||
@@ -3081,7 +3062,7 @@ namespace ROEditor
|
|||||||
{
|
{
|
||||||
if (curnd is VlnXmlElement)
|
if (curnd is VlnXmlElement)
|
||||||
{
|
{
|
||||||
VlnXmlElement curele = (VlnXmlElement)curnd;
|
VlnXmlElement curele = (VlnXmlElement) curnd;
|
||||||
if (curele.Name == "vlnGroup")
|
if (curele.Name == "vlnGroup")
|
||||||
{
|
{
|
||||||
if (selele.Name == "RO_Root")
|
if (selele.Name == "RO_Root")
|
||||||
@@ -3096,14 +3077,14 @@ namespace ROEditor
|
|||||||
{
|
{
|
||||||
int levelcnt = curele.ChildNodes.Count;
|
int levelcnt = curele.ChildNodes.Count;
|
||||||
string TheMenuTitle = curele.GetAttribute("MenuTitle");
|
string TheMenuTitle = curele.GetAttribute("MenuTitle");
|
||||||
if ((levelcnt > 1) || (levelcnt == 1 && !TheMenuTitle.Equals("")))
|
if ((levelcnt > 1) || (levelcnt==1 && !TheMenuTitle.Equals("")))
|
||||||
{
|
{
|
||||||
AllGroups = false;
|
AllGroups = false;
|
||||||
ListViewItem item = null;
|
ListViewItem item=null;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
for (int i = 0; i < InUseList.Count; i++)
|
for (int i = 0; i < InUseList.Count; i++)
|
||||||
{
|
{
|
||||||
rof = (ROField)InUseList[i];
|
rof = (ROField) InUseList[i];
|
||||||
if (rof.GetFieldname != null)
|
if (rof.GetFieldname != null)
|
||||||
{
|
{
|
||||||
uint ftype = rof.GetFieldType;
|
uint ftype = rof.GetFieldType;
|
||||||
@@ -3145,16 +3126,16 @@ namespace ROEditor
|
|||||||
if (AllGroups == true)
|
if (AllGroups == true)
|
||||||
{
|
{
|
||||||
roListView.Columns.Clear();
|
roListView.Columns.Clear();
|
||||||
roListView.Columns.Add("Group", 250, HorizontalAlignment.Left);
|
roListView.Columns.Add("Group",250,HorizontalAlignment.Left);
|
||||||
}
|
}
|
||||||
|
|
||||||
roListView.Visible = true;
|
roListView.Visible=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateRoListView(TreeNode node)
|
private void updateRoListView(TreeNode node)
|
||||||
{
|
{
|
||||||
VlnXmlElement selele;
|
VlnXmlElement selele;
|
||||||
selele = (VlnXmlElement)node.Tag;
|
selele = (VlnXmlElement) node.Tag;
|
||||||
if (selele.Name != "vlnGroup" && selele.Name != "RO_Root")
|
if (selele.Name != "vlnGroup" && selele.Name != "RO_Root")
|
||||||
{
|
{
|
||||||
// if we already have a list view, and we're still under the same parent,
|
// if we already have a list view, and we're still under the same parent,
|
||||||
@@ -3163,7 +3144,7 @@ namespace ROEditor
|
|||||||
if (roListView != null && roListView.Items.Count > 0)
|
if (roListView != null && roListView.Items.Count > 0)
|
||||||
{
|
{
|
||||||
curele = (VlnXmlElement)roListView.Items[0].Tag;
|
curele = (VlnXmlElement)roListView.Items[0].Tag;
|
||||||
if (selele.ParentNode != curele.ParentNode) roListView_ClearListDisplay();
|
if (selele.ParentNode != curele.ParentNode)roListView_ClearListDisplay();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -3196,7 +3177,7 @@ namespace ROEditor
|
|||||||
void roListView_Column_Header_OnClick(object sender, ColumnClickEventArgs e)
|
void roListView_Column_Header_OnClick(object sender, ColumnClickEventArgs e)
|
||||||
{
|
{
|
||||||
int indx = e.Column;
|
int indx = e.Column;
|
||||||
MyListViewComparer LVCompare = (MyListViewComparer)roListView.ListViewItemSorter;
|
MyListViewComparer LVCompare = (MyListViewComparer) roListView.ListViewItemSorter;
|
||||||
LVCompare.SetColumnToSortBy(indx);
|
LVCompare.SetColumnToSortBy(indx);
|
||||||
roListView.Sort();
|
roListView.Sort();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,12 +116,12 @@ namespace ROEditor
|
|||||||
public uint thisoff;
|
public uint thisoff;
|
||||||
public string title;
|
public string title;
|
||||||
|
|
||||||
public FstTmpSTRC(ushort type, uint offset, string tl)
|
public FstTmpSTRC(ushort type, uint offset, string tl)
|
||||||
{
|
{
|
||||||
thistype = type;
|
thistype = type;
|
||||||
thisoff = offset;
|
thisoff = offset;
|
||||||
title = tl;
|
title = tl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteString(BinaryWriter bw, string str)
|
void WriteString(BinaryWriter bw, string str)
|
||||||
{
|
{
|
||||||
@@ -150,7 +150,7 @@ namespace ROEditor
|
|||||||
bw.Write(thisoff);
|
bw.Write(thisoff);
|
||||||
bw.Write(thistype);
|
bw.Write(thistype);
|
||||||
WriteString(bw,title);
|
WriteString(bw,title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Sorted Array was not sorting via the ASCII value of each character in a given string.
|
// The Sorted Array was not sorting via the ASCII value of each character in a given string.
|
||||||
@@ -565,8 +565,8 @@ namespace ROEditor
|
|||||||
string RecIdStr = elem.GetAttribute("RecID");
|
string RecIdStr = elem.GetAttribute("RecID");
|
||||||
curRecID = System.Convert.ToUInt32(RecIdStr,16);
|
curRecID = System.Convert.ToUInt32(RecIdStr,16);
|
||||||
|
|
||||||
// Get the current node's parent id
|
// Get the current node's parent id
|
||||||
string ParIdStr = elem.GetAttribute("ParentID");
|
string ParIdStr = elem.GetAttribute("ParentID");
|
||||||
elemParentID = Convert.ToUInt32(ParIdStr,16);
|
elemParentID = Convert.ToUInt32(ParIdStr,16);
|
||||||
|
|
||||||
string HasKids = elem.GetAttribute("HasChild");
|
string HasKids = elem.GetAttribute("HasChild");
|
||||||
@@ -771,8 +771,8 @@ namespace ROEditor
|
|||||||
private ushort SaveROToFST(XmlNode RONode,ArrayList InUseList,string RtnValTmplate, string AccPageIDTplate)
|
private ushort SaveROToFST(XmlNode RONode,ArrayList InUseList,string RtnValTmplate, string AccPageIDTplate)
|
||||||
{
|
{
|
||||||
ushort RtnVal;
|
ushort RtnVal;
|
||||||
uint startFST = (uint)fhFST.BaseStream.Position;
|
uint startFST = (uint)fhFST.BaseStream.Position;
|
||||||
uint RORecID;
|
uint RORecID;
|
||||||
uint ParID;
|
uint ParID;
|
||||||
byte nullbyte=0;
|
byte nullbyte=0;
|
||||||
|
|
||||||
@@ -844,8 +844,12 @@ namespace ROEditor
|
|||||||
AccPageID = " ";
|
AccPageID = " ";
|
||||||
WriteString(AccPageID);
|
WriteString(AccPageID);
|
||||||
|
|
||||||
// Save the ID and offset entry for the current ID
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
IdsAndOffsets.Add(RORecID,startFST);
|
string moddt = ROdatabase.RODB_GetModDateTime(elem.GetAttribute("RecID"), elem.GetAttribute("Table"));
|
||||||
|
if (!string.IsNullOrEmpty(moddt)) WriteString(moddt);
|
||||||
|
|
||||||
|
// Save the ID and offset entry for the current ID
|
||||||
|
IdsAndOffsets.Add(RORecID, startFST);
|
||||||
|
|
||||||
// Save the RecID and Accessory Page id
|
// Save the RecID and Accessory Page id
|
||||||
IdsAndAccPgIds[AccPageID] = RORecID;
|
IdsAndAccPgIds[AccPageID] = RORecID;
|
||||||
@@ -884,3 +888,4 @@ namespace ROEditor
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -322,9 +322,9 @@ namespace RODBInterface
|
|||||||
get { return _PCChildList; }
|
get { return _PCChildList; }
|
||||||
set { _PCChildList = value; }
|
set { _PCChildList = value; }
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region abstracts // need these for each method that must be defined for each database type
|
#region abstracts // need these for each method that must be defined for each database type
|
||||||
public abstract string RODB_GetNextGroupTable();
|
public abstract string RODB_GetNextGroupTable();
|
||||||
public abstract string RODB_GetNextRecId(string table);
|
public abstract string RODB_GetNextRecId(string table);
|
||||||
public abstract bool RODB_GetRootGroups(VlnXmlElement root);
|
public abstract bool RODB_GetRootGroups(VlnXmlElement root);
|
||||||
public abstract bool RODB_DeleteGroup(XmlNode group, string tbname, string toprecid);
|
public abstract bool RODB_DeleteGroup(XmlNode group, string tbname, string toprecid);
|
||||||
@@ -355,9 +355,10 @@ namespace RODBInterface
|
|||||||
public abstract string RODB_GetDBServerForAbout();
|
public abstract string RODB_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);
|
||||||
#endregion
|
public abstract string RODB_GetModDateTime(string Recid, string table);
|
||||||
|
#endregion
|
||||||
|
|
||||||
public RODB()
|
public RODB()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2142,7 +2143,20 @@ namespace RODBInterface
|
|||||||
wraccid = accid;
|
wraccid = accid;
|
||||||
string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now);
|
string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now);
|
||||||
string xmlstr = GenerateXmlString(ro, false);
|
string xmlstr = GenerateXmlString(ro, false);
|
||||||
string strUpdate = "UPDATE " + ro.GetAttribute("Table") + " SET Info = '" + xmlstr + "'";
|
StringBuilder xmlstrTmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly.
|
||||||
|
char[] chrAry = xmlstr.ToCharArray();
|
||||||
|
foreach (int chr in chrAry)
|
||||||
|
{
|
||||||
|
if (chr > 166)
|
||||||
|
{
|
||||||
|
xmlstrTmp.Append($"\\u{(int)chr}?");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
xmlstrTmp.Append((char)chr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
string strUpdate = "UPDATE " + ro.GetAttribute("Table") + " SET Info = '" + xmlstrTmp.ToString() + "'";
|
||||||
if (movedRO)
|
if (movedRO)
|
||||||
{
|
{
|
||||||
VlnXmlElement parent = (VlnXmlElement)ro.ParentNode;
|
VlnXmlElement parent = (VlnXmlElement)ro.ParentNode;
|
||||||
@@ -2186,6 +2200,20 @@ namespace RODBInterface
|
|||||||
}
|
}
|
||||||
string xmlstr = GenerateXmlString(ro, false);
|
string xmlstr = GenerateXmlString(ro, false);
|
||||||
|
|
||||||
|
StringBuilder xmlstrTmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly.
|
||||||
|
char[] chrAry = xmlstr.ToCharArray();
|
||||||
|
foreach (int chr in chrAry)
|
||||||
|
{
|
||||||
|
if (chr > 166)
|
||||||
|
{
|
||||||
|
xmlstrTmp.Append($"\\u{(int)chr}?");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
xmlstrTmp.Append((char)chr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
string wraccid = null;
|
string wraccid = null;
|
||||||
if (ro.HasAttribute("AccPageID"))
|
if (ro.HasAttribute("AccPageID"))
|
||||||
{
|
{
|
||||||
@@ -2209,13 +2237,13 @@ namespace RODBInterface
|
|||||||
// strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageID, ModDateTime, Info ) ";
|
// strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageID, ModDateTime, Info ) ";
|
||||||
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, AccPageID, Info ) ";
|
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, AccPageID, Info ) ";
|
||||||
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");
|
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");
|
||||||
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');";
|
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp.ToString() + "');";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, Info ) ";
|
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, Info ) ";
|
||||||
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");
|
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");
|
||||||
strInsert = strInsert + "','" + dt + "','" + xmlstr + "');";
|
strInsert = strInsert + "','" + dt + "','" + xmlstrTmp.ToString() + "');";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2223,7 +2251,7 @@ namespace RODBInterface
|
|||||||
{
|
{
|
||||||
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageId, ModDateTime, Info ) ";
|
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageId, ModDateTime, Info ) ";
|
||||||
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.RRO + ",'" + ro.GetAttribute("ParentID");
|
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.RRO + ",'" + ro.GetAttribute("ParentID");
|
||||||
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');";
|
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp.ToString() + "');";
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -2355,9 +2383,9 @@ namespace RODBInterface
|
|||||||
RecID = DBE.GetString(0);
|
RecID = DBE.GetString(0);
|
||||||
MyRecID = RecID;
|
MyRecID = RecID;
|
||||||
Info = DBE.GetString(1);
|
Info = DBE.GetString(1);
|
||||||
// it's defined in the local table if the first character is "<" which starts
|
// it's defined in the local table if the first character is "<" which starts
|
||||||
// the schema definition string.
|
// the schema definition string.
|
||||||
if ("<" == Info.Substring(0, 1))
|
if ("<" == Info.Substring(0, 1))
|
||||||
{
|
{
|
||||||
name = ParseEleName(Info);
|
name = ParseEleName(Info);
|
||||||
if (name != null)
|
if (name != null)
|
||||||
@@ -2398,7 +2426,7 @@ namespace RODBInterface
|
|||||||
return retlist;
|
return retlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string RODB_GetSchemaPiece(string Recid, string table)
|
public override string RODB_GetSchemaPiece(string Recid, string table)
|
||||||
{
|
{
|
||||||
string strGetSchemaPiece;
|
string strGetSchemaPiece;
|
||||||
string Info;
|
string Info;
|
||||||
@@ -2631,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();
|
||||||
@@ -3041,7 +3083,28 @@ 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1803,9 +1803,9 @@ namespace RODBInterface
|
|||||||
RecID = reader.GetString(0);
|
RecID = reader.GetString(0);
|
||||||
MyRecID = RecID;
|
MyRecID = RecID;
|
||||||
Info = reader.GetString(1);
|
Info = reader.GetString(1);
|
||||||
// it's defined in the local table if the first character is "<" which starts
|
// it's defined in the local table if the first character is "<" which starts
|
||||||
// the schema definition string.
|
// the schema definition string.
|
||||||
if ("<" == Info.Substring(0, 1))
|
if ("<" == Info.Substring(0, 1))
|
||||||
{
|
{
|
||||||
name = ParseEleName(Info);
|
name = ParseEleName(Info);
|
||||||
if (name != null)
|
if (name != null)
|
||||||
@@ -1859,9 +1859,9 @@ namespace RODBInterface
|
|||||||
RecID = reader.GetString(0);
|
RecID = reader.GetString(0);
|
||||||
MyRecID = RecID;
|
MyRecID = RecID;
|
||||||
Info = reader.GetString(1);
|
Info = reader.GetString(1);
|
||||||
// it's defined in the local table if the first character is "<" which starts
|
// it's defined in the local table if the first character is "<" which starts
|
||||||
// the schema definition string.
|
// the schema definition string.
|
||||||
if ("<" == Info.Substring(0, 1))
|
if ("<" == Info.Substring(0, 1))
|
||||||
{
|
{
|
||||||
name = ParseEleName(Info);
|
name = ParseEleName(Info);
|
||||||
if (name != null)
|
if (name != null)
|
||||||
@@ -2653,8 +2653,36 @@ namespace RODBInterface
|
|||||||
}
|
}
|
||||||
return GrpCnt;
|
return GrpCnt;
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
public static bool TestConnect(string constring)
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
|
//Get the Modification Date / Time for the RO
|
||||||
|
public override string RODB_GetModDateTime(string Recid, string table)
|
||||||
|
{
|
||||||
|
using (SqlConnection connection = new SqlConnection(strDatabaseConnectionCommand))
|
||||||
|
{
|
||||||
|
connection.Open();
|
||||||
|
using (SqlCommand command = connection.CreateCommand())
|
||||||
|
{
|
||||||
|
command.CommandText = $"SELECT ModDateTime FROM ROALL WHERE RecID = @Value AND ROTable = @table";
|
||||||
|
command.Parameters.Add(new SqlParameter
|
||||||
|
{
|
||||||
|
SqlDbType = SqlDbType.VarChar,
|
||||||
|
ParameterName = "@Value",
|
||||||
|
Value = Recid
|
||||||
|
});
|
||||||
|
command.Parameters.Add(new SqlParameter
|
||||||
|
{
|
||||||
|
SqlDbType = SqlDbType.VarChar,
|
||||||
|
ParameterName = "@table",
|
||||||
|
Value = table
|
||||||
|
});
|
||||||
|
|
||||||
|
return command.ExecuteScalar().ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
public static bool TestConnect(string constring)
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
using (SqlConnection connection = new SqlConnection(constring))
|
using (SqlConnection connection = new SqlConnection(constring))
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ using System.IO;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using ROFields;
|
using ROFields;
|
||||||
using VlnStatus;
|
using VlnStatus;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
//using VlnProfiler; //don't forget to add VlnProfiler to the reference list
|
//using VlnProfiler; //don't forget to add VlnProfiler to the reference list
|
||||||
|
|
||||||
namespace RODBInterface
|
namespace RODBInterface
|
||||||
@@ -517,6 +518,7 @@ namespace RODBInterface
|
|||||||
strtmp.Append(" ");
|
strtmp.Append(" ");
|
||||||
cnt++;
|
cnt++;
|
||||||
}
|
}
|
||||||
|
text = Regex.Replace(text, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); //B2026-025 Unicode removed from RO menu titles in treeview.
|
||||||
if ((cnt + text.Length) > frmt2) // longer than the field length?
|
if ((cnt + text.Length) > frmt2) // longer than the field length?
|
||||||
strtmp.Append(text.Substring(0,frmt2-cnt));
|
strtmp.Append(text.Substring(0,frmt2-cnt));
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -149,3 +149,4 @@ namespace ctlXMLEditLib
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -497,7 +497,7 @@ namespace ctlXMLEditLib
|
|||||||
foreach (string str in myHT.Keys)
|
foreach (string str in myHT.Keys)
|
||||||
{
|
{
|
||||||
o = myHT[str];
|
o = myHT[str];
|
||||||
hwnd = (roRichTextBox)o;
|
hwnd = (roRichTextBox) o;
|
||||||
nd = node.SelectSingleNode(str);
|
nd = node.SelectSingleNode(str);
|
||||||
// if not found with just the string, search the tree.
|
// if not found with just the string, search the tree.
|
||||||
if (nd==null)nd = node.SelectSingleNode("*/"+str);
|
if (nd==null)nd = node.SelectSingleNode("*/"+str);
|
||||||
@@ -966,7 +966,7 @@ namespace ctlXMLEditLib
|
|||||||
{
|
{
|
||||||
mytextbox.Multiline = true;
|
mytextbox.Multiline = true;
|
||||||
mytextbox.AcceptsTab = true;
|
mytextbox.AcceptsTab = true;
|
||||||
mytextbox.Height = (int)mytextbox.Font.GetHeight() * 4;
|
mytextbox.Height = (int) mytextbox.Font.GetHeight() * 4;
|
||||||
mytextbox.ScrollBars = RichTextBoxScrollBars.Vertical;
|
mytextbox.ScrollBars = RichTextBoxScrollBars.Vertical;
|
||||||
zmtooltip.SetToolTip(mytextbox, "Press Shift F2 To Zoom");
|
zmtooltip.SetToolTip(mytextbox, "Press Shift F2 To Zoom");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace ctlXMLEditLib
|
|||||||
public void InsertSymbol( int symbcode)
|
public void InsertSymbol( int symbcode)
|
||||||
{
|
{
|
||||||
int position = this.SelectionStart;
|
int position = this.SelectionStart;
|
||||||
string sym = string.Format(symbcode < 256 ? "\'{0:X2}" : @"\u{0}", symbcode);
|
string sym = symbcode < 256 ? ((char)symbcode).ToString() : string.Format(@"\u{0}", symbcode);
|
||||||
this.SelectedRtf = RtfPrefixForSymbols + sym + @"}";
|
this.SelectedRtf = RtfPrefixForSymbols + sym + @"}";
|
||||||
Select(position, -1);
|
Select(position, -1);
|
||||||
Select(position + 1, 0);
|
Select(position + 1, 0);
|
||||||
@@ -97,3 +97,4 @@ namespace ctlXMLEditLib
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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,10 +80,10 @@ 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
|
||||||
{
|
{
|
||||||
string filename = MSAccessPath + @"\RoEditor.own";
|
string filename = MSAccessPath + @"\RoEditor.own";
|
||||||
fiown = new FileInfo(filename);
|
fiown = new FileInfo(filename);
|
||||||
@@ -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,8 +122,8 @@ 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);
|
||||||
string who = tr.ReadToEnd();
|
string who = tr.ReadToEnd();
|
||||||
@@ -154,25 +134,20 @@ namespace RoAccessToSql
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
static string _ErrorLogFileName;
|
|
||||||
public static string ErrorLogFileName
|
public static string ErrorLogFileName { get; set; }
|
||||||
{
|
// make error log file name (uses same logic as proms error log)
|
||||||
get { return _ErrorLogFileName; }
|
static bool ChangeLogFileName(string AppenderName, string NewFilename)
|
||||||
set { _ErrorLogFileName = value; }
|
|
||||||
}
|
|
||||||
// make error log file name (uses same logic as proms error log)
|
|
||||||
static bool ChangeLogFileName(string AppenderName, string NewFilename)
|
|
||||||
{
|
{
|
||||||
log4net.Repository.ILoggerRepository RootRep;
|
log4net.Repository.ILoggerRepository RootRep;
|
||||||
RootRep = log4net.LogManager.GetRepository();
|
RootRep = log4net.LogManager.GetRepository();
|
||||||
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,11 +249,10 @@ 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);
|
OleDbDataReader reader = command.ExecuteReader();
|
||||||
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;
|
||||||
int maxCntDb = 0;
|
int maxCntDb = 0;
|
||||||
while (reader.Read()) // reading from Access Database
|
while (reader.Read()) // reading from Access Database
|
||||||
@@ -303,13 +277,12 @@ 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)
|
||||||
{
|
{
|
||||||
lastTimeRos = DateTime.Now;
|
lastTimeRos = DateTime.Now;
|
||||||
cntRo = 0;
|
cntRo = 0;
|
||||||
@@ -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,13 +348,12 @@ 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,7 +365,8 @@ namespace RoAccessToSql
|
|||||||
}
|
}
|
||||||
return retcnt;
|
return retcnt;
|
||||||
}
|
}
|
||||||
DateTime ProgressBarUpdate(DevComponents.DotNetBar.Controls.ProgressBarX pbi, string msg, int min, int max, int progress, int flag, DateTime lastUpdateDisplay, bool doTimeCheck)
|
[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)
|
||||||
{
|
{
|
||||||
if (flag == 0) // setup
|
if (flag == 0) // setup
|
||||||
pbi.Maximum = max;
|
pbi.Maximum = max;
|
||||||
@@ -412,11 +385,13 @@ 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,
|
||||||
command.Parameters.AddWithValue("@RecType", RecType);
|
CommandText = "insertAllRectypes"
|
||||||
|
};
|
||||||
|
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);
|
||||||
else
|
else
|
||||||
@@ -428,9 +403,8 @@ 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;
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -438,32 +412,15 @@ 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();
|
||||||
{
|
// the user selected the button to test the sql connection string
|
||||||
this.Close();
|
private void btnTestConnect_Click(object sender, EventArgs e) => TestConnection(true);
|
||||||
}
|
|
||||||
// the user selected the button to test the sql connection string
|
public static DateTime RevDate { get; set; } = DateTime.MinValue;
|
||||||
private void btnTestConnect_Click(object sender, EventArgs e)
|
public static string RevDescription { get; set; } = "Unknown";
|
||||||
{
|
// This is called to test the sql connection, either from the button when pressed by user, or from the convert button, before
|
||||||
TestConnection(true);
|
// the conversion is done. See below for what is checked
|
||||||
}
|
private bool TestConnection(bool notifyUser)
|
||||||
// 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
|
|
||||||
// the conversion is done. See below for what is checked
|
|
||||||
private bool TestConnection(bool notifyUser)
|
|
||||||
{
|
{
|
||||||
// The following conditions must be true in order to migrate the ro data to sql. Only the first condition can be
|
// The following conditions must be true in order to migrate the ro data to sql. Only the first condition can be
|
||||||
// tested in this executable since the roall database is interfaced to by the roeditor & the program that migrates the data.
|
// tested in this executable since the roall database is interfaced to by the roeditor & the program that migrates the data.
|
||||||
@@ -485,12 +442,14 @@ namespace RoAccessToSql
|
|||||||
connection.Open();
|
connection.Open();
|
||||||
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,
|
||||||
using (SqlDataReader reader = command.ExecuteReader())
|
CommandText = "(SELECT count(*) FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ROALL]') AND type in (N'U'))"
|
||||||
|
};
|
||||||
|
using (SqlDataReader reader = command.ExecuteReader())
|
||||||
{
|
{
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
{
|
{
|
||||||
@@ -509,11 +468,13 @@ 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,
|
||||||
using (SqlDataReader reader = command.ExecuteReader())
|
CommandText = "(SELECT count(*) FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteByROTable]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)"
|
||||||
|
};
|
||||||
|
using (SqlDataReader reader = command.ExecuteReader())
|
||||||
{
|
{
|
||||||
if (reader.Read())
|
if (reader.Read())
|
||||||
{
|
{
|
||||||
@@ -533,11 +494,13 @@ 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,
|
||||||
using (SqlDataReader reader = command.ExecuteReader())
|
CommandText = "SELECT count(*) FROM roall"
|
||||||
|
};
|
||||||
|
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,
|
||||||
using (SqlDataReader reader = command.ExecuteReader())
|
CommandText = "vesp_GetSQLCodeRevision"
|
||||||
|
};
|
||||||
|
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,82 +52,41 @@ 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
|
/// <summary>
|
||||||
{
|
/// Returns the number of columns, or the horizontal / X count,
|
||||||
get { return _MaxRows; }
|
/// of the selection.
|
||||||
set { _MaxRows = value; }
|
/// </summary>
|
||||||
}
|
public int SelectedColumns => SelQX;
|
||||||
private int _MaxCols = -1;
|
|
||||||
|
|
||||||
public int MaxCols
|
/// <summary>
|
||||||
{
|
/// Returns the number of rows, or the vertical / Y count,
|
||||||
get { return _MaxCols; }
|
/// of the selection.
|
||||||
set { _MaxCols = value; }
|
/// </summary>
|
||||||
}
|
public int SelectedRows => SelQY;
|
||||||
|
|
||||||
/// <summary>
|
private void TablePicker_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {
|
||||||
/// 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>
|
|
||||||
/// Returns the number of columns, or the horizontal / X count,
|
|
||||||
/// of the selection.
|
|
||||||
/// </summary>
|
|
||||||
public int SelectedColumns {
|
|
||||||
get {
|
|
||||||
return SelQX;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the number of rows, or the vertical / Y count,
|
|
||||||
/// of the selection.
|
|
||||||
/// </summary>
|
|
||||||
public int SelectedRows {
|
|
||||||
get {
|
|
||||||
return SelQY;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TablePicker_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {
|
|
||||||
Graphics g = e.Graphics;
|
Graphics g = e.Graphics;
|
||||||
|
|
||||||
// First, increment the number of visible squares if the
|
// First, increment the number of visible squares if the
|
||||||
@@ -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,42 +165,24 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <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,24 +86,12 @@ 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
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -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,18 +146,17 @@ 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";
|
{
|
||||||
ViewFile.ShowDialog();
|
Text = "End-User License Agreement"
|
||||||
|
};
|
||||||
|
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,19 +8,10 @@ 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 DlgCloseTabsOrExit(bool isMainWindow, bool hasChildWindows)
|
||||||
public bool ExitPROMS
|
|
||||||
{
|
|
||||||
get { return _ExitPROMS; }
|
|
||||||
set { _ExitPROMS = value; }
|
|
||||||
}
|
|
||||||
public DlgCloseTabsOrExit(bool isMainWindow, bool hasChildWindows)
|
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
if (!isMainWindow)
|
if (!isMainWindow)
|
||||||
@@ -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,29 +1,21 @@
|
|||||||
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;
|
||||||
{
|
public int RemoveTrailingHardReturnsAndManualPageBreaks
|
||||||
get
|
|
||||||
{
|
|
||||||
return swtbtnPDFLinks.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public int RemoveTrailingHardReturnsAndManualPageBreaks
|
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -36,38 +28,19 @@ 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; } = "";
|
||||||
{
|
public bool OpenAfterCreate // RHM20150506 Multiline ItemID TextBox
|
||||||
get { return _Prefix; }
|
|
||||||
set { _Prefix = value; }
|
|
||||||
}
|
|
||||||
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 OverwritePDF
|
public bool Automatic { get; set; }
|
||||||
|
public int PrtSectID { get; set; } = -1;
|
||||||
|
|
||||||
|
public bool OverwritePDF
|
||||||
{
|
{
|
||||||
get { return cbxOverwritePDF2.Checked; }
|
get { return cbxOverwritePDF2.Checked; }
|
||||||
set { cbxOverwritePDF2.Checked = value; }
|
set { cbxOverwritePDF2.Checked = value; }
|
||||||
@@ -85,18 +58,17 @@ 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()
|
||||||
{
|
{
|
||||||
cbxDebugPagination.Checked = true;
|
cbxDebugPagination.Checked = true;
|
||||||
cbxDebugText.Checked = true;
|
cbxDebugText.Checked = true;
|
||||||
cbxMetaFile.Checked = true; // C2018-004 create meta file for baseline compares
|
cbxMetaFile.Checked = true; // C2018-004 create meta file for baseline compares
|
||||||
_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,11 +115,8 @@ namespace VEPROMS
|
|||||||
return RevNum + "/" + RevDate;
|
return RevNum + "/" + RevDate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string ProcNum
|
public string ProcNum => MyProcedure.DisplayNumber;
|
||||||
{
|
public string PDFPath
|
||||||
get { return MyProcedure.DisplayNumber; }
|
|
||||||
}
|
|
||||||
public string PDFPath
|
|
||||||
{
|
{
|
||||||
get {// B2018-069 Revert to Temporary for Baseline testing
|
get {// B2018-069 Revert to Temporary for Baseline testing
|
||||||
if (PromsPrinter.BaselineTesting)
|
if (PromsPrinter.BaselineTesting)
|
||||||
@@ -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,21 +216,12 @@ 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
|
|
||||||
{
|
|
||||||
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
|
public string UnitNumber { get; set; }
|
||||||
public DlgPrintProcedure(ProcedureInfo pi)
|
public int UnitIndex { get; set; }
|
||||||
|
|
||||||
|
// 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)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_AllProcedures = false;
|
_AllProcedures = false;
|
||||||
@@ -354,31 +312,9 @@ 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();
|
||||||
|
cbxOrPgBrk.Visible = false; //per Harry
|
||||||
// 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.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,9 +460,8 @@ 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)
|
||||||
if (dtSuf != PDFDTSuffix.None) PDFFileSuffix = ""; // incase user entered suffix text but then selected a date/time (in working draft properties)
|
if (dtSuf != PDFDTSuffix.None) PDFFileSuffix = ""; // incase user entered suffix text but then selected a date/time (in working draft properties)
|
||||||
// B2020-062 control the toggle of date/time prefix/suffix on pdf file name
|
// B2020-062 control the toggle of date/time prefix/suffix on pdf file name
|
||||||
@@ -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("_", "-");
|
||||||
}
|
}
|
||||||
if (ProcNum == string.Empty)
|
string PDFFileName;
|
||||||
//txbPDFName.Text = this.UnitNumber + ".pdf";
|
if (ProcNum == string.Empty)
|
||||||
PDFFileName = this.UnitNumber;
|
PDFFileName = 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("*"))
|
if ((PDFFileName ?? "") == "") PDFFileName = "NoProcNumber";
|
||||||
// txbPDFName.Text = txbPDFName.Text.Replace("*", this.UnitNumber);
|
|
||||||
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,12 +507,9 @@ 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)
|
||||||
{
|
{
|
||||||
// C2019-031 - disable the override change bar grouping when default change bar is set to format default or no change bar
|
// C2019-031 - disable the override change bar grouping when default change bar is set to format default or no change bar
|
||||||
cbxOvrrideDefChgBars.Checked = false; // uncheck the override change bar check box inside the grouping
|
cbxOvrrideDefChgBars.Checked = false; // uncheck the override change bar check box inside the grouping
|
||||||
@@ -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 (MyProcedure.MyConfig is ProcedureConfig procConfig) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE");
|
||||||
if (procConfig != null) 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 (MyProcedure.MyConfig is ProcedureConfig procConfig) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE"); // C2021-019: override watermark text
|
||||||
if (procConfig != null) 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,12 +1073,9 @@ 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)
|
||||||
{
|
{
|
||||||
SetCustomControls(true);
|
SetCustomControls(true);
|
||||||
// Make Custom controls visible
|
// Make Custom controls visible
|
||||||
@@ -1218,24 +1097,22 @@ 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;
|
else
|
||||||
}
|
{
|
||||||
else
|
string txtDate2 = txtDate.Text;
|
||||||
{
|
string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate2);
|
||||||
string txtDate2 = txtDate.Text;
|
string txtTitle = "Invalid Format";
|
||||||
string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate2);
|
MessageBox.Show(message, txtTitle);
|
||||||
string txtTitle = "Invalid Format";
|
return false;
|
||||||
MessageBox.Show(message, txtTitle);
|
}
|
||||||
return false;
|
}
|
||||||
}
|
return true;
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void txbRevDate_Enter(object sender, EventArgs e)
|
private void txbRevDate_Enter(object sender, EventArgs e)
|
||||||
@@ -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,17 +1134,16 @@ 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;
|
||||||
}
|
}
|
||||||
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))
|
||||||
{
|
{
|
||||||
itm.MyContent.Config = MyProcedure.MyConfig.ToString();
|
itm.MyContent.Config = MyProcedure.MyConfig.ToString();
|
||||||
@@ -1283,10 +1157,9 @@ namespace VEPROMS
|
|||||||
if (_Initializing) return;
|
if (_Initializing) return;
|
||||||
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))
|
||||||
{
|
{
|
||||||
itm.MyContent.Config = MyProcedure.MyConfig.ToString();
|
itm.MyContent.Config = MyProcedure.MyConfig.ToString();
|
||||||
@@ -1326,10 +1199,9 @@ namespace VEPROMS
|
|||||||
// C2021-062 used to save rev number information when all procedures are printed or merged
|
// C2021-062 used to save rev number information when all procedures are printed or merged
|
||||||
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))
|
||||||
{
|
{
|
||||||
itm.MyContent.Config = MyProcedure.MyConfig.ToString();
|
itm.MyContent.Config = MyProcedure.MyConfig.ToString();
|
||||||
@@ -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")]
|
||||||
@@ -1643,7 +1643,11 @@ Begin
|
|||||||
Select Cast(i.LastChanged as varbinary(8)) as 'ILastChanged',
|
Select Cast(i.LastChanged as varbinary(8)) as 'ILastChanged',
|
||||||
i.ItemID as 'ItemID',
|
i.ItemID as 'ItemID',
|
||||||
zi.VersionID as 'VersionID',
|
zi.VersionID as 'VersionID',
|
||||||
zi.PPath +
|
CASE WHEN c.[Type] % 20000 = 6 THEN REPLACE(zi.PPath,'Note','Caution')
|
||||||
|
WHEN c.[Type] % 20000 = 7 THEN REPLACE(zi.PPath,'Caution','Note')
|
||||||
|
ELSE zi.PPath
|
||||||
|
END
|
||||||
|
+
|
||||||
Case (c.[Type]/10000)
|
Case (c.[Type]/10000)
|
||||||
When 0 Then @Delim + @UnitPrefix + IsNull(c.Number,'') + @DelimNumber + IsNull(c.Text,'') -- Procedure
|
When 0 Then @Delim + @UnitPrefix + IsNull(c.Number,'') + @DelimNumber + IsNull(c.Text,'') -- Procedure
|
||||||
When 1 Then @Delim + IsNull(c.Number,'') + @DelimNumber + IsNull(c.Text,'') -- Section
|
When 1 Then @Delim + IsNull(c.Number,'') + @DelimNumber + IsNull(c.Text,'') -- Section
|
||||||
@@ -5223,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],
|
||||||
@@ -5543,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];
|
||||||
@@ -5551,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];
|
||||||
@@ -13537,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];
|
||||||
@@ -17165,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
|
||||||
@@ -17299,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
|
||||||
|
|
||||||
/*
|
/*
|
||||||
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
||||||
@@ -19701,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
|
||||||
@@ -19718,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
|
||||||
@@ -24325,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
|
||||||
@@ -24351,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
|
||||||
@@ -24529,6 +24545,496 @@ GO
|
|||||||
PRINT 'Added IX_tblROUsagesRODbIDDeleteStatusROID Index. Speeds up RO queries'
|
PRINT 'Added IX_tblROUsagesRODbIDDeleteStatusROID Index. Speeds up RO queries'
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[GetCurrentApprovedRevisions]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||||
|
DROP PROCEDURE [GetCurrentApprovedRevisions];
|
||||||
|
|
||||||
|
GO
|
||||||
|
|
||||||
|
/****** Object: StoredProcedure [dbo].[GetCurrentApprovedRevisions] Script Date: 02/05/2026 7:54:42 AM ******/
|
||||||
|
|
||||||
|
-- =============================================
|
||||||
|
-- Author: Matthew Schill
|
||||||
|
-- Create date: 02/05/2026
|
||||||
|
-- Description: Gets all current approved revisions
|
||||||
|
-- =============================================
|
||||||
|
CREATE PROCEDURE [dbo].[GetCurrentApprovedRevisions]
|
||||||
|
(
|
||||||
|
@ItemID AS bigint
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
select max(rr.revisionid) revisionid, UnitId, UnitVal.name UnitName, max(rr.DTS) DTS
|
||||||
|
from items ii
|
||||||
|
inner join revisions rr on ii.itemid = rr.itemid
|
||||||
|
inner join versions vv on rr.revisionid = vv.revisionid
|
||||||
|
inner join stages ss on vv.stageid = ss.stageid
|
||||||
|
outer apply
|
||||||
|
(Select UnitId = r1.value('@Index','int') FROM rr.config.nodes('Config/Applicability') t1(r1)) App
|
||||||
|
left outer join
|
||||||
|
(select r1.value('@index','int') indx
|
||||||
|
,r1.value('@Name','varchar') name
|
||||||
|
from (select *,cast(config as xml) xconfig from DocVersions
|
||||||
|
where ItemID in(select itemID from vefn_AllSiblingItems(@ItemID))) SDV
|
||||||
|
cross apply
|
||||||
|
xconfig.nodes('Config/Slaves/Slave') t1(r1)) UnitVal ON UnitVal.indx = UnitId
|
||||||
|
where ss.isapproved = 1
|
||||||
|
and ii.itemid = @ItemID
|
||||||
|
group by UnitId, UnitVal.name
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF (@@Error = 0) PRINT 'Procedure Creation: [GetCurrentApprovedRevisions] Succeeded'
|
||||||
|
ELSE PRINT 'Procedure Creation: [GetCurrentApprovedRevisions] Error on Creation'
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
==========================================================================================================
|
||||||
|
-- Begin: C2026-010 Add Audit Ability for ChangeBars
|
||||||
|
-- Author: Matthew Schill
|
||||||
|
-- Create date: 02/17/2026
|
||||||
|
==========================================================================================================
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
----------------------------------------------------------------------------------
|
||||||
|
Tables:
|
||||||
|
----------------------------------------------------------------------------------
|
||||||
|
[ChangeBarAudits]
|
||||||
|
|
||||||
|
----------------------------------------------------------------------------------
|
||||||
|
Indexes:
|
||||||
|
----------------------------------------------------------------------------------
|
||||||
|
[IX_ChangeBarAudits_ItemID] on [dbo].[ChangeBarAudits]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
IF Not Exists(SELECT * FROM sys.objects Where name = 'ChangeBarAudits' AND type in (N'U'))
|
||||||
|
Begin
|
||||||
|
|
||||||
|
SET ANSI_NULLS ON
|
||||||
|
SET QUOTED_IDENTIFIER ON
|
||||||
|
|
||||||
|
/****** Create Table to hold Audit Information ******/
|
||||||
|
CREATE TABLE [dbo].[ChangeBarAudits](
|
||||||
|
[AuditID] [bigint] IDENTITY(1,1) NOT NULL,
|
||||||
|
[ItemID] [bigint] NOT NULL,
|
||||||
|
[Text] [nvarchar](max) NULL,
|
||||||
|
[DTS] [datetime] NOT NULL,
|
||||||
|
[UserID] [nvarchar](100) NOT NULL,
|
||||||
|
[UnitIndex] [int] NULL,
|
||||||
|
CONSTRAINT [PK_ChangeBarAudits] PRIMARY KEY CLUSTERED
|
||||||
|
(
|
||||||
|
[AuditID] ASC
|
||||||
|
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||||
|
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||||
|
|
||||||
|
IF (@@Error = 0) PRINT 'Table Creation: [ChangeBarAudits] Succeeded'
|
||||||
|
ELSE PRINT 'Table Creation: [ChangeBarAudits] Error on Creation'
|
||||||
|
|
||||||
|
/****** Table was not previously created - so intially populate with info from Approvals ******/
|
||||||
|
INSERT into ChangeBarAudits([ItemID],[Text],[DTS],[UserID],[UnitIndex])
|
||||||
|
select --rr.RevisionID,
|
||||||
|
rr.ItemID,
|
||||||
|
Text = CASE WHEN r1.value('@Index','int') <> 0 AND UnitName IS NOT NULL THEN
|
||||||
|
'(Unit ' + UnitName + ') '
|
||||||
|
ELSE
|
||||||
|
''
|
||||||
|
END +
|
||||||
|
'Approved by (' + rr.UserID + ') on (' +
|
||||||
|
CAST(rr.DTS AS VARCHAR) + ')',
|
||||||
|
rr.DTS,
|
||||||
|
rr.UserID,
|
||||||
|
UnitIndex = r1.value('@Index','int')
|
||||||
|
-- , UnitName
|
||||||
|
from revisions rr
|
||||||
|
inner join versions vv on rr.revisionid = vv.revisionid
|
||||||
|
inner join stages ss on vv.stageid = ss.stageid
|
||||||
|
outer apply rr.config.nodes('Config/Applicability') t1(r1)
|
||||||
|
outer apply
|
||||||
|
( Select r2.value('@Name','varchar') UnitName
|
||||||
|
FROM
|
||||||
|
(select DocVerSions.ItemID, cast(config as xml) xconfig from DocVersions
|
||||||
|
inner join
|
||||||
|
vefn_AllSiblingItems(rr.ItemID) Sib ON DocVerSions.ItemID = Sib.ItemID) SDV
|
||||||
|
cross apply
|
||||||
|
xconfig.nodes('Config/Slaves/Slave') t2(r2)
|
||||||
|
WHERE r2.value('@index','varchar') = r1.value('@Index','int')
|
||||||
|
) UN
|
||||||
|
where ss.isapproved = 1
|
||||||
|
order by rr.ItemID, rr.RevisionID desc
|
||||||
|
|
||||||
|
IF (@@Error = 0) PRINT '[ChangeBarAudits] Initial Population Succeeded'
|
||||||
|
ELSE PRINT '[ChangeBarAudits] Initial Population Error'
|
||||||
|
|
||||||
|
/****** Create Index to get ChangeBar Audit Information for Item (ItemID = ProcedureID) ******/
|
||||||
|
CREATE NONCLUSTERED INDEX [IX_ChangeBarAudits_ItemID] ON [dbo].[ChangeBarAudits]
|
||||||
|
(
|
||||||
|
[ItemID] ASC
|
||||||
|
)
|
||||||
|
INCLUDE ([AuditID], [Text], [DTS], [UnitIndex])
|
||||||
|
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]
|
||||||
|
|
||||||
|
IF (@@Error = 0) PRINT 'Index Creation: [IX_ChangeBarAudits_ItemID] Succeeded'
|
||||||
|
ELSE PRINT 'Index Creation: [IX_ChangeBarAudits_ItemID] Error on Creation'
|
||||||
|
|
||||||
|
End
|
||||||
|
|
||||||
|
-- =============================================
|
||||||
|
-- Description: Gets ChangeBar Audit History by item
|
||||||
|
-- =============================================
|
||||||
|
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[GetChangeBarAuditHistoryByItem]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||||
|
DROP PROCEDURE [GetChangeBarAuditHistoryByItem];
|
||||||
|
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE PROCEDURE [dbo].[GetChangeBarAuditHistoryByItem]
|
||||||
|
(
|
||||||
|
@ItemID AS bigint
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
Select * FROM ChangeBarAudits where ItemID = @ItemID
|
||||||
|
order by DTS desc
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF (@@Error = 0) PRINT 'Procedure Creation: [GetChangeBarAuditHistoryByItem] Succeeded'
|
||||||
|
ELSE PRINT 'Procedure Creation: [GetChangeBarAuditHistoryByItem] Error on Creation'
|
||||||
|
GO
|
||||||
|
|
||||||
|
-- =============================================
|
||||||
|
-- Description: Adds ChangeBar Audit History
|
||||||
|
-- =============================================
|
||||||
|
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[AddChangeBarAuditHistory]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||||
|
DROP PROCEDURE [AddChangeBarAuditHistory];
|
||||||
|
|
||||||
|
GO
|
||||||
|
|
||||||
|
CREATE PROCEDURE [dbo].[AddChangeBarAuditHistory]
|
||||||
|
(
|
||||||
|
@ItemID AS bigint,
|
||||||
|
@Description As nvarchar(max),
|
||||||
|
@DTS AS Datetime,
|
||||||
|
@UserID As nvarchar(100),
|
||||||
|
@UnitIndex AS bigint = NULL
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
BEGIN
|
||||||
|
|
||||||
|
INSERT into ChangeBarAudits([ItemID],[Text],[DTS],[UserID],[UnitIndex])
|
||||||
|
VALUES (@ItemID, @Description, @DTS, @UserID, @UnitIndex)
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
END
|
||||||
|
|
||||||
|
IF (@@Error = 0) PRINT 'Procedure Creation: [AddChangeBarAuditHistory] Succeeded'
|
||||||
|
ELSE PRINT 'Procedure Creation: [AddChangeBarAuditHistory] Error on Creation'
|
||||||
|
GO
|
||||||
|
|
||||||
|
/*
|
||||||
|
==========================================================================================================
|
||||||
|
-- End: C2026-010 Add Audit Ability for ChangeBars
|
||||||
|
==========================================================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
/*
|
/*
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
| ADD New Code Before this Block |
|
| ADD New Code Before this Block |
|
||||||
@@ -24562,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 = '01/19/2026 5:00 PM'
|
set @RevDate = '07/16/2026 8:30 AM'
|
||||||
set @RevDescription = 'Sync tree list Sort order between in RO Editor and PROMS'
|
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,36 +19,22 @@ 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)
|
||||||
{
|
{
|
||||||
if (MyProcedureInfo != null)
|
StringBuilder sb = new StringBuilder();
|
||||||
|
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
|
||||||
sb.AppendLine(string.Format("The document {0}", MySectionInfo.DisplayText));
|
sb.AppendLine(string.Format("The document {0}", MySectionInfo.DisplayText));
|
||||||
@@ -74,7 +56,8 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private void btnForce_Click(object sender, EventArgs e)
|
private void btnForce_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MySessionInfo.CheckInItem(MyOwnerInfo.OwnerID);
|
StringBuilder sb = new StringBuilder();
|
||||||
|
MySessionInfo.CheckInItem(MyOwnerInfo.OwnerID);
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine("Forced Check In has been completed");
|
sb.AppendLine("Forced Check In has been completed");
|
||||||
lblInfo.Text = sb.ToString();
|
lblInfo.Text = sb.ToString();
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -20,14 +18,9 @@ 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
|
private bool _ConvertROsToTextDuringImport = false;
|
||||||
{
|
|
||||||
get { return _MyFrmVEPROMS; }
|
|
||||||
set { _MyFrmVEPROMS = value; }
|
|
||||||
}
|
|
||||||
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
|
private Dictionary<int, int> floatFoldout;
|
||||||
{
|
|
||||||
get { return _ExternalTransitionItem; }
|
|
||||||
set { _ExternalTransitionItem = value; }
|
|
||||||
}
|
|
||||||
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 string PEIPath;
|
||||||
private ProcedureInfo _MyNewProcedure;
|
private readonly string _MyMode;
|
||||||
public ProcedureInfo MyNewProcedure
|
|
||||||
{
|
|
||||||
get { return _MyNewProcedure; }
|
|
||||||
set { _MyNewProcedure = value; }
|
|
||||||
}
|
|
||||||
private string PEIPath;
|
|
||||||
private 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,15 +521,17 @@ 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);
|
||||||
int rofstid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rofstid").InnerText);
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - rofstid for Debugging/future use
|
||||||
if (MyDocVersion.DocVersionAssociationCount > 0)
|
int rofstid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rofstid").InnerText);
|
||||||
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
|
if (MyDocVersion.DocVersionAssociationCount > 0)
|
||||||
{
|
{
|
||||||
// use current ROPath
|
// use current ROPath
|
||||||
MyRODb = RODb.GetJustRoDb(MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID);
|
MyRODb = RODb.GetJustRoDb(MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID);
|
||||||
@@ -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,
|
||||||
dlg.ShowDialog(this);
|
WorkingDraftROFolder = MyRODb.FolderPath
|
||||||
|
};
|
||||||
|
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,16 +593,18 @@ 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,
|
||||||
dlg.ShowDialog(this);
|
LocalROFolders = localROPaths
|
||||||
|
};
|
||||||
|
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
|
||||||
{
|
{
|
||||||
MyRODb = RODb.GetByFolderPath(dlg.SelectedROFolder);
|
MyRODb = RODb.GetByFolderPath(dlg.SelectedROFolder);
|
||||||
@@ -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,7 +987,8 @@ namespace VEPROMS
|
|||||||
c.Save();
|
c.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Dictionary<string, string> existingCopyFCName = new Dictionary<string, string>();
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
|
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,21 +999,20 @@ 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);
|
||||||
string name = nd.Attributes.GetNamedItem("name").InnerText;
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
|
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");
|
||||||
if (cfg != null) config = cfg.InnerText;
|
if (cfg != null) config = cfg.InnerText;
|
||||||
@@ -1036,10 +1021,10 @@ namespace VEPROMS
|
|||||||
FormatInfo exFI = FormatInfo.Get(existingFormat[name]);
|
FormatInfo exFI = FormatInfo.Get(existingFormat[name]);
|
||||||
if (exFI.Config != config && exFI.Config != "" && exFI.Config != null && config != "" && config != null)
|
if (exFI.Config != config && exFI.Config != "" && exFI.Config != null && config != "" && config != null)
|
||||||
{
|
{
|
||||||
// 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);
|
||||||
importedFC.Add(config);
|
importedFC.Add(config);
|
||||||
@@ -1067,15 +1052,16 @@ 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");
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - description, userid, dts for future use
|
||||||
if (descript != null) description = descript.InnerText;
|
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);
|
||||||
// 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
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
// existing config match, use the existing (copied) format's name rather than importing it again (the dictionary was set up during
|
// 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
|
||||||
// the import formats process.
|
// existing config match, use the existing (copied) format's name rather than importing it again (the dictionary was set up during
|
||||||
if (existingCopyFCName.ContainsKey(name)) name = existingCopyFCName[name];
|
// the import formats process.
|
||||||
|
if (existingCopyFCName.ContainsKey(name)) name = existingCopyFCName[name];
|
||||||
|
|
||||||
// compare this imported format to the original in the database.
|
// compare this imported format to the original in the database.
|
||||||
// If format name exists, or if it has same config data, just use it.
|
// If format name exists, or if it has same config data, just use it.
|
||||||
@@ -1096,11 +1082,11 @@ 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:
|
||||||
if (existingFormat.ContainsKey(name))
|
if (existingFormat.ContainsKey(name))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -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,8 +1345,8 @@ 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)
|
||||||
ExportFormat(xe, fi, "format");
|
ExportFormat(xe, fi, "format");
|
||||||
@@ -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();
|
||||||
@@ -1618,8 +1603,15 @@ namespace VEPROMS
|
|||||||
|
|
||||||
public void ExportItem(XmlDocument xd, ItemInfo ii, string nodename)
|
public void ExportItem(XmlDocument xd, ItemInfo ii, string nodename)
|
||||||
{
|
{
|
||||||
XmlElement xe = xd.CreateElement(nodename);
|
//B2026-016 - Fix error pulling Reference Object info into Export
|
||||||
if (ii.IsProcedure)
|
if (ii.MyDocVersion.DocVersionAssociationCount == 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Prior to Exporting Procedures you must set the Referenced Object Database", "No RO Database set", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
XmlElement xe = xd.CreateElement(nodename);
|
||||||
|
if (ii.IsProcedure)
|
||||||
{
|
{
|
||||||
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID.ToString()));
|
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID.ToString()));
|
||||||
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofolderpath", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath));
|
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofolderpath", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath));
|
||||||
@@ -1632,14 +1624,14 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private void ExportItem(XmlElement xn, ItemInfo ii, string nodename)
|
private void ExportItem(XmlElement xn, ItemInfo ii, string nodename)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
ItemID
|
ItemID
|
||||||
PreviousID
|
PreviousID
|
||||||
ContentID
|
ContentID
|
||||||
DTS
|
DTS
|
||||||
*/
|
*/
|
||||||
XmlElement xe = null;
|
XmlElement xe;
|
||||||
if (xn.Name == "procedure")
|
if (xn.Name == "procedure")
|
||||||
xe = xn;
|
xe = xn;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2425,12 +2417,9 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddTransitions()
|
private void AddTransitions() => AddTransitions(PendingTransitions);
|
||||||
{
|
|
||||||
AddTransitions(PendingTransitions);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AddTransitions(XmlDocument xd)
|
private void AddTransitions(XmlDocument xd)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
Content
|
Content
|
||||||
@@ -2450,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)
|
||||||
{
|
{
|
||||||
@@ -2513,9 +2502,8 @@ 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;
|
||||||
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);
|
||||||
@@ -2530,42 +2518,43 @@ 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);
|
||||||
|
|
||||||
if (tt.TransitionID < 0)
|
bool forceConvertToText;
|
||||||
{
|
if (tt.TransitionID < 0)
|
||||||
forceConvertToText = true;
|
{
|
||||||
_DidProcessTransitions |= cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); // B2017-076 FixTransitionText will tell us if transitions were processed/changed
|
forceConvertToText = true;
|
||||||
cc.Save();
|
_DidProcessTransitions |= cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); // B2017-076 FixTransitionText will tell us if transitions were processed/changed
|
||||||
nd.InnerText = "done";
|
cc.Save();
|
||||||
}
|
nd.InnerText = "done";
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
transitionid = tt.TransitionID;
|
{
|
||||||
string replacewith;
|
transitionid = tt.TransitionID;
|
||||||
|
string replacewith;
|
||||||
|
|
||||||
if (isrange == 0)
|
if (isrange == 0)
|
||||||
replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid);
|
replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid);
|
||||||
else
|
else
|
||||||
replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid);
|
replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid);
|
||||||
|
|
||||||
cc.Text = cc.Text.Replace(lookfor, replacewith);
|
cc.Text = cc.Text.Replace(lookfor, replacewith);
|
||||||
|
|
||||||
if (cc.MyGrid != null && !string.IsNullOrEmpty(cc.MyGrid.Data))
|
if (cc.MyGrid != null && !string.IsNullOrEmpty(cc.MyGrid.Data))
|
||||||
{
|
{
|
||||||
cc.MyGrid.Data = cc.MyGrid.Data.Replace(lookfor, replacewith);
|
cc.MyGrid.Data = cc.MyGrid.Data.Replace(lookfor, replacewith);
|
||||||
}
|
}
|
||||||
|
|
||||||
// B2016-176, B2016-197 - external transitions should be converted to text
|
// B2016-176, B2016-197 - external transitions should be converted to text
|
||||||
forceConvertToText = true;
|
forceConvertToText = true;
|
||||||
_DidProcessTransitions |= cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); // B2017-076 FixTransitionText will tell us if transitions were processed/changed
|
_DidProcessTransitions |= cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); // B2017-076 FixTransitionText will tell us if transitions were processed/changed
|
||||||
// B2017=003 make sure any grid changes are saved.
|
// B2017=003 make sure any grid changes are saved.
|
||||||
// done here because FixTransitionText() could update the transitions in the grid
|
// done here because FixTransitionText() could update the transitions in the grid
|
||||||
if (cc.MyGrid != null && cc.MyGrid.Data != "")
|
if (cc.MyGrid != null && cc.MyGrid.Data != "")
|
||||||
cc.MyGrid.Save();
|
cc.MyGrid.Save();
|
||||||
cc.Save();
|
cc.Save();
|
||||||
nd.InnerText = "done";
|
nd.InnerText = "done";
|
||||||
_DidConvertTransitionsToText |= (forceConvertToText && _DidProcessTransitions); // B2016-225 - notify user when transitions are converted to text
|
_DidConvertTransitionsToText |= (forceConvertToText && _DidProcessTransitions); // B2016-225 - notify user when transitions are converted to text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2611,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);
|
||||||
}
|
}
|
||||||
@@ -2659,9 +2647,11 @@ namespace VEPROMS
|
|||||||
MyRODb = AddRODb(xrodb);
|
MyRODb = AddRODb(xrodb);
|
||||||
ROFst rofst = AddROFst(xrofst);
|
ROFst rofst = AddROFst(xrofst);
|
||||||
|
|
||||||
DocVersionAssociation dva = dv.DocVersionAssociations.Add(rofst);
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - dva kept for side effect code
|
||||||
|
DocVersionAssociation dva = dv.DocVersionAssociations.Add(rofst);
|
||||||
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
|
|
||||||
dv.Save();
|
dv.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
return DocVersionInfo.Get(dv.VersionID);
|
return DocVersionInfo.Get(dv.VersionID);
|
||||||
@@ -2896,9 +2886,11 @@ 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;
|
||||||
string roid = nd.Attributes.GetNamedItem("roid").InnerText;
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - roid for Debugging/future use
|
||||||
|
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]
|
||||||
content.Save();
|
content.Save();
|
||||||
MatchCollection ms = Regex.Matches(content.Text, findLink);
|
MatchCollection ms = Regex.Matches(content.Text, findLink);
|
||||||
@@ -2934,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);
|
||||||
@@ -3105,8 +3097,10 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
foreach (XmlNode nd in xn.SelectNodes("annotation"))
|
foreach (XmlNode nd in xn.SelectNodes("annotation"))
|
||||||
{
|
{
|
||||||
int typeid = int.Parse(nd.Attributes.GetNamedItem("typeid").InnerText);
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value - typeid for debugging/future use
|
||||||
string rtftext = nd.Attributes.GetNamedItem("rtftext").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 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;
|
||||||
string userid = nd.Attributes.GetNamedItem("userid").InnerText;
|
string userid = nd.Attributes.GetNamedItem("userid").InnerText;
|
||||||
@@ -3841,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
|
||||||
}
|
}
|
||||||
@@ -3854,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);
|
||||||
@@ -3864,20 +3858,14 @@ namespace VEPROMS
|
|||||||
|
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
#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)
|
||||||
{
|
{
|
||||||
if (MyProcedure != null)
|
if (MyProcedure != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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,10 +261,8 @@ 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,54 +1,23 @@
|
|||||||
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; }
|
||||||
{
|
private bool _CancelImport = true; // default to truen in case the dialog is closed with the red X in the upper right corner
|
||||||
get { return _ImportedROFolder; }
|
public bool CancelImport => _CancelImport;
|
||||||
set { _ImportedROFolder = value; }
|
private bool _ConvertROsToText = false;
|
||||||
}
|
public bool ConvertROsToText => _ConvertROsToText;
|
||||||
private string _WorkingDraftROFolder;
|
public dlgImpHowToHandleROs() => InitializeComponent();
|
||||||
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
|
|
||||||
public bool CancelImport
|
|
||||||
{
|
|
||||||
get { return _CancelImport; }
|
|
||||||
}
|
|
||||||
private bool _ConvertROsToText = false;
|
|
||||||
public bool ConvertROsToText
|
|
||||||
{
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
_CancelImport = false;
|
_CancelImport = false;
|
||||||
_ConvertROsToText = true;
|
_ConvertROsToText = true;
|
||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user