Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48a8448aa0 |
+1
-2
@@ -401,5 +401,4 @@ FodyWeavers.xsd
|
||||
|
||||
/fmtall
|
||||
/genmacall
|
||||
*AssemblyInfo.cs
|
||||
/PROMS/Baseline/Baseline.sln
|
||||
*AssemblyInfo.cs
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
@@ -33,7 +35,31 @@ namespace AdjustBuildRevision
|
||||
outline = Regex.Replace(line, @"([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)""\)", DateTime.Now.ToString("2.4.yyMM.dHH") + "\")");
|
||||
else
|
||||
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)
|
||||
{
|
||||
Console.WriteLine("Before: '{0}'", line);
|
||||
@@ -58,7 +84,7 @@ namespace AdjustBuildRevision
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show($"File {fi.FullName} does not exist");
|
||||
MessageBox.Show("File " + fi.FullName + " does not exist");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -67,6 +93,10 @@ namespace AdjustBuildRevision
|
||||
}
|
||||
}
|
||||
|
||||
//private static DateTime GetLatestDateTime(string path)
|
||||
//{
|
||||
// return GetLatestDateTime(new DirectoryInfo(path));
|
||||
//}
|
||||
private static DateTime GetLatestDateTime(DirectoryInfo di, DateTime dtCheck)
|
||||
{
|
||||
DateTime dtMax = dtCheck;
|
||||
@@ -74,14 +104,24 @@ namespace AdjustBuildRevision
|
||||
foreach(FileInfo myFile in myFiles)
|
||||
{
|
||||
DateTime dt = myFile.LastWriteTime;
|
||||
if(dtMax < dt) dtMax = dt;
|
||||
//if (dt > dtCheck)
|
||||
//{
|
||||
//Console.WriteLine("\"File\"\t\"{0}\"\t\"{1}\"\t{2}\t{3}",myFile.FullName,dt.ToString("1.1.yyMM.dHH"),dt,dtCheck);
|
||||
if(dtMax < dt) dtMax = dt;
|
||||
//}
|
||||
}
|
||||
DirectoryInfo[] myFolders = di.GetDirectories();
|
||||
foreach (DirectoryInfo diChild in myFolders)
|
||||
{
|
||||
DateTime dtChild = GetLatestDateTime(diChild,dtCheck);
|
||||
if(dtChild > dtMax) dtMax = dtChild;
|
||||
//if (dtChild > dtCheck)
|
||||
//{
|
||||
//Console.WriteLine("\"SubFolder\"\t\"{0}\"\t\"{1}\"\t{2}\t{3}", diChild.FullName, dtChild.ToString("1.1.yyMM.dHH"),dtChild,dtCheck);
|
||||
if(dtChild > dtMax) dtMax = dtChild;
|
||||
//}
|
||||
}
|
||||
//if(dtMax > dtCheck)
|
||||
// Console.WriteLine("\"Folder\"\t\"{0}\"\t\"{1}\"", di.FullName, dtMax.ToString("1.1.yyMM.dHH"));
|
||||
return dtMax;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
<Compile Include="frmSettings.Designer.cs">
|
||||
<DependentUpon>frmSettings.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="frmBaseline.resx">
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// 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,4 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Baseline
|
||||
|
||||
+247
-124
@@ -43,9 +43,12 @@ 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.Collections.Specialized;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml.Serialization;
|
||||
@@ -70,8 +73,13 @@ namespace Baseline
|
||||
}
|
||||
public partial class frmBaseline : Form
|
||||
{
|
||||
public IgnoreLines MyIgnore { get; set; } = new IgnoreLines();
|
||||
private LastWas myLast = LastWas.Search;
|
||||
private IgnoreLines _MyIgnore = new IgnoreLines();
|
||||
public IgnoreLines MyIgnore
|
||||
{
|
||||
get { return _MyIgnore; }
|
||||
set { _MyIgnore = value; }
|
||||
}
|
||||
private LastWas myLast = LastWas.Search;
|
||||
private Settings MySettings;
|
||||
public string MyStatus
|
||||
{
|
||||
@@ -143,11 +151,9 @@ namespace Baseline
|
||||
this.WindowState = Properties.Settings.Default.WidnowState;
|
||||
if(Properties.Settings.Default.Ignore != null && Properties.Settings.Default.Ignore != "")
|
||||
MyIgnore = IgnoreLines.Get(Properties.Settings.Default.Ignore);
|
||||
MySettings = new Settings
|
||||
{
|
||||
IgnoreLines = new BindingList<string>()
|
||||
};
|
||||
splitContainer1.SplitterDistance = Properties.Settings.Default.Split1;
|
||||
MySettings= new Settings();
|
||||
MySettings.IgnoreLines = new BindingList<string>();
|
||||
splitContainer1.SplitterDistance = Properties.Settings.Default.Split1;
|
||||
splitContainer2.SplitterDistance = Properties.Settings.Default.Split2;
|
||||
splitContainer3.SplitterDistance = Properties.Settings.Default.Split3;
|
||||
if (Properties.Settings.Default.MRU1 != null && Properties.Settings.Default.MRU1.Count > 0)
|
||||
@@ -234,27 +240,28 @@ namespace Baseline
|
||||
lbProcedures.Items.Clear();
|
||||
lbResults1.Items.Clear();
|
||||
lbResults2.Items.Clear();
|
||||
if (lbDifferent.SelectedItem is FindFile ff)
|
||||
{
|
||||
// Fill Procedure or Result ListBoxes
|
||||
switch (myLast)
|
||||
{
|
||||
case LastWas.Pagination:
|
||||
CompareContent(ff.File1, ff.File2);// Compare DebugPagination
|
||||
break;
|
||||
case LastWas.Baseline:
|
||||
CompareContent3(ff.File1, ff.File2);// Compare DebugMeta
|
||||
break;
|
||||
case LastWas.Search:
|
||||
ShowSearchResults(ff.File1, ff.File2);// Perform search on DebugMeta
|
||||
break;
|
||||
default:
|
||||
CompareContent(ff.File1, ff.File2);//Default DebugPagination
|
||||
break;
|
||||
}
|
||||
//CompareOneFile(ff.File1, ff.File2);
|
||||
}
|
||||
}
|
||||
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
||||
if (ff != null)
|
||||
{
|
||||
// Fill Procedure or Result ListBoxes
|
||||
switch (myLast)
|
||||
{
|
||||
case LastWas.Pagination:
|
||||
CompareContent(ff.File1, ff.File2);// Compare DebugPagination
|
||||
break;
|
||||
case LastWas.Baseline:
|
||||
CompareContent3(ff.File1, ff.File2);// Compare DebugMeta
|
||||
break;
|
||||
case LastWas.Search:
|
||||
ShowSearchResults(ff.File1, ff.File2);// Perform search on DebugMeta
|
||||
break;
|
||||
default:
|
||||
CompareContent(ff.File1, ff.File2);//Default DebugPagination
|
||||
break;
|
||||
}
|
||||
//CompareOneFile(ff.File1, ff.File2);
|
||||
}
|
||||
}
|
||||
Procedures MyProcs1;
|
||||
Procedures MyProcs2;
|
||||
/// <summary>
|
||||
@@ -354,6 +361,13 @@ namespace Baseline
|
||||
lines1 = list1.AsEnumerable<string>();// Convert back to Enumerable to work with LINQ
|
||||
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>
|
||||
/// Include lines for Procedure or Page or Search is true
|
||||
/// Account for Case Insensitive CheckBox
|
||||
@@ -436,8 +450,8 @@ namespace Baseline
|
||||
private void lbResults1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
string line=null;
|
||||
if (lbResults1.SelectedItem is string v)
|
||||
line = v;
|
||||
if (lbResults1.SelectedItem is string)
|
||||
line = (string)lbResults1.SelectedItem;
|
||||
Line myLine = lbResults1.SelectedItem as Line;
|
||||
switch (myLast)
|
||||
{
|
||||
@@ -458,8 +472,8 @@ namespace Baseline
|
||||
{
|
||||
|
||||
string line=null;
|
||||
if(lbResults2.SelectedItem is string v)
|
||||
line = v;
|
||||
if(lbResults2.SelectedItem is string)
|
||||
line = (string)lbResults2.SelectedItem;
|
||||
Line myLine = lbResults2.SelectedItem as Line;
|
||||
|
||||
switch (myLast)
|
||||
@@ -489,7 +503,7 @@ namespace Baseline
|
||||
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.
|
||||
return fileList.First(); // the PDF file that we what should be top of the list then.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -501,10 +515,16 @@ namespace Baseline
|
||||
/// <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)
|
||||
// old logic was looking for the first occurence of ".S" in the txt string as the ending point of the procedure nuumber
|
||||
// Beaver Valley has a procedure number "1.SBGEN" in which the old logic would not work
|
||||
// 1.SBGEN.SC. ==> short path of attachment section "C"
|
||||
// 1.SBGEN.SC..S1. ==> short path of Step 1 in attachment section "C"
|
||||
string rtnstr = null;
|
||||
int lidx = -1;
|
||||
// if the item is to a high levels step or sub-step the short path as "..S" for each part of the step
|
||||
// so look for the last occurence of ".." which will be the end of the section information
|
||||
lidx = txt.LastIndexOf("..");
|
||||
if (lidx > 0)
|
||||
{
|
||||
lidx = txt.LastIndexOf(".S", lidx); // this will position us to the end of the procedure number
|
||||
}
|
||||
@@ -512,13 +532,9 @@ namespace Baseline
|
||||
{
|
||||
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;
|
||||
// B2018-113 - Replace slashes and backslashes with underscores just as PROMS does when creating a PDF file.
|
||||
rtnstr = txt.Substring(8, lidx - 8).Replace("/", "_").Replace("\\", "_");
|
||||
return rtnstr;
|
||||
}
|
||||
|
||||
string exePath;
|
||||
@@ -600,10 +616,10 @@ namespace Baseline
|
||||
progname = @"C:\Program Files (x86)\IDM Computer Solutions\UltraCompare\UC.exe";
|
||||
System.Diagnostics.ProcessStartInfo psi =
|
||||
new System.Diagnostics.ProcessStartInfo(progname, string.Format(@" -t ""{0}"" ""{1}""", compareFile, baseFile));
|
||||
_ = System.Diagnostics.Process.Start(psi);
|
||||
}
|
||||
System.Diagnostics.Process prc = System.Diagnostics.Process.Start(psi);
|
||||
}
|
||||
|
||||
private readonly ProcessLocationQueue myQueue= new ProcessLocationQueue();
|
||||
private ProcessLocationQueue myQueue= new ProcessLocationQueue();
|
||||
private Timer queueTimer = null;
|
||||
/// <summary>
|
||||
/// Move a Process to a specific screen location - This is done with a timer so
|
||||
@@ -616,11 +632,9 @@ namespace Baseline
|
||||
{
|
||||
if (queueTimer == null)
|
||||
{
|
||||
queueTimer = new Timer
|
||||
{
|
||||
Enabled = false
|
||||
};
|
||||
queueTimer.Tick += queueTimer_Tick;
|
||||
queueTimer = new Timer();
|
||||
queueTimer.Enabled = false;
|
||||
queueTimer.Tick += queueTimer_Tick;
|
||||
queueTimer.Interval = 1000;
|
||||
}
|
||||
myQueue.Add(proc, x, y);
|
||||
@@ -655,8 +669,8 @@ namespace Baseline
|
||||
string procPatern = string.Format("*{0}*.pdf", proc == string.Empty ? "noProcNumber" : proc);
|
||||
int pagenum = myLine.MyPage.Number;
|
||||
FindFile ff = lbDifferent.SelectedItem as FindFile;
|
||||
string PDFfileName;
|
||||
if (list == 1)
|
||||
string PDFfileName = null;
|
||||
if (list == 1)
|
||||
{
|
||||
FileInfo fi1 = new FileInfo(ff.File1);
|
||||
PDFfileName = GetPFDFileAndPath(fi1, procPatern);
|
||||
@@ -687,13 +701,11 @@ namespace Baseline
|
||||
return;
|
||||
}
|
||||
}
|
||||
// open the PDF and jump to the page number
|
||||
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A \"page={0}\" \"{1}\" ", pagenum, PDFfileName))
|
||||
{
|
||||
UseShellExecute = false
|
||||
};
|
||||
_ = System.Diagnostics.Process.Start(psi1);
|
||||
}
|
||||
// open the PDF and jump to the page number
|
||||
System.Diagnostics.ProcessStartInfo psi1 = new System.Diagnostics.ProcessStartInfo(exePath, string.Format("/A \"page={0}\" \"{1}\" ", pagenum,PDFfileName));
|
||||
psi1.UseShellExecute = false;
|
||||
System.Diagnostics.Process p1 = System.Diagnostics.Process.Start(psi1);
|
||||
}
|
||||
/// <summary>
|
||||
/// Perform Debug Meta file comparison for all of the folders within the automated testing folders
|
||||
/// </summary>
|
||||
@@ -773,10 +785,11 @@ namespace Baseline
|
||||
}
|
||||
private void lbProcedures_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
//Initialize Results List Box
|
||||
if (!(lbProcedures.SelectedItem is Procedure myProc)) return; // clicked on the white space (blank line) in the list of different procedures
|
||||
//TODO: May need to consider if there are duplicate procedure numers and titles
|
||||
Procedure myProc1 = MyProcs1.Find(x => x.Number == myProc.Number && x.Title == myProc.Title);
|
||||
//Initialize Results List Box
|
||||
Procedure myProc = lbProcedures.SelectedItem as Procedure;
|
||||
if (myProc == null) return; // clicked on the white space (blank line) in the list of different procedures
|
||||
//TODO: May need to consider if there are duplicate procedure numers and titles
|
||||
Procedure myProc1 = MyProcs1.Find(x => x.Number == myProc.Number && x.Title == myProc.Title);
|
||||
// Build the results ListBox for the left window
|
||||
lbResults1.Items.Clear();
|
||||
if (myProc1 != null)
|
||||
@@ -823,13 +836,28 @@ namespace Baseline
|
||||
};
|
||||
public class Settings
|
||||
{
|
||||
public BindingList<string> IgnoreLines { get; set; }
|
||||
}
|
||||
private BindingList<string> _IgnoreLines;
|
||||
public BindingList<string> IgnoreLines
|
||||
{
|
||||
get { return _IgnoreLines; }
|
||||
set { _IgnoreLines = value; }
|
||||
}
|
||||
}
|
||||
public partial class FindFile
|
||||
{
|
||||
public string File1 { get; set; }
|
||||
public string File2 { get; set; }
|
||||
public FindFile(string file1, string file2)
|
||||
private string _File1;
|
||||
public string File1
|
||||
{
|
||||
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;
|
||||
File2 = file2;
|
||||
@@ -837,16 +865,19 @@ namespace Baseline
|
||||
}
|
||||
public partial class FindFiles : List<FindFile>
|
||||
{
|
||||
private readonly string _FileName;
|
||||
public string FileName => _FileName;
|
||||
/// <summary>
|
||||
/// Build list of DocVersion Folders with differences
|
||||
/// </summary>
|
||||
/// <param name="path1">Base path</param>
|
||||
/// <param name="path2">Compare path</param>
|
||||
/// <param name="fileName">filename</param>
|
||||
/// <param name="myIgnore">Ignore list</param>
|
||||
public FindFiles(string path1, string path2, string fileName,IgnoreLines myIgnore)
|
||||
private string _FileName;
|
||||
public string FileName
|
||||
{
|
||||
get { return _FileName; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Build list of DocVersion Folders with differences
|
||||
/// </summary>
|
||||
/// <param name="path1">Base path</param>
|
||||
/// <param name="path2">Compare path</param>
|
||||
/// <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 di2 = new DirectoryInfo(path2);
|
||||
@@ -1072,16 +1103,34 @@ namespace Baseline
|
||||
// Text - the line of text
|
||||
public partial class Procedure
|
||||
{
|
||||
public string Number { get; set; }
|
||||
public string Title { get; set; }
|
||||
public Pages MyPages { get; set; } = new Pages();
|
||||
public Procedure(string number, string title)
|
||||
private string _Number;
|
||||
public string Number
|
||||
{
|
||||
Number = number;
|
||||
Title = title;
|
||||
get { return _Number; }
|
||||
set { _Number = value; }
|
||||
}
|
||||
public override string ToString() => string.Format("{0} - {1}", Number, Title);
|
||||
}
|
||||
private string _Title;
|
||||
public string Title
|
||||
{
|
||||
get { return _Title; }
|
||||
set { _Title = value; }
|
||||
}
|
||||
private Pages _MyPages = new Pages();
|
||||
public Pages MyPages
|
||||
{
|
||||
get { return _MyPages; }
|
||||
set { _MyPages = value; }
|
||||
}
|
||||
public Procedure(string number, string title)
|
||||
{
|
||||
_Number = number;
|
||||
_Title = title;
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0} - {1}", Number, Title);
|
||||
}
|
||||
}
|
||||
public partial class Procedures : List<Procedure>
|
||||
{
|
||||
// Sample data for a Procedure Number line
|
||||
@@ -1112,34 +1161,77 @@ namespace Baseline
|
||||
}
|
||||
public partial class Page
|
||||
{
|
||||
public int Number { get; set; }
|
||||
private int _Number;
|
||||
public int Number
|
||||
{
|
||||
get { return _Number; }
|
||||
set { _Number = value; }
|
||||
}
|
||||
private Lines _MyLines = new Lines();
|
||||
|
||||
public Lines MyLines { get; set; } = new Lines();
|
||||
public Page(int number) => Number = number;
|
||||
public override string ToString() => string.Format("Page {0}", Number);
|
||||
}
|
||||
public Lines MyLines
|
||||
{
|
||||
get { return _MyLines; }
|
||||
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 void Add(int number) => Add(new Page(number));
|
||||
}
|
||||
public void Add(int number)
|
||||
{
|
||||
Add(new Page(number));
|
||||
}
|
||||
}
|
||||
public partial class Line
|
||||
{
|
||||
public Procedure MyProc { get; set; }
|
||||
public Page MyPage { get; set; }
|
||||
public string Text { get; set; }
|
||||
public Line(string text) => Text = text;
|
||||
public Line(string text, Procedure myProc, Page myPage)
|
||||
private Procedure _MyProc;
|
||||
public Procedure MyProc
|
||||
{
|
||||
Text = text;
|
||||
MyProc = myProc;
|
||||
MyPage = myPage;
|
||||
get { return _MyProc; }
|
||||
set { _MyProc = value; }
|
||||
}
|
||||
public override string ToString() => Text;
|
||||
}
|
||||
private Page _MyPage;
|
||||
public Page MyPage
|
||||
{
|
||||
get { return _MyPage; }
|
||||
set { _MyPage = value; }
|
||||
}
|
||||
private string _Text;
|
||||
public string Text
|
||||
{
|
||||
get { return _Text; }
|
||||
set { _Text = value; }
|
||||
}
|
||||
public Line(string text)
|
||||
{
|
||||
_Text = text;
|
||||
}
|
||||
public Line(string text, Procedure myProc, Page myPage)
|
||||
{
|
||||
_Text = text;
|
||||
_MyProc = myProc;
|
||||
_MyPage = myPage;
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
}
|
||||
public partial class Lines : List<Line>
|
||||
{
|
||||
public void Add(string text) => Add(new Line(text));
|
||||
}
|
||||
public void Add(string text)
|
||||
{
|
||||
Add(new Line(text));
|
||||
}
|
||||
}
|
||||
[Serializable]
|
||||
public partial class IgnoreLine
|
||||
{
|
||||
@@ -1177,12 +1269,21 @@ namespace Baseline
|
||||
public IgnoreLines()
|
||||
{
|
||||
}
|
||||
public void Add(string text, Relation searchType, bool active) => Add(new IgnoreLine(text, searchType, active));
|
||||
// Convert IgnoreLines to string (XML)
|
||||
public override string ToString() => GenericSerializer<IgnoreLines>.StringSerialize(this);
|
||||
// Convert string to IgnoreLines
|
||||
public static IgnoreLines Get(string xml) => GenericSerializer<IgnoreLines>.StringDeserialize(xml);
|
||||
}
|
||||
public void Add(string text, Relation searchType, bool active)
|
||||
{
|
||||
Add(new IgnoreLine(text, searchType, active));
|
||||
}
|
||||
// Convert IgnoreLines to string (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>
|
||||
/// This is a simple serializer that takes a class and converts it to and from string (XML)
|
||||
/// </summary>
|
||||
@@ -1210,7 +1311,7 @@ namespace Baseline
|
||||
string ss = s.Replace("encoding=\"utf-16\"", "");
|
||||
XmlSerializer xs = new XmlSerializer(typeof(T));
|
||||
UTF8Encoding enc = new UTF8Encoding();
|
||||
byte[] arrBytData = enc.GetBytes(ss);
|
||||
Byte[] arrBytData = enc.GetBytes(ss);
|
||||
using (MemoryStream ms = new MemoryStream(arrBytData))
|
||||
{
|
||||
t = (T)xs.Deserialize(ms);
|
||||
@@ -1224,9 +1325,12 @@ namespace Baseline
|
||||
public class NonXsiTextWriter : XmlTextWriter
|
||||
{
|
||||
public NonXsiTextWriter(TextWriter w) : base(w) { }
|
||||
public NonXsiTextWriter(Stream w, Encoding encoding)
|
||||
: base(w, encoding) => Formatting = Formatting.Indented;
|
||||
public NonXsiTextWriter(string filename, Encoding encoding) : base(filename, encoding) { }
|
||||
public NonXsiTextWriter(Stream w, Encoding encoding)
|
||||
: base(w, encoding)
|
||||
{
|
||||
this.Formatting = Formatting.Indented;
|
||||
}
|
||||
public NonXsiTextWriter(string filename, Encoding encoding) : base(filename, encoding) { }
|
||||
bool _skip = false;
|
||||
public override void WriteStartAttribute(string prefix, string localName, string ns)
|
||||
{
|
||||
@@ -1268,16 +1372,32 @@ namespace Baseline
|
||||
public const short SWP_NOZORDER = 0X4;
|
||||
public const int SWP_SHOWWINDOW = 0x0040;
|
||||
|
||||
public System.Diagnostics.Process Process { get; set; }
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public ProcessLocation(System.Diagnostics.Process process, int x, int y)
|
||||
private System.Diagnostics.Process _Process;
|
||||
|
||||
public System.Diagnostics.Process Process
|
||||
{
|
||||
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;
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
private static bool FoxitSettingInfo = true;
|
||||
private static Boolean FoxitSettingInfo = true;
|
||||
|
||||
/// <summary>
|
||||
/// MoveIt() moves the window containing the PDF viewer to the right so the two pdf viewer windows will not overlap.
|
||||
@@ -1298,8 +1418,11 @@ namespace Baseline
|
||||
}
|
||||
public class ProcessLocationQueue: Queue<ProcessLocation>
|
||||
{
|
||||
public void Add(System.Diagnostics.Process process, int x, int y) => Enqueue(new ProcessLocation(process, x, y));
|
||||
public void ProcessNext()
|
||||
public void Add(System.Diagnostics.Process process, int x, int y)
|
||||
{
|
||||
Enqueue(new ProcessLocation(process,x,y));
|
||||
}
|
||||
public void ProcessNext()
|
||||
{
|
||||
ProcessLocation pl = Dequeue();
|
||||
pl.MoveIt();
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
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 Baseline
|
||||
@@ -12,7 +19,17 @@ namespace Baseline
|
||||
set {
|
||||
_MyIgnore = value;
|
||||
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;
|
||||
//dgvcSearchType.DataSource =
|
||||
//new List<Relation>((Relation[]) Enum.GetValues(typeof(Relation)))
|
||||
//.Select(x => new { Display=x.ToString(), Value=(int)x })
|
||||
//.ToList();;
|
||||
}
|
||||
}
|
||||
public frmSettings(IgnoreLines myIgnore)
|
||||
@@ -29,16 +46,19 @@ namespace Baseline
|
||||
col.ValueType = typeof(Relation);
|
||||
}
|
||||
|
||||
private void dgv_DataError(object sender, DataGridViewDataErrorEventArgs e) => Console.WriteLine("Here");
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
private void dgv_DataError(object sender, DataGridViewDataErrorEventArgs e)
|
||||
{
|
||||
DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
Close();
|
||||
Console.WriteLine("Here");
|
||||
}
|
||||
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)
|
||||
{
|
||||
DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
Close();
|
||||
this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
@@ -14,7 +15,7 @@ namespace AT.STO.UI.Win
|
||||
{
|
||||
#region Private Variable Declarations
|
||||
private IDropDownAware _dropDownControl = null;
|
||||
private readonly DropDownWindowHelper _dropDownHelper = null;
|
||||
private DropDownWindowHelper _dropDownHelper = null;
|
||||
private Form _owner = null;
|
||||
#endregion
|
||||
#region Constructor / Destructor
|
||||
@@ -46,7 +47,7 @@ namespace AT.STO.UI.Win
|
||||
/// <param name="e"></param>
|
||||
protected override void OnHandleCreated(EventArgs e)
|
||||
{
|
||||
_owner = FindForm();
|
||||
_owner = this.FindForm();
|
||||
_dropDownHelper.ReleaseHandle();
|
||||
|
||||
if (_owner != null)
|
||||
@@ -65,8 +66,8 @@ namespace AT.STO.UI.Win
|
||||
{
|
||||
base.OnResize(e);
|
||||
combo.Location = new Point(0, 0);
|
||||
combo.Width = ClientRectangle.Width;
|
||||
Height = combo.Height;
|
||||
combo.Width = this.ClientRectangle.Width;
|
||||
this.Height = combo.Height;
|
||||
}
|
||||
#endregion
|
||||
#region Event Handler
|
||||
@@ -95,7 +96,7 @@ namespace AT.STO.UI.Win
|
||||
else
|
||||
{
|
||||
_dropDownHelper.CloseDropDown();
|
||||
Focus();
|
||||
this.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +115,7 @@ namespace AT.STO.UI.Win
|
||||
|
||||
private void DropDownHelper_DropDownCancel(object sender, DropDownCancelEventArgs e)
|
||||
{
|
||||
if (Bounds.Contains(Parent.PointToClient(e.CursorLocation)))
|
||||
if (this.Bounds.Contains(Parent.PointToClient(e.CursorLocation)))
|
||||
{
|
||||
e.Cancel = true;
|
||||
}
|
||||
@@ -136,22 +137,31 @@ namespace AT.STO.UI.Win
|
||||
{
|
||||
SetValue<long>(e.Value as ILookupItem<long>);
|
||||
}
|
||||
|
||||
FinishEditing?.Invoke(this, e);
|
||||
|
||||
_dropDownControl.FinishEditing -= new DropDownValueChangedEventHandler(DropDown_FinishEditing);
|
||||
|
||||
if (this.FinishEditing != null)
|
||||
{
|
||||
this.FinishEditing(this, e);
|
||||
}
|
||||
|
||||
_dropDownControl.FinishEditing -= new DropDownValueChangedEventHandler(DropDown_FinishEditing);
|
||||
_dropDownControl.ValueChanged -= new DropDownValueChangedEventHandler(DropDown_ValueChanged);
|
||||
_dropDownHelper.CloseDropDown();
|
||||
}
|
||||
|
||||
private void DropDown_ValueChanged(object sender, DropDownValueChangedEventArgs e) => ValueChanged?.Invoke(this, e);
|
||||
#endregion
|
||||
#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)]
|
||||
|
||||
private void DropDown_ValueChanged(object sender, DropDownValueChangedEventArgs e)
|
||||
{
|
||||
if (this.ValueChanged != null)
|
||||
{
|
||||
this.ValueChanged(this, e);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#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
|
||||
{
|
||||
get { return _dropDownControl; }
|
||||
@@ -159,21 +169,24 @@ namespace AT.STO.UI.Win
|
||||
{
|
||||
_dropDownControl = value;
|
||||
|
||||
Controls.Add(_dropDownControl as Control);
|
||||
this.Controls.Add(_dropDownControl as Control);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Public Methods
|
||||
public override string ToString() => Name;
|
||||
#endregion
|
||||
#region Private Methods
|
||||
/// <summary>
|
||||
/// Calculate an acceptable position of the DropDownForm even in a
|
||||
/// multi screen environment.
|
||||
/// </summary>
|
||||
/// <param name="DropDown"></param>
|
||||
/// <returns></returns>
|
||||
private Point GetDropDownPosition(DropDownForm DropDown)
|
||||
#endregion
|
||||
#region Public Methods
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
#endregion
|
||||
#region Private Methods
|
||||
/// <summary>
|
||||
/// Calculate an acceptable position of the DropDownForm even in a
|
||||
/// multi screen environment.
|
||||
/// </summary>
|
||||
/// <param name="DropDown"></param>
|
||||
/// <returns></returns>
|
||||
private Point GetDropDownPosition(DropDownForm DropDown)
|
||||
{
|
||||
Point lt = Parent.PointToScreen(new Point(Left, Top));
|
||||
Point rb = Parent.PointToScreen(new Point(Right, Bottom));
|
||||
|
||||
@@ -35,9 +35,10 @@ namespace AT.STO.UI.Win
|
||||
/// </summary>
|
||||
public class DropDownCancelEventArgs : EventArgs
|
||||
{
|
||||
#region Private Variable Declarations
|
||||
private Point _cursorLocation;
|
||||
private readonly Form _dropDown = null;
|
||||
#region Private Variable Declarations
|
||||
private bool _cancel = false;
|
||||
private Point _cursorLocation;
|
||||
private Form _dropDown = null;
|
||||
#endregion
|
||||
#region Constructor / Destructor
|
||||
/// <summary>
|
||||
@@ -50,26 +51,36 @@ namespace AT.STO.UI.Win
|
||||
{
|
||||
_dropDown = DropDown;
|
||||
_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>
|
||||
public Point CursorLocation => _cursorLocation;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Point CursorLocation
|
||||
{
|
||||
get { return _cursorLocation; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Form DropDown => _dropDown;
|
||||
#endregion
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public Form DropDown
|
||||
{
|
||||
get { return _dropDown; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Contains event information for a <see cref="DropDownClosed"/> event.
|
||||
@@ -80,50 +91,64 @@ namespace AT.STO.UI.Win
|
||||
public class DropDownClosedEventArgs : EventArgs
|
||||
{
|
||||
#region Private Variable Declarations
|
||||
private readonly Form _dropDown = null;
|
||||
#endregion
|
||||
#region Constructor / Destructor
|
||||
/// <summary>
|
||||
/// Constructs a new instance of this class for the specified
|
||||
/// popup form.
|
||||
/// </summary>
|
||||
/// <param name="DropDown">DropDown Form which is being closed.</param>
|
||||
public DropDownClosedEventArgs(Form DropDown) => _dropDown = DropDown;
|
||||
#endregion
|
||||
#region Public Properties
|
||||
/// <summary>
|
||||
/// Gets the dropdown form which is being closed.
|
||||
/// </summary>
|
||||
public Form DropDown => _dropDown;
|
||||
#endregion
|
||||
}
|
||||
private Form _dropDown = null;
|
||||
#endregion
|
||||
#region Constructor / Destructor
|
||||
/// <summary>
|
||||
/// Constructs a new instance of this class for the specified
|
||||
/// popup form.
|
||||
/// </summary>
|
||||
/// <param name="DropDown">DropDown Form which is being closed.</param>
|
||||
public DropDownClosedEventArgs(Form DropDown)
|
||||
{
|
||||
_dropDown = DropDown;
|
||||
}
|
||||
#endregion
|
||||
#region Public Properties
|
||||
/// <summary>
|
||||
/// Gets the dropdown form which is being closed.
|
||||
/// </summary>
|
||||
public Form DropDown
|
||||
{
|
||||
get { return _dropDown; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Contains event information for DropDownValueChangedEventHandler.
|
||||
/// </summary>
|
||||
public class DropDownValueChangedEventArgs : EventArgs
|
||||
{
|
||||
#region Private Variable Declarations
|
||||
#endregion
|
||||
#region Constructor / Destructor
|
||||
/// <summary>
|
||||
/// Default Constructor
|
||||
/// </summary>
|
||||
public DropDownValueChangedEventArgs()
|
||||
#region Private Variable Declarations
|
||||
private object _value = null;
|
||||
#endregion
|
||||
#region Constructor / Destructor
|
||||
/// <summary>
|
||||
/// Default Constructor
|
||||
/// </summary>
|
||||
public DropDownValueChangedEventArgs()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialization with the control's value.
|
||||
/// </summary>
|
||||
/// <param name="Value"></param>
|
||||
public DropDownValueChangedEventArgs(object Value) => this.Value = Value;
|
||||
#endregion
|
||||
#region Public Properties
|
||||
/// <summary>
|
||||
/// Gets or sets the control's value.
|
||||
/// </summary>
|
||||
public object Value { get; set; } = null;
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialization with the control's value.
|
||||
/// </summary>
|
||||
/// <param name="Value"></param>
|
||||
public DropDownValueChangedEventArgs(object Value)
|
||||
{
|
||||
_value = Value;
|
||||
}
|
||||
#endregion
|
||||
#region Public Properties
|
||||
/// <summary>
|
||||
/// Gets or sets the control's value.
|
||||
/// </summary>
|
||||
public object Value
|
||||
{
|
||||
get { return _value; }
|
||||
set { _value = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,19 +13,22 @@ namespace AT.STO.UI.Win
|
||||
internal partial class DropDownForm : Form, IDropDownAware
|
||||
{
|
||||
#region Private Variable Declaration
|
||||
private readonly IDropDownAware _control = null;
|
||||
#endregion
|
||||
#region Constructor / Destructor
|
||||
/// <summary>
|
||||
/// Default Constructor
|
||||
/// </summary>
|
||||
public DropDownForm() => InitializeComponent();
|
||||
private IDropDownAware _control = null;
|
||||
#endregion
|
||||
#region Constructor / Destructor
|
||||
/// <summary>
|
||||
/// Default Constructor
|
||||
/// </summary>
|
||||
public DropDownForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to initialize the for with the control to display.
|
||||
/// </summary>
|
||||
/// <param name="Ctrl">The control to display.</param>
|
||||
public DropDownForm(IDropDownAware Ctrl) : this()
|
||||
/// <summary>
|
||||
/// Constructor to initialize the for with the control to display.
|
||||
/// </summary>
|
||||
/// <param name="Ctrl">The control to display.</param>
|
||||
public DropDownForm(IDropDownAware Ctrl) : this()
|
||||
{
|
||||
if (Ctrl != null)
|
||||
{
|
||||
@@ -38,7 +41,7 @@ namespace AT.STO.UI.Win
|
||||
#region Form Events
|
||||
protected override void OnClosing(CancelEventArgs e)
|
||||
{
|
||||
Controls.Remove(_control as Control);
|
||||
this.Controls.Remove(_control as Control);
|
||||
base.OnClosing(e);
|
||||
}
|
||||
|
||||
@@ -55,20 +58,29 @@ namespace AT.STO.UI.Win
|
||||
#region Event Handler
|
||||
private void Ctrl_FinishEditing(object sender, DropDownValueChangedEventArgs e)
|
||||
{
|
||||
FinishEditing?.Invoke(this, e);
|
||||
if (this.FinishEditing != null)
|
||||
{
|
||||
this.FinishEditing(this, e);
|
||||
}
|
||||
|
||||
_control.FinishEditing -= new DropDownValueChangedEventHandler(Ctrl_FinishEditing);
|
||||
_control.FinishEditing -= new DropDownValueChangedEventHandler(Ctrl_FinishEditing);
|
||||
_control.ValueChanged -= new DropDownValueChangedEventHandler(Ctrl_ValueChanged);
|
||||
}
|
||||
|
||||
private void Ctrl_ValueChanged(object sender, DropDownValueChangedEventArgs e) => ValueChanged?.Invoke(this, e);
|
||||
#endregion
|
||||
#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;
|
||||
|
||||
private void Ctrl_ValueChanged(object sender, DropDownValueChangedEventArgs e)
|
||||
{
|
||||
if (this.ValueChanged != null)
|
||||
{
|
||||
this.ValueChanged(this, e);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#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>
|
||||
/// Fired on any change of the controls's value during the editing process.
|
||||
@@ -88,15 +100,15 @@ namespace AT.STO.UI.Win
|
||||
private void InitializeControl(Control Ctrl)
|
||||
{
|
||||
Size size = Ctrl.Size;
|
||||
Size inner = ClientRectangle.Size;
|
||||
Size outer = Size;
|
||||
Size inner = this.ClientRectangle.Size;
|
||||
Size outer = this.Size;
|
||||
int gap = outer.Width - inner.Width;
|
||||
|
||||
size.Width += gap;
|
||||
size.Height += gap;
|
||||
|
||||
Size = size;
|
||||
Controls.Add(Ctrl);
|
||||
this.Size = size;
|
||||
this.Controls.Add(Ctrl);
|
||||
Ctrl.Location = new Point(0, 0);
|
||||
Ctrl.Visible = true;
|
||||
Ctrl.Invalidate();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
@@ -20,48 +21,59 @@ namespace AT.STO.UI.Win
|
||||
private const int WM_NCLBUTTONDOWN = 0x0A1;
|
||||
private const int WM_NCRBUTTONDOWN = 0x0A4;
|
||||
private const int WM_NCMBUTTONDOWN = 0x0A7;
|
||||
#endregion
|
||||
#region Private Variable Declarations
|
||||
private readonly DropDownWindowHelper _owner = null;
|
||||
#endregion
|
||||
#region Private Variable Declarations
|
||||
private Form _dropDown = null;
|
||||
private DropDownWindowHelper _owner = null;
|
||||
#endregion
|
||||
#region Event Declarations
|
||||
public event DropDownCancelEventHandler DropDownCancel;
|
||||
#endregion
|
||||
#region Constructor / Destructor
|
||||
/// <summary>
|
||||
/// Constructs a new instance of this class and sets the owning
|
||||
/// object.
|
||||
/// </summary>
|
||||
/// <param name="Owner">The <see cref="DropDownWindowHelper"/> object
|
||||
/// which owns this class.</param>
|
||||
public DropDownMessageFilter(DropDownWindowHelper Owner) => _owner = Owner;
|
||||
#endregion
|
||||
#region Public Properties
|
||||
/// <summary>
|
||||
/// Gets/sets the dropdown form which is being displayed.
|
||||
/// </summary>
|
||||
public Form DropDown { get; set; } = null;
|
||||
#endregion
|
||||
#region Private Methods
|
||||
private void OnMouseDown()
|
||||
#endregion
|
||||
#region Constructor / Destructor
|
||||
/// <summary>
|
||||
/// Constructs a new instance of this class and sets the owning
|
||||
/// object.
|
||||
/// </summary>
|
||||
/// <param name="Owner">The <see cref="DropDownWindowHelper"/> object
|
||||
/// which owns this class.</param>
|
||||
public DropDownMessageFilter(DropDownWindowHelper Owner)
|
||||
{
|
||||
_owner = Owner;
|
||||
}
|
||||
#endregion
|
||||
#region Public Properties
|
||||
/// <summary>
|
||||
/// Gets/sets the dropdown form which is being displayed.
|
||||
/// </summary>
|
||||
public Form DropDown
|
||||
{
|
||||
get { return _dropDown; }
|
||||
set { _dropDown = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Private Methods
|
||||
private void OnMouseDown()
|
||||
{
|
||||
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
|
||||
#region DropDownCancelEvent Implementation
|
||||
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
||||
{
|
||||
DropDownCancel?.Invoke(this, e);
|
||||
if (this.DropDownCancel != null)
|
||||
{
|
||||
this.DropDownCancel(this, e);
|
||||
}
|
||||
|
||||
if (!e.Cancel)
|
||||
if (!e.Cancel)
|
||||
{
|
||||
_owner.CloseDropDown();
|
||||
DropDown = null; // Clear reference for GC
|
||||
_dropDown = null; // Clear reference for GC
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -78,7 +90,7 @@ namespace AT.STO.UI.Win
|
||||
/// This implementation always returns <c>false</c>.</returns>
|
||||
public bool PreFilterMessage(ref Message m)
|
||||
{
|
||||
if (DropDown != null)
|
||||
if (_dropDown != null)
|
||||
{
|
||||
switch (m.Msg)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AT.STO.UI.Win
|
||||
@@ -21,7 +22,7 @@ namespace AT.STO.UI.Win
|
||||
|
||||
private Form _dropDown = null;
|
||||
private bool _dropDownShowing = false;
|
||||
private readonly DropDownMessageFilter _filter = null;
|
||||
private DropDownMessageFilter _filter = null;
|
||||
private Form _owner = null;
|
||||
private bool _skipClose = false;
|
||||
#endregion
|
||||
@@ -41,25 +42,31 @@ namespace AT.STO.UI.Win
|
||||
_filter.DropDownCancel -= new DropDownCancelEventHandler(Popup_Cancel);
|
||||
_filter.DropDownCancel += new DropDownCancelEventHandler(Popup_Cancel);
|
||||
}
|
||||
#endregion
|
||||
#region Event Handler
|
||||
private void Popup_Cancel(object sender, DropDownCancelEventArgs e) => OnDropDownCancel(e);
|
||||
#endregion
|
||||
#region Event Handler
|
||||
private void Popup_Cancel(object sender, DropDownCancelEventArgs e)
|
||||
{
|
||||
OnDropDownCancel(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Responds to the <see cref="System.Windows.Forms.Form.Closed"/>
|
||||
/// event from the popup form.
|
||||
/// </summary>
|
||||
/// <param name="sender">Popup form that has been closed.</param>
|
||||
/// <param name="e">Not used.</param>
|
||||
private void Popup_Closed(object sender, EventArgs e) => CloseDropDown();
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// the user clicks onto another application whilst the popup is visible.
|
||||
/// </summary>
|
||||
/// <param name="m">Window Procedure Message</param>
|
||||
protected override void WndProc(ref Message m)
|
||||
/// <summary>
|
||||
/// Responds to the <see cref="System.Windows.Forms.Form.Closed"/>
|
||||
/// event from the popup form.
|
||||
/// </summary>
|
||||
/// <param name="sender">Popup form that has been closed.</param>
|
||||
/// <param name="e">Not used.</param>
|
||||
private void Popup_Closed(object sender, EventArgs e)
|
||||
{
|
||||
CloseDropDown();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// the user clicks onto another application whilst the popup is visible.
|
||||
/// </summary>
|
||||
/// <param name="m">Window Procedure Message</param>
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
base.WndProc(ref m);
|
||||
|
||||
@@ -69,7 +76,7 @@ namespace AT.STO.UI.Win
|
||||
{
|
||||
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
|
||||
UIApiCalls.SendMessage(Handle, UIApiCalls.WM_NCACTIVATE, 1, IntPtr.Zero); // If so reactivate it.
|
||||
UIApiCalls.SendMessage(this.Handle, UIApiCalls.WM_NCACTIVATE, 1, IntPtr.Zero); // If so reactivate it.
|
||||
}
|
||||
}
|
||||
else if (m.Msg == UIApiCalls.WM_ACTIVATEAPP)
|
||||
@@ -77,7 +84,7 @@ namespace AT.STO.UI.Win
|
||||
if ((int)m.WParam == 0) // Check if the application is being deactivated.
|
||||
{
|
||||
CloseDropDown(); // It is so cancel the popup:
|
||||
UIApiCalls.PostMessage(Handle, UIApiCalls.WM_NCACTIVATE, 0, IntPtr.Zero); // And put the title bar into the inactive state:
|
||||
UIApiCalls.PostMessage(this.Handle, UIApiCalls.WM_NCACTIVATE, 0, IntPtr.Zero); // And put the title bar into the inactive state:
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,19 +168,22 @@ namespace AT.STO.UI.Win
|
||||
_owner = null;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Public Properties
|
||||
/// <summary>
|
||||
/// Indicator weither the DropDown is showing.
|
||||
/// </summary>
|
||||
public bool DropDownShowing => _dropDownShowing;
|
||||
#endregion
|
||||
#region Event Implementation
|
||||
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
||||
#endregion
|
||||
#region Public Properties
|
||||
/// <summary>
|
||||
/// Indicator weither the DropDown is showing.
|
||||
/// </summary>
|
||||
public bool DropDownShowing
|
||||
{
|
||||
if (DropDownCancel != null)
|
||||
get { return _dropDownShowing; }
|
||||
}
|
||||
#endregion
|
||||
#region Event Implementation
|
||||
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
||||
{
|
||||
if (this.DropDownCancel != null)
|
||||
{
|
||||
DropDownCancel(this, e);
|
||||
this.DropDownCancel(this, e);
|
||||
|
||||
if (!e.Cancel)
|
||||
{
|
||||
@@ -181,8 +191,14 @@ namespace AT.STO.UI.Win
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnPDropDownClosed(DropDownClosedEventArgs e) => DropDownClosed?.Invoke(this, e);
|
||||
#endregion
|
||||
}
|
||||
|
||||
protected virtual void OnPDropDownClosed(DropDownClosedEventArgs e)
|
||||
{
|
||||
if (this.DropDownClosed != null)
|
||||
{
|
||||
this.DropDownClosed(this, e);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using System;
|
||||
|
||||
namespace AT.STO.UI.Win
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using System;
|
||||
|
||||
namespace AT.STO.UI.Win
|
||||
{
|
||||
public interface ILookupItem<T> where T: struct
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
//using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
||||
@@ -119,7 +121,10 @@ namespace JR.Utils.GUI.Forms
|
||||
/// </summary>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(string text) => FlexibleMessageBoxForm.Show(null, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
public static DialogResult Show(string text)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -127,7 +132,10 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="owner">The owner.</param>
|
||||
/// <param name="text">The text.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text) => FlexibleMessageBoxForm.Show(owner, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
public static DialogResult Show(IWin32Window owner, string text)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -135,7 +143,10 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(string text, string caption) => FlexibleMessageBoxForm.Show(null, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
public static DialogResult Show(string text, string caption)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -144,7 +155,10 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="text">The text.</param>
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption) => FlexibleMessageBoxForm.Show(owner, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, caption, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -153,7 +167,10 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons) => FlexibleMessageBoxForm.Show(null, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -163,7 +180,10 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="caption">The caption.</param>
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons) => FlexibleMessageBoxForm.Show(owner, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -173,7 +193,10 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <returns></returns>
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon) => FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -184,7 +207,10 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="buttons">The buttons.</param>
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon) => FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, MessageBoxDefaultButton.Button1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -195,7 +221,10 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <param name="defaultButton">The default button.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton) => FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, defaultButton);
|
||||
public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(null, text, caption, buttons, icon, defaultButton);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -207,7 +236,10 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <param name="defaultButton">The default button.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton) => FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, defaultButton);
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
||||
{
|
||||
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, defaultButton);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the specified message box.
|
||||
@@ -219,8 +251,10 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <param name="defaultButton">The default button.</param>
|
||||
/// <returns>The dialog result.</returns>
|
||||
[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);
|
||||
public static DialogResult ShowCustom(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
|
||||
{
|
||||
return FlexibleMessageBoxForm.ShowCustom(null, text, caption, buttons, icon);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -307,7 +341,7 @@ namespace JR.Utils.GUI.Forms
|
||||
this.richTextBoxMessage.TabIndex = 0;
|
||||
this.richTextBoxMessage.TabStop = false;
|
||||
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
|
||||
//
|
||||
@@ -397,8 +431,8 @@ namespace JR.Utils.GUI.Forms
|
||||
#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)
|
||||
private static readonly string STANDARD_MESSAGEBOX_SEPARATOR_LINES = "---------------------------\n";
|
||||
private static readonly string STANDARD_MESSAGEBOX_SEPARATOR_SPACES = " ";
|
||||
private static readonly String STANDARD_MESSAGEBOX_SEPARATOR_LINES = "---------------------------\n";
|
||||
private static readonly String STANDARD_MESSAGEBOX_SEPARATOR_SPACES = " ";
|
||||
|
||||
//These are the possible buttons (in a standard MessageBox)
|
||||
private enum ButtonID { OK = 0, CANCEL, YES, NO, ABORT, RETRY, IGNORE, OVERWRITE, RENAME };
|
||||
@@ -406,10 +440,10 @@ namespace JR.Utils.GUI.Forms
|
||||
//These are the buttons texts for different languages.
|
||||
//If you want to add a new language, add it here and in the GetButtonText-Function
|
||||
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_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_ITALIAN_IT = { "OK", "Annulla", "&Sì", "&No", "&Interrompi", "&Riprova", "&Ignora", "&Overwrite", "&Rename" };
|
||||
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_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" };
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -417,7 +451,7 @@ namespace JR.Utils.GUI.Forms
|
||||
|
||||
private MessageBoxDefaultButton defaultButton;
|
||||
private int visibleButtonsCount;
|
||||
private readonly TwoLetterISOLanguageID languageID = TwoLetterISOLanguageID.en;
|
||||
private TwoLetterISOLanguageID languageID = TwoLetterISOLanguageID.en;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -724,9 +758,9 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
|
||||
private void FlexibleMessageBoxForm_Shown(object sender, EventArgs e)
|
||||
{
|
||||
int buttonIndexToFocus = 1;
|
||||
Button buttonToFocus;
|
||||
|
||||
int buttonIndexToFocus;
|
||||
//Set the default button...
|
||||
switch (this.defaultButton)
|
||||
{
|
||||
@@ -765,7 +799,7 @@ namespace JR.Utils.GUI.Forms
|
||||
/// </summary>
|
||||
/// <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>
|
||||
private void RichTextBoxMessage_LinkClicked(object sender, LinkClickedEventArgs e)
|
||||
private void richTextBoxMessage_LinkClicked(object sender, LinkClickedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -843,14 +877,12 @@ namespace JR.Utils.GUI.Forms
|
||||
public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton)
|
||||
{
|
||||
//Create a new instance of the FlexibleMessageBox form
|
||||
var flexibleMessageBoxForm = new FlexibleMessageBoxForm
|
||||
{
|
||||
ShowInTaskbar = false,
|
||||
var flexibleMessageBoxForm = new FlexibleMessageBoxForm();
|
||||
flexibleMessageBoxForm.ShowInTaskbar = false;
|
||||
|
||||
//Bind the caption and the message text
|
||||
CaptionText = caption,
|
||||
MessageText = text
|
||||
};
|
||||
//Bind the caption and the message text
|
||||
flexibleMessageBoxForm.CaptionText = caption;
|
||||
flexibleMessageBoxForm.MessageText = text;
|
||||
flexibleMessageBoxForm.FlexibleMessageBoxFormBindingSource.DataSource = flexibleMessageBoxForm;
|
||||
|
||||
//Set the buttons visibilities and texts. Also set a default button.
|
||||
@@ -882,18 +914,15 @@ namespace JR.Utils.GUI.Forms
|
||||
/// <param name="icon">The icon.</param>
|
||||
/// <param name="defaultButton">The default button.</param>
|
||||
/// <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)
|
||||
{
|
||||
//Create a new instance of the FlexibleMessageBox form
|
||||
var flexibleMessageBoxForm = new FlexibleMessageBoxForm
|
||||
{
|
||||
ShowInTaskbar = false,
|
||||
var flexibleMessageBoxForm = new FlexibleMessageBoxForm();
|
||||
flexibleMessageBoxForm.ShowInTaskbar = false;
|
||||
|
||||
//Bind the caption and the message text
|
||||
CaptionText = caption,
|
||||
MessageText = text
|
||||
};
|
||||
//Bind the caption and the message text
|
||||
flexibleMessageBoxForm.CaptionText = caption;
|
||||
flexibleMessageBoxForm.MessageText = text;
|
||||
flexibleMessageBoxForm.FlexibleMessageBoxFormBindingSource.DataSource = flexibleMessageBoxForm;
|
||||
|
||||
//Set the buttons visibilities and texts. Also set a default button.
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
<Compile Include="frmFormatCopy.Designer.cs">
|
||||
<DependentUpon>frmFormatCopy.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="frmFormatCopy.resx">
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// 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,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
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.
@@ -1,4 +1,9 @@
|
||||
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;
|
||||
|
||||
@@ -23,7 +28,7 @@ namespace Formats
|
||||
txbxPROMSFormatsPath.Text = savedFormatPath;
|
||||
else
|
||||
{
|
||||
string curFolder = Environment.CurrentDirectory; // .../PROMS/Formats/bin/debug
|
||||
string curFolder = Environment.CurrentDirectory; // C:\development/PROMS/Formats/bin/debug
|
||||
int idx = curFolder.ToUpper().IndexOf(@"\PROMS\");
|
||||
txbxPROMSFormatsPath.Text = curFolder.Substring(0, idx);
|
||||
}
|
||||
@@ -35,8 +40,9 @@ namespace Formats
|
||||
DirectoryInfo di = new DirectoryInfo(path);
|
||||
if (di.Exists == false) //return;
|
||||
{
|
||||
DialogResult dlgrslt = MessageBox.Show(string.Format("{0} does not exist. Create it?", path), "Create Folder?", MessageBoxButtons.YesNo);
|
||||
if (dlgrslt == DialogResult.Yes)
|
||||
DialogResult dlgrslt = DialogResult.No;
|
||||
dlgrslt = MessageBox.Show(string.Format("{0} does not exist. Create it?", path), "Create Folder?", MessageBoxButtons.YesNo);
|
||||
if (dlgrslt == DialogResult.Yes)
|
||||
{
|
||||
di.Create();
|
||||
di.CreateSubdirectory("fmtall");
|
||||
@@ -80,11 +86,10 @@ namespace Formats
|
||||
|
||||
private void btnBrowse_Click(object sender, EventArgs e)
|
||||
{
|
||||
FolderBrowserDialog fbd = new FolderBrowserDialog
|
||||
{
|
||||
SelectedPath = txbxPROMSFormatsPath.Text
|
||||
};
|
||||
if (fbd.ShowDialog() == DialogResult.OK)
|
||||
FolderBrowserDialog fbd = new FolderBrowserDialog();
|
||||
|
||||
fbd.SelectedPath = txbxPROMSFormatsPath.Text;
|
||||
if (fbd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (Directory.Exists(fbd.SelectedPath)) txbxPROMSFormatsPath.Text = fbd.SelectedPath + @"\";
|
||||
}
|
||||
@@ -111,9 +116,9 @@ namespace Formats
|
||||
if (!txbxPROMSFormatsPath.Text.EndsWith(@"\")) txbxPROMSFormatsPath.Text += @"\";
|
||||
|
||||
// There should be a "fmtall" and "genmacall" folder in the delelopment project folder
|
||||
// ex: ...\PROMS\Formats\fmtall and ...\PROMS\Formats\genmacall
|
||||
string destFmtallPath = $@"{txbxPROMSFormatsPath.Text}fmtall\";
|
||||
string destGenmacallPath = $@"{txbxPROMSFormatsPath.Text}genmacall\";
|
||||
// ex: C:\development\PROMS\Formats\fmtall and C:\development\PROMS\Formats\genmacall
|
||||
string destFmtallPath = txbxPROMSFormatsPath.Text + @"fmtall\";
|
||||
string destGenmacallPath = txbxPROMSFormatsPath.Text + @"genmacall\";
|
||||
string srcFmtallPath = @"..\..\"; // up to levels from startup path
|
||||
|
||||
// clear the destination fmtall and genmacall folders
|
||||
@@ -151,10 +156,14 @@ 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.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();
|
||||
}
|
||||
|
||||
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.
@@ -1,8 +0,0 @@
|
||||
// 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")]
|
||||
+883
-313
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -79,7 +79,6 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="LBComObject.cs" />
|
||||
<Compile Include="LBObjectExtension.cs" />
|
||||
<Compile Include="OutlookLBComObject.cs" />
|
||||
|
||||
@@ -1,45 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
|
||||
namespace LBOutlookLibrary
|
||||
{
|
||||
public abstract partial class LBComObject
|
||||
{
|
||||
private object _Item;
|
||||
internal object Item
|
||||
private Object _Item;
|
||||
internal Object Item
|
||||
{
|
||||
get { return _Item; }
|
||||
set
|
||||
{
|
||||
_Item = value;
|
||||
if (value != null) MyType = _Item.GetType();
|
||||
if (value != null) _MyType = _Item.GetType();
|
||||
}
|
||||
}
|
||||
|
||||
public Type MyType { get; set; }
|
||||
protected LBComObject() { }
|
||||
private Type _MyType;
|
||||
public Type MyType
|
||||
{
|
||||
get { return _MyType; }
|
||||
set { _MyType = value; }
|
||||
}
|
||||
protected LBComObject() { }
|
||||
protected LBComObject(string ProgID)
|
||||
{
|
||||
Type objClassType;
|
||||
objClassType = Type.GetTypeFromProgID(ProgID);
|
||||
Item = Activator.CreateInstance(objClassType);
|
||||
}
|
||||
protected LBComObject(object item) => Item = item;
|
||||
private object DoInvokeMember(string name, object[] parameters, BindingFlags bf, Binder b)
|
||||
protected LBComObject(Object item)
|
||||
{
|
||||
Item = item;
|
||||
}
|
||||
private Object DoInvokeMember(string name, Object[] parameters, BindingFlags bf, Binder b)
|
||||
{
|
||||
try
|
||||
{
|
||||
return MyType.InvokeMember(name, bf, b, _Item, parameters);
|
||||
return _MyType.InvokeMember(name, bf, b, _Item, parameters);
|
||||
}
|
||||
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) => DoInvokeMember(propertyName, parameters, BindingFlags.SetProperty, null);
|
||||
protected object GetProperty(string propertyName) => DoInvokeMember(propertyName, null, BindingFlags.GetProperty, null);
|
||||
protected object GetProperty(string propertyName, params object[] parameters) => DoInvokeMember(propertyName, parameters, BindingFlags.GetProperty, null);
|
||||
protected object InvokeMethod(string methodName, params object[] parameters)
|
||||
protected void SetProperty(string propertyName, params Object[] parameters)
|
||||
{
|
||||
DoInvokeMember(propertyName, parameters, BindingFlags.SetProperty, null);
|
||||
}
|
||||
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)
|
||||
FixParameters(parameters);
|
||||
@@ -52,15 +71,45 @@ namespace LBOutlookLibrary
|
||||
if (parameters[i] is LBComObject)
|
||||
parameters[i] = (parameters[i] as LBComObject).Item;
|
||||
}
|
||||
protected object InvokeMethod(string methodName) => InvokeMethod(methodName, null);
|
||||
}
|
||||
protected Object InvokeMethod(string methodName)
|
||||
{
|
||||
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 LBApplicationClass() : base("Outlook.Application") { }
|
||||
public LBApplicationClass(object item) : base(item) { }
|
||||
public object CreateItem(LBOlItemType ItemType) => InvokeMethod("CreateItem", ItemType);
|
||||
public void Quit() => InvokeMethod("Quit");
|
||||
}
|
||||
public LBApplicationClass(Object item) : base(item) { }
|
||||
public System.Object CreateItem(LBOlItemType ItemType)
|
||||
{
|
||||
return InvokeMethod("CreateItem", ItemType);
|
||||
}
|
||||
public void Quit()
|
||||
{
|
||||
InvokeMethod("Quit");
|
||||
}
|
||||
}
|
||||
public enum LBOlItemType
|
||||
{
|
||||
olMailItem = 0,
|
||||
@@ -75,13 +124,13 @@ namespace LBOutlookLibrary
|
||||
public partial class LBMailItem : LBComObject
|
||||
{
|
||||
public LBMailItem() { }
|
||||
public LBMailItem(object item) : base(item) { }
|
||||
public LBMailItem(Object item) : base(item) { }
|
||||
}
|
||||
public partial class LBMailItemClass : LBComObject
|
||||
{
|
||||
public LBMailItemClass() { }
|
||||
public LBMailItemClass(object item) : base(item) { }
|
||||
public string Body
|
||||
public LBMailItemClass(Object item) : base(item) { }
|
||||
public String Body
|
||||
{
|
||||
get { return (GetProperty("Body").ToString()); }
|
||||
set { SetProperty("Body", value); }
|
||||
@@ -91,20 +140,29 @@ namespace LBOutlookLibrary
|
||||
get { return (LBOlBodyFormat)GetProperty("BodyFormat"); }
|
||||
set { SetProperty("BodyFormat", value); }
|
||||
}
|
||||
public LBAttachments Attachments => new LBAttachments(GetProperty("Attachments"));
|
||||
public string Subject
|
||||
public LBAttachments Attachments
|
||||
{
|
||||
get { return new LBAttachments(GetProperty("Attachments")); }
|
||||
}
|
||||
public String Subject
|
||||
{
|
||||
get { return (GetProperty("Subject").ToString()); }
|
||||
set { SetProperty("Subject", value); }
|
||||
}
|
||||
public LBRecipients Recipients => new LBRecipients(GetProperty("Recipients"));
|
||||
public string To
|
||||
public LBRecipients Recipients
|
||||
{
|
||||
get { return new LBRecipients(GetProperty("Recipients")); }
|
||||
}
|
||||
public String To
|
||||
{
|
||||
get { return (GetProperty("To").ToString()); }
|
||||
set { SetProperty("To", value); }
|
||||
}
|
||||
public void Send() => InvokeMethod("Send");
|
||||
}
|
||||
public void Send()
|
||||
{
|
||||
InvokeMethod("Send");
|
||||
}
|
||||
}
|
||||
public enum LBOlBodyFormat
|
||||
{
|
||||
olFormatUnspecified = 0,
|
||||
@@ -115,40 +173,79 @@ namespace LBOutlookLibrary
|
||||
public partial class LBAttachments : LBComObject
|
||||
{
|
||||
public LBAttachments() { }
|
||||
public LBAttachments(object item) : base(item) { }
|
||||
public int Count => (GetProperty("Count") as int? ?? 0);
|
||||
public new LBAttachment Item => new LBAttachment(GetProperty("Item"));
|
||||
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 LBAttachments(Object item) : base(item) { }
|
||||
public int Count
|
||||
{
|
||||
get { return (GetProperty("Count") as int? ?? 0); }
|
||||
}
|
||||
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));
|
||||
}
|
||||
public void Remove(int Index) => InvokeMethod("Remove", Index);
|
||||
}
|
||||
public void Remove(int Index)
|
||||
{
|
||||
InvokeMethod("Remove", Index);
|
||||
}
|
||||
}
|
||||
public partial class LBRecipients : LBComObject
|
||||
{
|
||||
public LBRecipients() { }
|
||||
public LBRecipients(object item) : base(item) { }
|
||||
public int Count => (GetProperty("Count") as int? ?? 0);
|
||||
public new LBRecipient Item => new LBRecipient(GetProperty("Item"));
|
||||
public LBRecipient Add(string Name) => new LBRecipient(InvokeMethod("Add", Name));
|
||||
public void Remove(int Index) => InvokeMethod("Remove", Index);
|
||||
public bool ResolveAll() => InvokeMethod("ResolveAll") as bool? ?? false;
|
||||
}
|
||||
public LBRecipients(Object item) : base(item) { }
|
||||
public int Count
|
||||
{
|
||||
get { return (GetProperty("Count") as int? ?? 0); }
|
||||
}
|
||||
public LBRecipient Item
|
||||
{
|
||||
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 LBAttachment() { }
|
||||
public LBAttachment(object item) : base(item) { }
|
||||
public LBOlAttachmentType Type => (LBOlAttachmentType)GetProperty("Type");
|
||||
}
|
||||
public LBAttachment(Object item) : base(item) { }
|
||||
public LBOlAttachmentType Type
|
||||
{
|
||||
get { return (LBOlAttachmentType)GetProperty("Type"); }
|
||||
}
|
||||
}
|
||||
public partial class LBRecipient : LBComObject
|
||||
{
|
||||
public LBRecipient() { }
|
||||
public LBRecipient(object item) : base(item) { }
|
||||
public string Address => (GetProperty("Address").ToString());
|
||||
public string Name => (GetProperty("Name").ToString());
|
||||
public bool Resolve() => InvokeMethod("Resolve") as bool? ?? false;
|
||||
}
|
||||
public LBRecipient(Object item) : base(item) { }
|
||||
public String Address
|
||||
{
|
||||
get { return (GetProperty("Address").ToString()); }
|
||||
}
|
||||
public String Name
|
||||
{
|
||||
get { return (GetProperty("Name").ToString()); }
|
||||
}
|
||||
public Boolean Resolve()
|
||||
{
|
||||
return InvokeMethod("Resolve") as Boolean? ?? false;
|
||||
}
|
||||
}
|
||||
public enum LBOlAttachmentType
|
||||
{
|
||||
olByValue = 1,
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace LBOutlookLibrary
|
||||
{
|
||||
public partial class LBApplicationClass
|
||||
{
|
||||
public LBMailItemClass CreateMailItem() => new LBMailItemClass(CreateItem(LBOlItemType.olMailItem));
|
||||
}
|
||||
public LBMailItemClass CreateMailItem()
|
||||
{
|
||||
return new LBMailItemClass(CreateItem(LBOlItemType.olMailItem));
|
||||
}
|
||||
}
|
||||
public partial class LBMailItemClass
|
||||
{
|
||||
public void AddAttachment(string filename) => Attachments.Add(filename, LBOlAttachmentType.olByValue, Type.Missing, Type.Missing);
|
||||
}
|
||||
public void AddAttachment(string filename)
|
||||
{
|
||||
Attachments.Add(filename, LBOlAttachmentType.olByValue, Type.Missing, Type.Missing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,13 +49,19 @@ namespace Read64bitRegistryFrom32bitApp
|
||||
ref uint lpType,
|
||||
System.Text.StringBuilder lpData,
|
||||
ref uint lpcbData);
|
||||
#endregion
|
||||
#endregion
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Functions
|
||||
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")]
|
||||
static public string GetRegKey64Value(UIntPtr inHive, string inKeyName, RegSAM in32or64key, string inPropertyName)
|
||||
#region Functions
|
||||
static public string GetRegKey64Value(UIntPtr inHive, String inKeyName, String inPropertyName)
|
||||
{
|
||||
return GetRegKey64Value(inHive, inKeyName, RegSAM.WOW64_64Key, 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;
|
||||
try
|
||||
@@ -74,10 +80,15 @@ namespace Read64bitRegistryFrom32bitApp
|
||||
if (0 != hkey) RegCloseKey(hkey);
|
||||
}
|
||||
}
|
||||
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);
|
||||
[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 CheckRegKey64Valid(UIntPtr inHive, String inKeyName)
|
||||
{
|
||||
return CheckRegKey64Valid(inHive, inKeyName, RegSAM.WOW64_64Key);
|
||||
}
|
||||
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;
|
||||
try
|
||||
@@ -92,5 +103,8 @@ namespace Read64bitRegistryFrom32bitApp
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Enums
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,11 @@
|
||||
*********************************************************************************************/
|
||||
|
||||
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
|
||||
{
|
||||
@@ -30,6 +35,11 @@ namespace VlnStatus
|
||||
private System.Windows.Forms.ProgressBar progressBar1;
|
||||
private System.Windows.Forms.Label lblBar;
|
||||
private System.Windows.Forms.Label StatMsg;
|
||||
// private string strLblLast="";
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.Container components = null;
|
||||
|
||||
public StatusBarFrm()
|
||||
{
|
||||
@@ -51,6 +61,21 @@ namespace VlnStatus
|
||||
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
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
@@ -165,6 +190,14 @@ namespace VlnStatus
|
||||
{
|
||||
lblBar.Text = (Math.Round((decimal)(progressBar1.Value * 100) / progressBar1.Maximum)).ToString();
|
||||
lblBar.Text += "% Complete";
|
||||
// if( lblBar.Text != strLblLast)
|
||||
// {
|
||||
// Profiler.Start("UpdateLabel");
|
||||
lblBar.Refresh();
|
||||
// lblBar.Update();
|
||||
// Profiler.End("UpdateLabel");
|
||||
// }
|
||||
// strLblLast = lblBar.Text;
|
||||
}
|
||||
|
||||
public string StatusMessage
|
||||
@@ -176,7 +209,10 @@ namespace VlnStatus
|
||||
set
|
||||
{
|
||||
StatMsg.Text = value;
|
||||
// Profiler.Start("StatusMessage");
|
||||
StatMsg.Refresh();
|
||||
// StatMsg.Update();
|
||||
// Profiler.End("StatusMessage");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
* Added overbounds check
|
||||
*********************************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace VlnStatus
|
||||
{
|
||||
/// <summary>
|
||||
@@ -25,6 +31,10 @@ namespace VlnStatus
|
||||
public class StatusMessageFrm : System.Windows.Forms.Form
|
||||
{
|
||||
private System.Windows.Forms.Label lblStatMsg;
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.Container components = null;
|
||||
|
||||
public StatusMessageFrm()
|
||||
{
|
||||
@@ -44,6 +54,21 @@ namespace VlnStatus
|
||||
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
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace VlnStatus
|
||||
/// </summary>
|
||||
public class VlnStatusBar
|
||||
{
|
||||
readonly StatusBarFrm StatBar;
|
||||
StatusBarFrm StatBar;
|
||||
private int Cnt;
|
||||
|
||||
// Create a status window with the default title of "Status"
|
||||
@@ -53,6 +53,8 @@ namespace VlnStatus
|
||||
// Increament the the status bar by the passed in value.
|
||||
public void PerformStep(int val)
|
||||
{
|
||||
// StatBar.Value = val;
|
||||
// Cnt = val;
|
||||
BarValue = val;
|
||||
StatBar.PerformStep();
|
||||
}
|
||||
@@ -60,6 +62,7 @@ namespace VlnStatus
|
||||
// Increament the the status bar by one
|
||||
public void PerformStep()
|
||||
{
|
||||
// StatBar.Value = StatBar.Value + 1;
|
||||
Cnt++;
|
||||
BarValue = Cnt;
|
||||
StatBar.PerformStep();
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
* Added overbounds check
|
||||
*********************************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace VlnStatus
|
||||
{
|
||||
/// <summary>
|
||||
@@ -26,7 +28,7 @@ namespace VlnStatus
|
||||
/// </summary>
|
||||
public class VlnStatusMessage
|
||||
{
|
||||
readonly StatusMessageFrm StatusMessageBox;
|
||||
StatusMessageFrm StatusMessageBox;
|
||||
|
||||
// Create a status window with the default title of "Status"
|
||||
public VlnStatusMessage()
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// 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,4 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace RoAccessToSql
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.OleDb;
|
||||
using Volian.Base.Library;
|
||||
|
||||
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
|
||||
|
||||
@@ -27,11 +33,25 @@ namespace RoAccessToSql
|
||||
public partial class RoAccessToSql : Form
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public string MSAccessPath { get; set; } = null;
|
||||
public string SqlServerName { get; set; } = null;
|
||||
public string SqlDatabaseName { get; set; } = null;
|
||||
readonly bool _Initializing = false;
|
||||
private string _MSAccessPath = null;
|
||||
public string MSAccessPath
|
||||
{
|
||||
get { return _MSAccessPath; }
|
||||
set { _MSAccessPath = value; }
|
||||
}
|
||||
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)
|
||||
{
|
||||
@@ -46,7 +66,7 @@ namespace RoAccessToSql
|
||||
}
|
||||
else if (parm.StartsWith("/sqldb="))
|
||||
{
|
||||
SqlDatabaseName = $"{parm.Substring(7)}_RO";
|
||||
SqlDatabaseName = parm.Substring(7) + "_RO";
|
||||
}
|
||||
else if (parm.StartsWith("/server="))
|
||||
{
|
||||
@@ -72,7 +92,7 @@ namespace RoAccessToSql
|
||||
if (UserInRoEditor()) this.Close();
|
||||
tbSqlDbName.Text = SqlDatabaseName;
|
||||
_TmpFileForConnectStr = Path.GetTempPath();
|
||||
_TmpFileForConnectStr += @"\PromsConnect.txt";
|
||||
_TmpFileForConnectStr = _TmpFileForConnectStr + @"\PromsConnect.txt";
|
||||
File.Delete(_TmpFileForConnectStr);
|
||||
_Initializing = false;
|
||||
}
|
||||
@@ -80,10 +100,10 @@ namespace RoAccessToSql
|
||||
private bool UserInRoEditor()
|
||||
{
|
||||
FileInfo fiown = null;
|
||||
FileStream fsown;
|
||||
// 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.
|
||||
try
|
||||
FileStream fsown = null;
|
||||
// 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.
|
||||
try
|
||||
{
|
||||
string filename = MSAccessPath + @"\RoEditor.own";
|
||||
fiown = new FileInfo(filename);
|
||||
@@ -99,7 +119,7 @@ namespace RoAccessToSql
|
||||
fsown = fiown.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||
TextReader tr1 = new StreamReader(fsown);
|
||||
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);
|
||||
TextReader tr = new StreamReader(fsown);
|
||||
@@ -122,8 +142,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.Flush();
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
catch (IOException ex)
|
||||
{
|
||||
fsown = fiown.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||
TextReader tr = new StreamReader(fsown);
|
||||
string who = tr.ReadToEnd();
|
||||
@@ -134,20 +154,25 @@ namespace RoAccessToSql
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string ErrorLogFileName { get; set; }
|
||||
// make error log file name (uses same logic as proms error log)
|
||||
static bool ChangeLogFileName(string AppenderName, string NewFilename)
|
||||
static string _ErrorLogFileName;
|
||||
public static string ErrorLogFileName
|
||||
{
|
||||
get { return _ErrorLogFileName; }
|
||||
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;
|
||||
RootRep = log4net.LogManager.GetRepository();
|
||||
foreach (log4net.Appender.IAppender iApp in RootRep.GetAppenders())
|
||||
{
|
||||
if (iApp.Name.CompareTo(AppenderName) == 0
|
||||
&& iApp is log4net.Appender.FileAppender fApp)
|
||||
{
|
||||
&& iApp is log4net.Appender.FileAppender)
|
||||
{
|
||||
log4net.Appender.FileAppender fApp = (log4net.Appender.FileAppender)iApp;
|
||||
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;
|
||||
fApp.ActivateOptions();
|
||||
return true;
|
||||
@@ -164,7 +189,7 @@ namespace RoAccessToSql
|
||||
if (Directory.Exists(fbd.SelectedPath))
|
||||
tbAccessPath.Text = fbd.SelectedPath;
|
||||
else
|
||||
MessageBox.Show($"Path doesn't exist {tbAccessPath.Text}");
|
||||
MessageBox.Show("Path doesn't exist " + tbAccessPath.Text);
|
||||
}
|
||||
}
|
||||
// Convert the data
|
||||
@@ -187,7 +212,7 @@ namespace RoAccessToSql
|
||||
{
|
||||
DateTime dtSunday = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek));
|
||||
|
||||
ChangeLogFileName("LogFileAppender", $"{SqlDatabaseName} {dtSunday:yyyyMMdd} ErrorLog.txt");
|
||||
ChangeLogFileName("LogFileAppender", SqlDatabaseName + " " + dtSunday.ToString("yyyyMMdd") + " ErrorLog.txt");
|
||||
_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"), "");
|
||||
}
|
||||
@@ -204,7 +229,7 @@ namespace RoAccessToSql
|
||||
if (sqlConnection.State == ConnectionState.Open)
|
||||
{
|
||||
// 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))
|
||||
{
|
||||
try
|
||||
@@ -226,13 +251,13 @@ namespace RoAccessToSql
|
||||
}
|
||||
else
|
||||
{
|
||||
_MyLog.Error($"SQL Connection is not open. Check connection string: {tbSqlDbName.Text}");
|
||||
MessageBox.Show($"Check connection string: {tbSqlDbName.Text}", "SQL Connection is not open.");
|
||||
_MyLog.Error("SQL Connection is not open. Check connection string: " + tbSqlDbName.Text);
|
||||
MessageBox.Show("Check connection string: " + tbSqlDbName.Text, "SQL Connection is not open.");
|
||||
}
|
||||
}
|
||||
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");
|
||||
}
|
||||
}
|
||||
@@ -249,10 +274,11 @@ namespace RoAccessToSql
|
||||
lastTimeDbs = ProgressBarUpdate(pBarDbs, null, 0, 1, 0, 0, lastTimeDbs, false);
|
||||
lastTimeRos = ProgressBarUpdate(pBarROs, null, 0, maxCntRo, 0, 0, lastTimeRos, false);
|
||||
lastTimeDbs = ProgressBarUpdate(pBarDbs, "ROMaster Table", 0, 5, 0, 1, lastTimeDbs, false);
|
||||
OleDbCommand command = new OleDbCommand("select * from ROMaster", accessConnection);
|
||||
OleDbDataReader reader = command.ExecuteReader();
|
||||
// Do access's romaster table first so that the list of other tables to process is found. While doing this, migrate this table's data.
|
||||
int cntRo = 0;
|
||||
OleDbDataReader reader = null;
|
||||
OleDbCommand command = new OleDbCommand("select * from ROMaster", accessConnection);
|
||||
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.
|
||||
int cntRo = 0;
|
||||
int cntDb = 0;
|
||||
int maxCntDb = 0;
|
||||
while (reader.Read()) // reading from Access Database
|
||||
@@ -277,12 +303,13 @@ namespace RoAccessToSql
|
||||
maxCntDb++;
|
||||
}
|
||||
}
|
||||
ProgressBarUpdate(pBarROs, "ROMaster", 0, maxCntRo, maxCntRo, 1, lastTimeRos, true);
|
||||
lastTimeRos = ProgressBarUpdate(pBarROs, "ROMaster", 0, maxCntRo, maxCntRo, 1, lastTimeRos, true);
|
||||
lastTimeDbs = ProgressBarUpdate(pBarDbs, null, 0, maxCntDb, 0, 0, lastTimeDbs, false);
|
||||
reader.Close();
|
||||
|
||||
// now migrate all the tables that were found
|
||||
foreach (string tableName in allTables)
|
||||
reader = null;
|
||||
|
||||
// now migrate all the tables that were found
|
||||
foreach (string tableName in allTables)
|
||||
{
|
||||
lastTimeRos = DateTime.Now;
|
||||
cntRo = 0;
|
||||
@@ -291,7 +318,7 @@ namespace RoAccessToSql
|
||||
lastTimeRos = ProgressBarUpdate(pBarROs, null, 0, maxCntRo, 0, 0, lastTimeRos, true);
|
||||
lastTimeDbs = ProgressBarUpdate(pBarDbs, allTablesText[cntDb], 0, maxCntDb, cntDb, 1, lastTimeDbs, false);
|
||||
command = null;
|
||||
command = new OleDbCommand($"select * from {tableName}", accessConnection);
|
||||
command = new OleDbCommand("select * from " + tableName, accessConnection);
|
||||
reader = command.ExecuteReader();
|
||||
while (reader.Read()) // read all of the records from the current access table
|
||||
{
|
||||
@@ -311,7 +338,7 @@ namespace RoAccessToSql
|
||||
reader = null;
|
||||
lastTimeRos = ProgressBarUpdate(pBarROs, tableName, 0, maxCntRo, maxCntRo, 1, lastTimeRos, false);
|
||||
}
|
||||
ProgressBarUpdate(pBarDbs, allTablesText[maxCntDb - 1], 0, maxCntDb, maxCntDb, 1, lastTimeDbs, false);
|
||||
lastTimeDbs = ProgressBarUpdate(pBarDbs, allTablesText[maxCntDb - 1], 0, maxCntDb, maxCntDb, 1, lastTimeDbs, false);
|
||||
pBarDbs.Text = "Referenced Object Tables Migration Completed";
|
||||
pBarROs.Text = "Referenced Objects Migration Completed";
|
||||
btnConvert.Enabled = false;
|
||||
@@ -330,7 +357,7 @@ namespace RoAccessToSql
|
||||
string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now);
|
||||
string strInsert = "INSERT INTO ROMaster (RecID, RecType, ModDateTime, Info) ";
|
||||
// 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);
|
||||
reader = command.ExecuteReader();
|
||||
if (reader.Read()) return;
|
||||
@@ -340,7 +367,7 @@ namespace RoAccessToSql
|
||||
MessageBox.Show(e.Message, "Error on insert to flag migration completed");
|
||||
}
|
||||
}
|
||||
private readonly string _TmpFileForConnectStr = null;
|
||||
private string _TmpFileForConnectStr = null;
|
||||
private void WriteSqlPathToTempFile()
|
||||
{
|
||||
System.IO.File.WriteAllText(_TmpFileForConnectStr, _SqlConnectStr);
|
||||
@@ -348,12 +375,13 @@ namespace RoAccessToSql
|
||||
// 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)
|
||||
{
|
||||
int retcnt = 100;
|
||||
OleDbDataReader reader = null;
|
||||
int retcnt = 100;
|
||||
try
|
||||
{
|
||||
OleDbCommand command = new OleDbCommand($"SELECT COUNT (RecID) as cnt FROM {tableName}", accessConnection);
|
||||
OleDbDataReader reader = command.ExecuteReader();
|
||||
if (reader.Read())
|
||||
OleDbCommand command = new OleDbCommand("SELECT COUNT (RecID) as cnt FROM " + tableName, accessConnection);
|
||||
reader = command.ExecuteReader();
|
||||
if (reader.Read())
|
||||
{
|
||||
retcnt = reader.GetInt32(0);
|
||||
}
|
||||
@@ -365,8 +393,7 @@ namespace RoAccessToSql
|
||||
}
|
||||
return retcnt;
|
||||
}
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping min for Debugging")]
|
||||
DateTime ProgressBarUpdate(DevComponents.DotNetBar.Controls.ProgressBarX pbi, string msg, int min, int max, int progress, int flag, DateTime lastUpdateDisplay, bool doTimeCheck)
|
||||
DateTime ProgressBarUpdate(DevComponents.DotNetBar.Controls.ProgressBarX pbi, string msg, int min, int max, int progress, int flag, DateTime lastUpdateDisplay, bool doTimeCheck)
|
||||
{
|
||||
if (flag == 0) // setup
|
||||
pbi.Maximum = max;
|
||||
@@ -385,13 +412,11 @@ namespace RoAccessToSql
|
||||
{
|
||||
try
|
||||
{
|
||||
SqlCommand command = new SqlCommand
|
||||
{
|
||||
Connection = sqlConnection,
|
||||
CommandType = CommandType.StoredProcedure,
|
||||
CommandText = "insertAllRectypes"
|
||||
};
|
||||
command.Parameters.AddWithValue("@RecType", RecType);
|
||||
SqlCommand command = new SqlCommand();
|
||||
command.Connection = sqlConnection;
|
||||
command.CommandType = CommandType.StoredProcedure;
|
||||
command.CommandText = "insertAllRectypes";
|
||||
command.Parameters.AddWithValue("@RecType", RecType);
|
||||
if (AccPageID == null || AccPageID == "")
|
||||
command.Parameters.AddWithValue("@AccPageID", string.Empty);
|
||||
else
|
||||
@@ -403,8 +428,9 @@ namespace RoAccessToSql
|
||||
command.Parameters.AddWithValue("@ModDateTime", ModDateTime);
|
||||
using (SqlDataReader reader = command.ExecuteReader())
|
||||
{
|
||||
}
|
||||
command = null;
|
||||
bool success = true;
|
||||
}
|
||||
command = null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -412,15 +438,32 @@ namespace RoAccessToSql
|
||||
_MyLog.Error(msg, ex);
|
||||
}
|
||||
}
|
||||
private void btnExit_Click(object sender, EventArgs e) => this.Close();
|
||||
// the user selected the button to test the sql connection string
|
||||
private void btnTestConnect_Click(object sender, EventArgs e) => TestConnection(true);
|
||||
|
||||
public static DateTime RevDate { get; set; } = DateTime.MinValue;
|
||||
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
|
||||
// the conversion is done. See below for what is checked
|
||||
private bool TestConnection(bool notifyUser)
|
||||
private void btnExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
// the user selected the button to test the sql connection string
|
||||
private void btnTestConnect_Click(object sender, EventArgs e)
|
||||
{
|
||||
TestConnection(true);
|
||||
}
|
||||
// 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
|
||||
// tested in this executable since the roall database is interfaced to by the roeditor & the program that migrates the data.
|
||||
@@ -442,14 +485,12 @@ namespace RoAccessToSql
|
||||
connection.Open();
|
||||
if (connection.State == ConnectionState.Open)
|
||||
{
|
||||
// now see if there is an roall table
|
||||
SqlCommand command = new SqlCommand
|
||||
{
|
||||
Connection = connection,
|
||||
CommandType = CommandType.Text,
|
||||
CommandText = "(SELECT count(*) FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ROALL]') AND type in (N'U'))"
|
||||
};
|
||||
using (SqlDataReader reader = command.ExecuteReader())
|
||||
// now see if there is an roall table
|
||||
SqlCommand command = new SqlCommand();
|
||||
command.Connection = connection;
|
||||
command.CommandType = CommandType.Text;
|
||||
command.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())
|
||||
{
|
||||
@@ -468,13 +509,11 @@ namespace RoAccessToSql
|
||||
{
|
||||
// now see if there are stored procedures:
|
||||
command = null; // reset command
|
||||
command = new SqlCommand
|
||||
{
|
||||
Connection = connection,
|
||||
CommandType = CommandType.Text,
|
||||
CommandText = "(SELECT count(*) FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteByROTable]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)"
|
||||
};
|
||||
using (SqlDataReader reader = command.ExecuteReader())
|
||||
command = new SqlCommand();
|
||||
command.Connection = connection;
|
||||
command.CommandType = CommandType.Text;
|
||||
command.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())
|
||||
{
|
||||
@@ -494,13 +533,11 @@ namespace RoAccessToSql
|
||||
{
|
||||
// now test that the roall table is empty:
|
||||
command = null; // reset command
|
||||
command = new SqlCommand
|
||||
{
|
||||
Connection = connection,
|
||||
CommandType = CommandType.Text,
|
||||
CommandText = "SELECT count(*) FROM roall"
|
||||
};
|
||||
using (SqlDataReader reader = command.ExecuteReader())
|
||||
command = new SqlCommand();
|
||||
command.Connection = connection;
|
||||
command.CommandType = CommandType.Text;
|
||||
command.CommandText = "SELECT count(*) FROM roall";
|
||||
using (SqlDataReader reader = command.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
@@ -520,18 +557,16 @@ namespace RoAccessToSql
|
||||
{
|
||||
// now test that the database version is ok
|
||||
command = null; // reset command
|
||||
command = new SqlCommand
|
||||
{
|
||||
Connection = connection,
|
||||
CommandType = CommandType.StoredProcedure,
|
||||
CommandText = "vesp_GetSQLCodeRevision"
|
||||
};
|
||||
using (SqlDataReader reader = command.ExecuteReader())
|
||||
command = new SqlCommand();
|
||||
command.Connection = connection;
|
||||
command.CommandType = CommandType.StoredProcedure;
|
||||
command.CommandText = "vesp_GetSQLCodeRevision";
|
||||
using (SqlDataReader reader = command.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
RevDate = reader.GetDateTime(0);
|
||||
RevDescription = reader.GetString(1);
|
||||
_RevDate = reader.GetDateTime(0);
|
||||
_RevDescription = reader.GetString(1);
|
||||
dbsuc = true;
|
||||
}
|
||||
else
|
||||
@@ -547,13 +582,13 @@ namespace RoAccessToSql
|
||||
}
|
||||
catch (SqlException ex)
|
||||
{
|
||||
if (notifyUser) MessageBox.Show($"Connection failed: {ex}", "Connection Failed");
|
||||
if (notifyUser) MessageBox.Show("Connection failed: " + ex, "Connection Failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
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");
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="RoAccessToSql.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Accentra.Controls
|
||||
@@ -8,6 +11,11 @@ namespace Accentra.Controls
|
||||
/// </summary>
|
||||
public class TablePicker : System.Windows.Forms.Form
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.Container components = null;
|
||||
|
||||
public TablePicker()
|
||||
{
|
||||
// Activates double buffering
|
||||
@@ -21,6 +29,21 @@ namespace Accentra.Controls
|
||||
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
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
@@ -52,41 +75,82 @@ namespace Accentra.Controls
|
||||
}
|
||||
#endregion
|
||||
|
||||
private readonly Brush BlackBrush = System.Drawing.Brushes.Black;
|
||||
private readonly Brush WhiteBrush = System.Drawing.Brushes.White;
|
||||
private Pen BeigePen = new Pen(Color.Beige, 1);
|
||||
private Brush BeigeBrush = System.Drawing.Brushes.Beige;
|
||||
private Brush GrayBrush = System.Drawing.Brushes.Gray;
|
||||
private Brush BlackBrush = System.Drawing.Brushes.Black;
|
||||
private Brush WhiteBrush = System.Drawing.Brushes.White;
|
||||
|
||||
private readonly Brush Jbrush = System.Drawing.Brushes.LightBlue;
|
||||
private 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 readonly Pen BorderPen = new Pen(SystemColors.ControlDark);
|
||||
private readonly Pen BluePen = new Pen(Color.SlateGray, 1);
|
||||
private Pen BorderPen = new Pen(SystemColors.ControlDark);
|
||||
private Pen BluePen = new Pen(Color.SlateGray, 1);
|
||||
|
||||
private string DispText = "Esc to Cancel"; // Display text
|
||||
private readonly int DispHeight = 40; // Display ("Table 1x1", "Cancel")
|
||||
private readonly Font DispFont = new Font("Tahoma", 8.25F);
|
||||
private readonly int SquareX = 20; // Width of squares
|
||||
private readonly int SquareY = 20; // Height of squares
|
||||
private int DispHeight = 40;//20; // Display ("Table 1x1", "Cancel")
|
||||
private Font DispFont = new Font("Tahoma", 8.25F);
|
||||
private int SquareX = 20; // Width of squares
|
||||
private int SquareY = 20; // Height of squares
|
||||
private int SquareQX = 3; // Number of visible squares (X)
|
||||
private int SquareQY = 3; // Number of visible squares (Y)
|
||||
private int SelQX = 1; // Number of selected squares (x)
|
||||
private int SelQY = 1; // Number of selected squares (y)
|
||||
|
||||
public int MaxRows { get; set; } = -1;
|
||||
private bool bHiding = false;
|
||||
private bool bCancel = true; // Determines whether to Cancel
|
||||
|
||||
public int MaxCols { get; set; } = -1;
|
||||
// Added my Volian 4/27/11
|
||||
private int _MaxRows = -1;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of columns, or the horizontal / X count,
|
||||
/// of the selection.
|
||||
/// </summary>
|
||||
public int SelectedColumns => SelQX;
|
||||
public int MaxRows
|
||||
{
|
||||
get { return _MaxRows; }
|
||||
set { _MaxRows = value; }
|
||||
}
|
||||
private int _MaxCols = -1;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of rows, or the vertical / Y count,
|
||||
/// of the selection.
|
||||
/// </summary>
|
||||
public int SelectedRows => SelQY;
|
||||
public int MaxCols
|
||||
{
|
||||
get { return _MaxCols; }
|
||||
set { _MaxCols = value; }
|
||||
}
|
||||
|
||||
private void TablePicker_Paint(object sender, System.Windows.Forms.PaintEventArgs e) {
|
||||
/// <summary>
|
||||
/// Similar to <code><see cref="DialogResult"/>
|
||||
/// == <see cref="DialogResult.Cancel"/></code>,
|
||||
/// but is used as a state value before the form
|
||||
/// is hidden and cancellation is finalized.
|
||||
/// </summary>
|
||||
public bool Cancel {
|
||||
get {
|
||||
return bCancel;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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;
|
||||
|
||||
// First, increment the number of visible squares if the
|
||||
@@ -98,8 +162,8 @@ namespace Accentra.Controls
|
||||
if (SquareQX < 7) SquareQX = 7;
|
||||
if (SquareQY < 5) SquareQY = 5;
|
||||
|
||||
if (MaxRows > 0 && SquareQY > MaxRows) SquareQY = MaxRows;
|
||||
if (MaxCols > 0 && SquareQX > MaxCols) SquareQX = MaxCols;
|
||||
if (_MaxRows > 0 && SquareQY > _MaxRows) SquareQY = _MaxRows;
|
||||
if (_MaxCols > 0 && SquareQX > _MaxCols) SquareQX = _MaxCols;
|
||||
|
||||
// Second, expand the dimensions of this form according to the
|
||||
// number of visible squares.
|
||||
@@ -113,7 +177,14 @@ namespace Accentra.Controls
|
||||
// the text is left-justified, only the Y (vertical) position
|
||||
// is calculated.
|
||||
int dispY = ((SquareY - 1) * SquareQY) + SquareQY + 4;
|
||||
DispText = $"{SelQY} Row{((SelQY > 1) ? "s" : "")} {SelQX} Column{((SelQX > 1) ? "s" : "")}\nEsc to Cancel";
|
||||
//if (this.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);
|
||||
|
||||
// Draw each of the squares and fill with the default color.
|
||||
@@ -127,6 +198,7 @@ namespace Accentra.Controls
|
||||
// Go back and paint the squares with selection colors.
|
||||
for (int x=0; x<SelQX; x++) {
|
||||
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.DrawRectangle(BluePen, (x * SquareX) + 3, (y * SquareY) + 3, SquareX - 2, SquareY - 2);
|
||||
}
|
||||
@@ -138,6 +210,11 @@ namespace Accentra.Controls
|
||||
/// </summary>
|
||||
private void TablePicker_Deactivate(object sender, System.EventArgs e) {
|
||||
|
||||
// bCancel = true
|
||||
// and DialogResult = DialogResult.Cancel
|
||||
// were previously already set in MouseLeave.
|
||||
|
||||
//this.Hide();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -165,24 +242,42 @@ namespace Accentra.Controls
|
||||
/// escaped (canceling) state.
|
||||
/// </summary>
|
||||
private void TablePicker_MouseLeave(object sender, System.EventArgs e) {
|
||||
//if (!bHiding) bCancel = true;
|
||||
//this.DialogResult = DialogResult.Cancel;
|
||||
//this.Invalidate();
|
||||
if (this.DialogResult == DialogResult.None)
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cancels the prior cancellation caused by MouseLeave.
|
||||
/// </summary>
|
||||
private void TablePicker_MouseEnter(object sender, System.EventArgs e) => this.Invalidate();
|
||||
/// <summary>
|
||||
/// Cancels the prior cancellation caused by MouseLeave.
|
||||
/// </summary>
|
||||
private void TablePicker_MouseEnter(object sender, System.EventArgs e) {
|
||||
//bHiding = false;
|
||||
//bCancel = false;
|
||||
//this.DialogResult = DialogResult.OK;
|
||||
this.Invalidate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Detects that the user made a selection by clicking.
|
||||
/// </summary>
|
||||
private void TablePicker_Click(object sender, System.EventArgs e) => this.DialogResult = DialogResult.OK;
|
||||
/// <summary>
|
||||
/// Detects that the user made a selection by clicking.
|
||||
/// </summary>
|
||||
private void TablePicker_Click(object sender, System.EventArgs e) {
|
||||
//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)
|
||||
{
|
||||
//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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.Reflection;
|
||||
using Volian.Controls.Library;
|
||||
@@ -21,7 +24,7 @@ namespace VEPROMS
|
||||
string connectionString = Database.VEPROMS_Connection;
|
||||
Match mServer = Regex.Match(connectionString, ".*Data Source=([^;]*).*");
|
||||
_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;
|
||||
}
|
||||
@@ -34,7 +37,7 @@ namespace VEPROMS
|
||||
{
|
||||
if (_DatabaseName == null)
|
||||
{
|
||||
_DatabaseName = $"{Database.ActiveDatabase}[SQL:{Database.RevDate:yyMM.ddHH}]";
|
||||
_DatabaseName = string.Format("{0}[SQL:{1:yyMM.ddHH}]", Database.ActiveDatabase, Database.RevDate);
|
||||
}
|
||||
return _DatabaseName;
|
||||
}
|
||||
@@ -52,16 +55,26 @@ namespace VEPROMS
|
||||
DateTime buildDateTime = new System.IO.FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime;
|
||||
// If the AssemblyConfiguration is "DEMO" then we are running a Demo version
|
||||
string demoTxt = VlnSettings.DemoMode ? "(Demo)": VlnSettings.DebugMode ? "(Debug)" : "(Production)";
|
||||
Text = $"About {AssemblyTitle} {demoTxt}";
|
||||
labelProductName.Text = AssemblyProduct;
|
||||
labelVersion.Text = $"Version {AssemblyVersion}";
|
||||
labelVersionDateTime.Text = $"Build Date: {buildDateTime}";
|
||||
labelCopyright.Text = $"Copyright © {buildDateTime.Year}. All Rights Reserved.";
|
||||
labelCompanyName.Text = AssemblyCompany;
|
||||
labelCompanyName.Links[0].LinkData = "Volian Enterprises Inc.";
|
||||
labelCompanyName.Links.Add(0,23,"www.volian.com");
|
||||
labelServer.Text = $"SQL Server: {SQLServerName}"; // C2018-015 use static for this info.
|
||||
labelDatabase.Text = $"Database: {DatabaseName}"; // C2018-015 use static for this info.
|
||||
// C2018-015 made this information static so we can use in meta files
|
||||
//string connectionString = Database.VEPROMS_Connection;
|
||||
//Match mServer = Regex.Match(connectionString,".*Data Source=([^;]*).*");
|
||||
//string server = (mServer.Success)?mServer.Groups[1].Value:"unknown";
|
||||
//if (server.StartsWith(@".\")) server = @"Local \ " + server.Substring(2);
|
||||
//string databaseName = string.Format("{0}[SQL:{1:yyMM.ddHH}]", Database.ActiveDatabase, Database.RevDate);
|
||||
this.Text = String.Format("About {0}", AssemblyTitle + " " + demoTxt);
|
||||
this.labelProductName.Text = AssemblyProduct;
|
||||
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
|
||||
this.labelVersionDateTime.Text = String.Format("Build Date: {0}", buildDateTime.ToString());
|
||||
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
|
||||
@@ -86,12 +99,24 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
public string AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
public string AssemblyVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
// C2018-009 used to print the PROMS version number at the top of each PDF page
|
||||
public static string PROMSVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
// C2018-009 used to print the PROMS version number at the top of each PDF page
|
||||
public static string PROMSVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public string AssemblyDescription
|
||||
public string AssemblyDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -137,7 +162,7 @@ namespace VEPROMS
|
||||
private void labelCompanyName_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
// Determine which link was clicked within the LinkLabel.
|
||||
labelCompanyName.Links[0].Visited = true;
|
||||
this.labelCompanyName.Links[0].Visited = true;
|
||||
|
||||
// Display the appropriate link based on the value of the
|
||||
// LinkData property of the Link object.
|
||||
@@ -146,17 +171,18 @@ namespace VEPROMS
|
||||
System.Diagnostics.Process.Start(target); // this should start the default web browser
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
private void btnViewEULA_Click(object sender, EventArgs e)
|
||||
private void logoPictureBox_Click(object sender, EventArgs e)
|
||||
{
|
||||
string EulaFile = $@"\{VlnSettings.EULAfile}";
|
||||
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)
|
||||
{
|
||||
string EulaFile = string.Format(@"\{0}", VlnSettings.EULAfile);
|
||||
string strEULA = System.Environment.CurrentDirectory + EulaFile;
|
||||
frmViewTextFile ViewFile = new frmViewTextFile(strEULA, RichTextBoxStreamType.PlainText)
|
||||
{
|
||||
Text = "End-User License Agreement"
|
||||
};
|
||||
ViewFile.ShowDialog();
|
||||
frmViewTextFile ViewFile = new frmViewTextFile(strEULA,RichTextBoxStreamType.PlainText);
|
||||
ViewFile.Text = "End-User License Agreement";
|
||||
ViewFile.ShowDialog();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
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,6 +1,11 @@
|
||||
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 VEPROMS.CSLA.Library;
|
||||
|
||||
@@ -9,7 +14,10 @@ namespace VEPROMS
|
||||
// C2025-027 Annotation Type Filtering
|
||||
public partial class dlgAnnotationsSelect : Form
|
||||
{
|
||||
public dlgAnnotationsSelect() => InitializeComponent();
|
||||
public dlgAnnotationsSelect()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public dlgAnnotationsSelect(string userid)
|
||||
{
|
||||
@@ -17,13 +25,30 @@ namespace VEPROMS
|
||||
UserID = userid;
|
||||
}
|
||||
|
||||
public int MyItemID { get; set; }
|
||||
public string UserID { get; set; }
|
||||
private int _MyItemID;
|
||||
public int MyItemID
|
||||
{
|
||||
get { return _MyItemID; }
|
||||
set { _MyItemID = value; }
|
||||
}
|
||||
|
||||
private void btnSelect_Click(object sender, EventArgs e) => MoveSelectedItems(lstUnselected, lstSelected);
|
||||
private string _UserID;
|
||||
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.
|
||||
private void btnDeselect_Click(object sender, EventArgs e) => MoveSelectedItems(lstSelected, lstUnselected);
|
||||
private void btnDeselect_Click(object sender, EventArgs e)
|
||||
{
|
||||
MoveSelectedItems(lstSelected, lstUnselected);
|
||||
}
|
||||
|
||||
// Move selected items from one ListBox to another.
|
||||
private void MoveSelectedItems(ListBox lstFrom, ListBox lstTo)
|
||||
@@ -65,21 +90,39 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
// Enable and disable buttons.
|
||||
private void lst_SelectedIndexChanged(object sender, EventArgs e) => SetButtonsEditable();
|
||||
private void lst_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetButtonsEditable();
|
||||
}
|
||||
// Save selected list to DB.
|
||||
private void btnUpdate_Click(object sender, EventArgs e) => saveChanges();
|
||||
private void btnUpdate_Click(object sender, EventArgs e)
|
||||
{
|
||||
saveChanges();
|
||||
}
|
||||
public class AnnotataionItem
|
||||
{
|
||||
private readonly string _NameStr;
|
||||
private readonly int _TypeID;
|
||||
private string _NameStr;
|
||||
private int _TypeID;
|
||||
|
||||
public AnnotataionItem(string NameStr, int TypeID)
|
||||
{
|
||||
_NameStr = NameStr;
|
||||
_TypeID = TypeID;
|
||||
this._NameStr = NameStr;
|
||||
this._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.
|
||||
@@ -124,16 +167,16 @@ namespace VEPROMS
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
saveChanges();
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
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
|
||||
{
|
||||
@@ -8,10 +16,19 @@ namespace VEPROMS
|
||||
{
|
||||
private bool _Cancel = true;
|
||||
|
||||
public bool Cancel => _Cancel;
|
||||
public bool Cancel
|
||||
{
|
||||
get { return _Cancel; }
|
||||
}
|
||||
|
||||
public bool ExitPROMS { get; set; }
|
||||
public DlgCloseTabsOrExit(bool isMainWindow, bool hasChildWindows)
|
||||
private bool _ExitPROMS;
|
||||
|
||||
public bool ExitPROMS
|
||||
{
|
||||
get { return _ExitPROMS; }
|
||||
set { _ExitPROMS = value; }
|
||||
}
|
||||
public DlgCloseTabsOrExit(bool isMainWindow, bool hasChildWindows)
|
||||
{
|
||||
InitializeComponent();
|
||||
if (!isMainWindow)
|
||||
@@ -29,22 +46,22 @@ namespace VEPROMS
|
||||
private void BtnClsTab_Click(object sender, EventArgs e)
|
||||
{
|
||||
_Cancel = false;
|
||||
ExitPROMS = false;
|
||||
Hide();
|
||||
_ExitPROMS = false;
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
private void BtnExitPROMS_Click(object sender, EventArgs e)
|
||||
{
|
||||
_Cancel = false;
|
||||
ExitPROMS = true;
|
||||
Hide();
|
||||
_ExitPROMS = true;
|
||||
this.Hide();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
_Cancel = true;
|
||||
ExitPROMS = false;
|
||||
Hide();
|
||||
_ExitPROMS = false;
|
||||
this.Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Print.Library;
|
||||
//using Volian.Controls.Library;
|
||||
using Volian.Base.Library;
|
||||
using JR.Utils.GUI.Forms;
|
||||
using System.Linq;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
public partial class DlgPrintProcedure : DevComponents.DotNetBar.Office2007Form
|
||||
{
|
||||
public bool SaveLinks => swtbtnPDFLinks.Value;
|
||||
public int RemoveTrailingHardReturnsAndManualPageBreaks
|
||||
public bool SaveLinks
|
||||
{
|
||||
get
|
||||
{
|
||||
return swtbtnPDFLinks.Value;
|
||||
}
|
||||
}
|
||||
public int RemoveTrailingHardReturnsAndManualPageBreaks
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -28,19 +36,38 @@ namespace VEPROMS
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
// RHM20150506 Multiline ItemID TextBox
|
||||
public string Prefix { get; set; } = "";
|
||||
public bool OpenAfterCreate // RHM20150506 Multiline ItemID TextBox
|
||||
private string _Prefix = ""; // RHM20150506 Multiline ItemID TextBox
|
||||
public string Prefix
|
||||
{
|
||||
get { return _Prefix; }
|
||||
set { _Prefix = value; }
|
||||
}
|
||||
public bool OpenAfterCreate // RHM20150506 Multiline ItemID TextBox
|
||||
{
|
||||
get { return cbxOpenAfterCreate2.Checked; }
|
||||
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; }
|
||||
}
|
||||
|
||||
public SessionInfo MySessionInfo { get; set; }
|
||||
public bool Automatic { get; set; }
|
||||
public int PrtSectID { get; set; } = -1;
|
||||
|
||||
public bool OverwritePDF
|
||||
private bool _OverwritePDF;
|
||||
public bool OverwritePDF
|
||||
{
|
||||
get { return cbxOverwritePDF2.Checked; }
|
||||
set { cbxOverwritePDF2.Checked = value; }
|
||||
@@ -58,17 +85,18 @@ namespace VEPROMS
|
||||
swtbtnPDFdtPrefixSuffix.Value = swtbtnPDFdtPrefixSuffix.Enabled = _AllowDateTimePrefixSuffix;
|
||||
}
|
||||
}
|
||||
private readonly DateTime _PrefixSuffixDTS = DateTime.Now; // C2018-033 date/time used for the date/time PDF file prefix and suffix
|
||||
private 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 _IncludeWordSecTextInMetafile = true; // C2018-023 so that we can turn off including Word attachment text in metafile
|
||||
private void RunAutomatic()
|
||||
{
|
||||
cbxDebugPagination.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;
|
||||
Application.DoEvents();
|
||||
string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray());
|
||||
bool ranAuto = false;
|
||||
foreach (string parameter in parameters)
|
||||
{
|
||||
if (parameter.ToUpper() == "/NT")
|
||||
@@ -83,11 +111,11 @@ namespace VEPROMS
|
||||
_IncludeWordSecTextInMetafile = false; // C2018-023 turn off putting Word attachment text in the meta file for baseline compares
|
||||
}
|
||||
CreatePDFs();
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
private readonly DocVersionInfo _DocVersionInfo = null;
|
||||
private readonly bool _AllProcedures;
|
||||
private readonly DocVersionConfig _DocVersionConfig;
|
||||
private DocVersionInfo _DocVersionInfo = null;
|
||||
private bool _AllProcedures;
|
||||
private DocVersionConfig _DocVersionConfig;
|
||||
public string RevNum
|
||||
{
|
||||
get { return txbRevNum.Text; }
|
||||
@@ -115,8 +143,11 @@ namespace VEPROMS
|
||||
return RevNum + "/" + RevDate;
|
||||
}
|
||||
}
|
||||
public string ProcNum => MyProcedure.DisplayNumber;
|
||||
public string PDFPath
|
||||
public string ProcNum
|
||||
{
|
||||
get { return MyProcedure.DisplayNumber; }
|
||||
}
|
||||
public string PDFPath
|
||||
{
|
||||
get {// B2018-069 Revert to Temporary for Baseline testing
|
||||
if (PromsPrinter.BaselineTesting)
|
||||
@@ -148,7 +179,7 @@ namespace VEPROMS
|
||||
private bool _CreateButtonClicked = false; // B2020-062 control the toggle of date/time prefix/suffix on pdf file name
|
||||
public DlgPrintProcedure(DocVersionInfo dvi, bool automatic)
|
||||
{
|
||||
Automatic = automatic;
|
||||
_Automatic = automatic;
|
||||
InitializeComponent();
|
||||
_AllProcedures = true;
|
||||
_DocVersionConfig = dvi.DocVersionConfig;
|
||||
@@ -170,12 +201,14 @@ namespace VEPROMS
|
||||
btnCreatePDF.Text = "Create PDFs";
|
||||
HandleDocVersionSettings();
|
||||
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
|
||||
expPrnSetting.Expanded = swtbtnBlankPgsForDuplex.Value || swtbtnChgBar.Value || swtbtnGeneratePlacekeeper.Value || swtbtnPDFLinks.Value || swtbtnPROMSVersion.Value || swtbtnWaterMark.Value || swtbtnPDFdtPrefixSuffix.Value;
|
||||
}
|
||||
public DlgPrintProcedure(DocVersionInfo dvi)
|
||||
{
|
||||
Automatic = false;
|
||||
_Automatic = false;
|
||||
InitializeComponent();
|
||||
_AllProcedures = true;
|
||||
_DocVersionConfig = dvi.DocVersionConfig;
|
||||
@@ -216,12 +249,21 @@ namespace VEPROMS
|
||||
// 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;
|
||||
}
|
||||
private string _UnitNumber;
|
||||
public string UnitNumber
|
||||
{
|
||||
get { return _UnitNumber; }
|
||||
set { _UnitNumber = value; }
|
||||
}
|
||||
private int _UnitIndex;
|
||||
public int UnitIndex
|
||||
{
|
||||
get { return _UnitIndex; }
|
||||
set { _UnitIndex = value; }
|
||||
}
|
||||
|
||||
public string UnitNumber { get; set; }
|
||||
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)
|
||||
// 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();
|
||||
_AllProcedures = false;
|
||||
@@ -312,9 +354,31 @@ namespace VEPROMS
|
||||
swtbtnWaterMark.Value = false;
|
||||
else
|
||||
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();
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -352,7 +416,13 @@ namespace VEPROMS
|
||||
private Timer _MyTimer;
|
||||
public void SetupForProcedure() // RHM20150506 Multiline ItemID TextBox
|
||||
{
|
||||
if(_DocVersionInfo == null)Text = "Create PDF for " + ProcNum;
|
||||
if(_DocVersionInfo == null)this.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();
|
||||
ProcedureConfig pc = _MyProcedure.MyConfig as ProcedureConfig;
|
||||
// C2025-033 set which Child procedure is being printed used for PageStyle items
|
||||
@@ -364,7 +434,7 @@ namespace VEPROMS
|
||||
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
|
||||
RevNum = _NewRevForAllProcs ?? pc.Print_Rev;
|
||||
RevNum = (_NewRevForAllProcs == null) ? pc.Print_Rev : _NewRevForAllProcs;
|
||||
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);
|
||||
//Now check the format flags to determine if/how the Rev string should be parsed.
|
||||
@@ -428,6 +498,11 @@ namespace VEPROMS
|
||||
else
|
||||
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.DisplayMember = "Description";
|
||||
ppCmbxChgBarTxtType.ValueMember = "EValue";
|
||||
@@ -440,7 +515,7 @@ namespace VEPROMS
|
||||
bool usesRevDate = _MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate || _MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash;
|
||||
if (_MyProcedure.Sections != null)
|
||||
{
|
||||
foreach (SectionInfo mysection in _MyProcedure.Sections.OfType<SectionInfo>())
|
||||
foreach (SectionInfo mysection in _MyProcedure.Sections)
|
||||
hasReviewDate |= mysection.ActiveFormat.PlantFormat.HasPageListToken("{REVIEWDATE}");
|
||||
}
|
||||
// Only the New HLP format and the MYA format use this
|
||||
@@ -460,8 +535,9 @@ namespace VEPROMS
|
||||
if (MyProcedure == null) return;
|
||||
string PDFFilePrefix = _DocVersionConfig.Print_PDFFilePrefix;
|
||||
string PDFFileSuffix = _DocVersionConfig.Print_PDFFileSuffix;
|
||||
PDFDTPrefix dtPre = _DocVersionConfig.Print_PDFdtFilePrefix;
|
||||
PDFDTSuffix dtSuf = _DocVersionConfig.Print_PDFdtFileSuffix;
|
||||
string PDFFileName = "";
|
||||
PDFDTPrefix dtPre = _DocVersionConfig.Print_PDFdtFilePrefix;
|
||||
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 (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
|
||||
@@ -480,17 +556,19 @@ namespace VEPROMS
|
||||
if (dtSuf != PDFDTSuffix.None)
|
||||
PDFFileSuffix = "_" + (_PrefixSuffixDTS.ToString(dtSuf.ToString())).Replace("__", " ").Replace("_", "-");
|
||||
}
|
||||
string PDFFileName;
|
||||
if (ProcNum == string.Empty)
|
||||
PDFFileName = UnitNumber;
|
||||
else
|
||||
PDFFileName = string.Format("{0}", _MyProcedure.PDFNumber);
|
||||
|
||||
if ((PDFFileName ?? "") == "") PDFFileName = "NoProcNumber";
|
||||
if (ProcNum == string.Empty)
|
||||
//txbPDFName.Text = this.UnitNumber + ".pdf";
|
||||
PDFFileName = this.UnitNumber;
|
||||
else
|
||||
//txbPDFName.Text = string.Format("{0}.pdf", _MyProcedure.PDFNumber);
|
||||
PDFFileName = string.Format("{0}", _MyProcedure.PDFNumber);
|
||||
//if (txbPDFName.Text.StartsWith("*"))
|
||||
// txbPDFName.Text = txbPDFName.Text.Replace("*", this.UnitNumber);
|
||||
if ((PDFFileName ?? "") == "") PDFFileName = "NoProcNumber";
|
||||
if (PDFFileName.StartsWith("*"))
|
||||
PDFFileName = PDFFileName.Replace("*", UnitNumber);
|
||||
PDFFileName = PDFFileName.Replace("*", this.UnitNumber);
|
||||
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
|
||||
@@ -507,9 +585,12 @@ namespace VEPROMS
|
||||
swtbtnPDFdtPrefixSuffix.Enabled = hasPrefixSuffix;
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e) => Close();
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
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
|
||||
cbxOvrrideDefChgBars.Checked = false; // uncheck the override change bar check box inside the grouping
|
||||
@@ -633,7 +714,7 @@ namespace VEPROMS
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (MySessionInfo != null)
|
||||
{
|
||||
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures.OfType<ProcedureInfo>())
|
||||
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures)
|
||||
{
|
||||
string message = string.Empty;
|
||||
if (!MySessionInfo.CanCheckOutItem(myProc.ItemID, CheckOutType.Procedure, ref message))
|
||||
@@ -661,14 +742,15 @@ namespace VEPROMS
|
||||
pbPDFsStatus.Maximum = n;
|
||||
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)
|
||||
Text = string.Format("Processing {0}", _DocVersionInfo.MyFolder.Name);
|
||||
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures.OfType<ProcedureInfo>())
|
||||
this.Text = string.Format("Processing {0}", _DocVersionInfo.MyFolder.Name);
|
||||
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures)
|
||||
{
|
||||
string locpdfname = null; // get pdf file name for later merge code
|
||||
MyProcedure = myProc;
|
||||
// C2021-019: Override Watermark Text, 'waterMarkText' will have whatever watermark text should be printed
|
||||
string waterMarkTextOverride = "";
|
||||
if (MyProcedure.MyConfig is ProcedureConfig procConfig) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE");
|
||||
// C2021-019: Override Watermark Text, 'waterMarkText' will have whatever watermark text should be printed
|
||||
ProcedureConfig procConfig = MyProcedure.MyConfig as ProcedureConfig;
|
||||
string waterMarkTextOverride = "";
|
||||
if (procConfig != null) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE");
|
||||
// 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;
|
||||
if (myProc.Sections != null)
|
||||
@@ -690,6 +772,13 @@ namespace VEPROMS
|
||||
pbPDFsStatus.TextVisible = true;
|
||||
pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
|
||||
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();
|
||||
_MergedPdfPath = myPDFPath; // If Slave, need its subdirectory/unit path for merging
|
||||
@@ -725,7 +814,14 @@ namespace VEPROMS
|
||||
pbPDFsStatus.TextVisible = true;
|
||||
pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
|
||||
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.
|
||||
// B2016-249 Output Procedure to folder associated with Parent Child
|
||||
// B2021-102 put in the using for better memory management
|
||||
@@ -754,9 +850,18 @@ namespace VEPROMS
|
||||
pbPDFsStatus.TextVisible = true;
|
||||
pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n);
|
||||
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.
|
||||
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);
|
||||
// B2021-102 put in the using for better memory management
|
||||
// B2016-249 Output Procedure to folder associated with Parent Child
|
||||
@@ -829,12 +934,12 @@ namespace VEPROMS
|
||||
private void CreateDebugFiles()
|
||||
{
|
||||
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)
|
||||
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
|
||||
{
|
||||
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
|
||||
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
|
||||
@@ -870,7 +975,7 @@ namespace VEPROMS
|
||||
if (MyProcedure.MyDocVersion.MultiUnitCount > 1)
|
||||
{
|
||||
VlnSvgPageHelper.CountInApplProcs = 1;
|
||||
foreach (ProcedureInfo pi in MyProcedure.MyDocVersion.Procedures.OfType<ProcedureInfo>())
|
||||
foreach (ProcedureInfo pi in MyProcedure.MyDocVersion.Procedures)
|
||||
{
|
||||
if (pi.ItemID == MyProcedure.ItemID) break;
|
||||
bool includeProc = pi.ApplInclude(SelectedSlave);
|
||||
@@ -886,14 +991,24 @@ namespace VEPROMS
|
||||
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
|
||||
frmPDFStatusForm.SetUnitWatermark(MyProcedure, ref waterMarkText, ref watermarkColor); //C2022-004 Unit Designator Watermark
|
||||
string waterMarkTextOverride = "";
|
||||
if (MyProcedure.MyConfig is ProcedureConfig procConfig) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE"); // C2021-019: override watermark text
|
||||
ProcedureConfig procConfig = MyProcedure.MyConfig as ProcedureConfig;
|
||||
string waterMarkTextOverride = "";
|
||||
if (procConfig != null) waterMarkTextOverride = procConfig.GetValue("PSI", "WATERMARKOVERRIDE"); // C2021-019: override watermark text
|
||||
if (swtbtnWaterMark.Value && waterMarkTextOverride != null && waterMarkTextOverride != "") waterMarkText = waterMarkTextOverride;
|
||||
// Determine change bar settings. First get from config & then see if override from dialog.
|
||||
// Also check that format allows override.
|
||||
ChangeBarDefinition cbd = DetermineChangeBarSettings();
|
||||
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
|
||||
// Initialize Print Cache
|
||||
MSWordToPDF.RoPrintCache = new Dictionary<string, ROFSTLookup.rochild>();
|
||||
@@ -930,7 +1045,7 @@ namespace VEPROMS
|
||||
|
||||
MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
|
||||
MyProcedure.SelectedChildToPrint = 0; // B2023-035 reset
|
||||
Close();
|
||||
this.Close();
|
||||
ShowDebugFiles();
|
||||
ProfileTimer.Pop(profileDepth);
|
||||
ProfileTimer.ShowTimerTable();
|
||||
@@ -1006,19 +1121,22 @@ namespace VEPROMS
|
||||
DoCreatePDF();
|
||||
}
|
||||
|
||||
public void QPCreatePDF() => DoCreatePDF();
|
||||
public void QPCreatePDF()
|
||||
{
|
||||
DoCreatePDF();
|
||||
}
|
||||
|
||||
private void DoCreatePDF()
|
||||
private void DoCreatePDF()
|
||||
{
|
||||
if (_AllProcedures)
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime dtStart = DateTime.Now;
|
||||
_MultiunitPdfLocation = cbxMultiunitPdfLocation.SelectedItem.ToString();
|
||||
PromsPrinter.ClearTransPageNumProblems();
|
||||
CreatePDFs();
|
||||
PromsPrinter.ReportTransPageNumProblems();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
if (_MergedPfd == null)
|
||||
{
|
||||
if (VlnSettings.DebugMode)
|
||||
@@ -1031,7 +1149,7 @@ namespace VEPROMS
|
||||
{
|
||||
MessageBox.Show("Completed Successfully", "Print All Procedures", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1040,14 +1158,14 @@ namespace VEPROMS
|
||||
// B2017-009 If the selected item is null don't add a folder
|
||||
if (cbxMultiunitPdfLocation.SelectedItem != null)
|
||||
_MultiunitPdfLocation = cbxMultiunitPdfLocation.SelectedItem.ToString();
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
_CreateButtonClicked = true; // B2020-062 control the toggle of date/time prefix/suffix on pdf file name
|
||||
CreatePDF();
|
||||
_CreateButtonClicked = false;
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
}
|
||||
private readonly bool _Initializing = false;
|
||||
private bool _Initializing = false;
|
||||
|
||||
private void btnPdfLocation_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -1073,9 +1191,12 @@ namespace VEPROMS
|
||||
ppTxbxChangeBarUserMsgOne.Enabled = enabled;
|
||||
ppTxbxChangeBarUserMsgTwo.Enabled = enabled;
|
||||
}
|
||||
private void cbxOvrrideDefChgBars_CheckStateChanged(object sender, EventArgs e) => SetCustomControls(cbxOvrrideDefChgBars.Checked);
|
||||
private void cbxOvrrideDefChgBars_CheckStateChanged(object sender, EventArgs e)
|
||||
{
|
||||
SetCustomControls(cbxOvrrideDefChgBars.Checked);
|
||||
}
|
||||
|
||||
private void rbCustom_Click(object sender, EventArgs e)
|
||||
private void rbCustom_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetCustomControls(true);
|
||||
// Make Custom controls visible
|
||||
@@ -1097,22 +1218,24 @@ namespace VEPROMS
|
||||
// B2024-058 Add validation for Revision Date field of the Print dialog
|
||||
private bool validateDate(TextBox txtDate)
|
||||
{
|
||||
if (!(txtDate.Text == ""))
|
||||
{
|
||||
if (DateTime.TryParse(txtDate.Text, out _))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
string txtDate2 = txtDate.Text;
|
||||
string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate2);
|
||||
string txtTitle = "Invalid Format";
|
||||
MessageBox.Show(message, txtTitle);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
DateTime dDate;
|
||||
if (!(txtDate.Text == ""))
|
||||
{
|
||||
|
||||
if (DateTime.TryParse(txtDate.Text, out dDate))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
string txtDate2 = txtDate.Text;
|
||||
string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate2);
|
||||
string txtTitle = "Invalid Format";
|
||||
MessageBox.Show(message, txtTitle);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void txbRevDate_Enter(object sender, EventArgs e)
|
||||
@@ -1120,6 +1243,8 @@ namespace VEPROMS
|
||||
txbDate = txbRevDate;
|
||||
grpDateSelector.Text = "Select Revision Date";
|
||||
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
|
||||
if (!validateDate(txbDate))
|
||||
{
|
||||
@@ -1134,16 +1259,17 @@ namespace VEPROMS
|
||||
private void txbRevDate_Leave(object sender, EventArgs e)
|
||||
{
|
||||
if (_Initializing) return;
|
||||
if (ActiveControl == calDateSelector)
|
||||
if (this.ActiveControl == calDateSelector)
|
||||
{
|
||||
txbRevDate.Focus(); //B2018-059 keep the calendar open until a different field on the print dialog is selected
|
||||
return;
|
||||
}
|
||||
txbDate = null;
|
||||
grpDateSelector.Visible = calDateSelector.Visible = false;
|
||||
// save the RevDate to the procedure's config.
|
||||
if (!(MyProcedure.MyConfig is ProcedureConfig pc)) return;
|
||||
pc.Print_RevDate = txbRevDate.Text;
|
||||
// save the RevDate to the procedure's config.
|
||||
ProcedureConfig pc = MyProcedure.MyConfig as ProcedureConfig;
|
||||
if (pc == null) return;
|
||||
pc.Print_RevDate = txbRevDate.Text;
|
||||
using (Item itm = Item.Get(MyProcedure.ItemID))
|
||||
{
|
||||
itm.MyContent.Config = MyProcedure.MyConfig.ToString();
|
||||
@@ -1157,9 +1283,10 @@ namespace VEPROMS
|
||||
if (_Initializing) return;
|
||||
txbDate = null;
|
||||
grpDateSelector.Visible = calDateSelector.Visible = false;
|
||||
// save the ReviewDate to the procedure's config.
|
||||
if (!(MyProcedure.MyConfig is ProcedureConfig pc)) return;
|
||||
pc.Print_ReviewDate = txbReviewDate.Text;
|
||||
// save the ReviewDate to the procedure's config.
|
||||
ProcedureConfig pc = MyProcedure.MyConfig as ProcedureConfig;
|
||||
if (pc == null) return;
|
||||
pc.Print_ReviewDate = txbReviewDate.Text;
|
||||
using (Item itm = Item.Get(MyProcedure.ItemID))
|
||||
{
|
||||
itm.MyContent.Config = MyProcedure.MyConfig.ToString();
|
||||
@@ -1199,9 +1326,10 @@ namespace VEPROMS
|
||||
// C2021-062 used to save rev number information when all procedures are printed or merged
|
||||
private void SaveRevNumToProcedureConfig(string newrevnum)
|
||||
{
|
||||
// save the RevNum to the procedure's config.
|
||||
if (!(MyProcedure.MyConfig is ProcedureConfig pc)) return;
|
||||
pc.Print_Rev = newrevnum;
|
||||
// save the RevNum to the procedure's config.
|
||||
ProcedureConfig pc = MyProcedure.MyConfig as ProcedureConfig;
|
||||
if (pc == null) return;
|
||||
pc.Print_Rev = newrevnum;
|
||||
using (Item itm = Item.Get(MyProcedure.ItemID))
|
||||
{
|
||||
itm.MyContent.Config = MyProcedure.MyConfig.ToString();
|
||||
@@ -1213,16 +1341,22 @@ namespace VEPROMS
|
||||
{
|
||||
if (expPrnSetting.Expanded)
|
||||
{
|
||||
Size = new Size(Size.Width + (expPrnSetting.Size.Width - expPrnSetting.TitlePanel.Size.Height), Size.Height);
|
||||
this.Size = new Size(this.Size.Width + (expPrnSetting.Size.Width - expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
|
||||
// B2018-137 set the visability of Generate Placekeeper
|
||||
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)
|
||||
{
|
||||
{
|
||||
if (expPrnSetting.Expanded)
|
||||
Size = new Size(Size.Width-(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), Size.Height);
|
||||
//this.Size = new Size(this.Size.Width+(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
|
||||
//else
|
||||
this.Size = new Size(this.Size.Width-(expPrnSetting.Size.Width-expPrnSetting.TitlePanel.Size.Height), this.Size.Height);
|
||||
//Refresh();
|
||||
|
||||
}
|
||||
|
||||
@@ -1261,15 +1395,15 @@ namespace VEPROMS
|
||||
DoCreatePDF(); // create indivitual pdfs
|
||||
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
|
||||
if (!_MergedPfd.DoTheMerge(cbxAlmPtTxt.Checked)) return; // merge them together.
|
||||
if (!_MergedPfd.DoTheMerge(PromsPrinter.MergedLandscapePages,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 (_DocVersionConfig.Print_MergedPdfsViewAfter)
|
||||
{
|
||||
if (_MergedPfd.MergedPdfs != null && _MergedPfd.MergedPdfs.Count > 0)
|
||||
{
|
||||
System.Diagnostics.Process sdp = System.Diagnostics.Process.Start(_MergedPfd.MergedFileName);
|
||||
// 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();
|
||||
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)
|
||||
sdp.WaitForInputIdle();
|
||||
}
|
||||
}
|
||||
else if (VlnSettings.DebugMode)
|
||||
@@ -1282,7 +1416,7 @@ namespace VEPROMS
|
||||
{
|
||||
FlexibleMessageBox.Show("Completed Successfully", "Print All and Merge Procedures", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void cbxAssignRevToAllMergedPrcs_CheckedChanged(object sender, EventArgs e)
|
||||
@@ -1294,5 +1428,10 @@ namespace VEPROMS
|
||||
_NewRevForAllProcs = null;
|
||||
}
|
||||
|
||||
|
||||
//private void cbxDebug_CheckedChanged(object sender, EventArgs e)
|
||||
//{
|
||||
// cbxCmpPRMSpfd.Visible = cbxDebug.Checked;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// 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,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using Volian.Base.Library;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
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 DevComponents.DotNetBar;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
|
||||
@@ -154,6 +154,7 @@
|
||||
<Compile Include="AboutVEPROMS.Designer.cs">
|
||||
<DependentUpon>AboutVEPROMS.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BookMarks.cs" />
|
||||
<Compile Include="dlgAnnotationsSelect.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -348,7 +349,6 @@
|
||||
<Compile Include="frmVersionsProperties.Designer.cs">
|
||||
<DependentUpon>frmVersionsProperties.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<EmbeddedResource Include="AboutVEPROMS.resx">
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace VEPROMS
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
@@ -20,7 +21,11 @@ namespace VEPROMS
|
||||
public partial class dlgApproveProcedure : Form
|
||||
{
|
||||
public event DisplayConsistencyReportEvent ConsistencyPrintRequest;
|
||||
private void OnConsistencyPrintRequest(ConsistencyReportArgs args) => ConsistencyPrintRequest?.Invoke(this, args);
|
||||
private void OnConsistencyPrintRequest(ConsistencyReportArgs args)
|
||||
{
|
||||
if (ConsistencyPrintRequest != null)
|
||||
ConsistencyPrintRequest(this, args);
|
||||
}
|
||||
private bool CanApprove
|
||||
{
|
||||
get { return btnApprove2.Enabled; }
|
||||
@@ -32,8 +37,12 @@ namespace VEPROMS
|
||||
tsslStatus.Text = value ? "" : "Need to correct the Rev Numbers marked with Question Marks";
|
||||
}
|
||||
}
|
||||
|
||||
public int ApplicabilityIndex { get; set; } = 0;
|
||||
private int _ApplicabilityIndex = 0;
|
||||
public int ApplicabilityIndex
|
||||
{
|
||||
get { return _ApplicabilityIndex; }
|
||||
set { _ApplicabilityIndex = value; }
|
||||
}
|
||||
private SessionInfo _MySessionInfo;
|
||||
public SessionInfo MySessionInfo
|
||||
{
|
||||
@@ -44,19 +53,23 @@ namespace VEPROMS
|
||||
_MyApproval.MySessionInfo = _MySessionInfo;
|
||||
}
|
||||
}
|
||||
private readonly ApprovalInfo _MyApproval;
|
||||
private readonly DocVersionInfo _MyDocVersion;
|
||||
|
||||
public frmVEPROMS MyFrmVEPROMS { get; set; } = null;
|
||||
private readonly bool _initializing = false; // C2018-008 redesign of user interface
|
||||
private ApprovalInfo _MyApproval;
|
||||
private DocVersionInfo _MyDocVersion;
|
||||
frmVEPROMS _MyFrmVEPROMS = null;
|
||||
public frmVEPROMS MyFrmVEPROMS
|
||||
{
|
||||
get { return _MyFrmVEPROMS; }
|
||||
set { _MyFrmVEPROMS = value; }
|
||||
}
|
||||
private bool _initializing = false; // C2018-008 redesign of user interface
|
||||
public dlgApproveProcedure(DocVersionInfo myDocVersion, frmVEPROMS myFrmVEPROMS) // approve all procedures
|
||||
{
|
||||
MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing
|
||||
_MyApproval = new ApprovalInfo(myFrmVEPROMS);// Save frmVEPROMS for Import to shutoff SessionPing
|
||||
ApplicabilityIndex = myDocVersion.DocVersionConfig.SelectedSlave;
|
||||
_MyApproval.SavedSlave = ApplicabilityIndex;
|
||||
ConsistencyPrintRequest -= new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
ConsistencyPrintRequest += new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
this.ConsistencyPrintRequest -= new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
this.ConsistencyPrintRequest += new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
_MyDocVersion = myDocVersion;
|
||||
_MyDocVersion.ResetProcedures(); // B2021-035: Pasted, modified number and deleted procedures not refreshed so missing from list
|
||||
InitializeComponent();
|
||||
@@ -64,7 +77,7 @@ namespace VEPROMS
|
||||
_MyApproval.StatusUpdated -= new ApprovalStatusChangeEvent(_MyApproval_StatusUpdated);
|
||||
_MyApproval.StatusUpdated += new ApprovalStatusChangeEvent(_MyApproval_StatusUpdated);
|
||||
SetupComboBoxes();
|
||||
foreach (ProcedureInfo pi in myDocVersion.Procedures.OfType<ProcedureInfo>())
|
||||
foreach (ProcedureInfo pi in myDocVersion.Procedures)
|
||||
{
|
||||
bool includeProc = pi.ApplInclude(ApplicabilityIndex); // C2021-027: Procedure level PC/PC
|
||||
if (includeProc)
|
||||
@@ -85,8 +98,31 @@ namespace VEPROMS
|
||||
|
||||
private void FlexGridAddEvents()
|
||||
{
|
||||
//fgProcs.ChangeEdit += new EventHandler(fgProcs_ChangeEdit);
|
||||
//Console.WriteLine(fgProcs.ComboBoxEditor.GetType().Name);
|
||||
//Console.WriteLine(fgProcs.Editor.GetType().Name);
|
||||
//fgProcs.ImeModeChanged += new EventHandler(fgProcs_ImeModeChanged);
|
||||
//fgProcs.LeaveEdit += new C1.Win.C1FlexGrid.RowColEventHandler(fgProcs_LeaveEdit);
|
||||
//fgProcs.SetupEditor += new C1.Win.C1FlexGrid.RowColEventHandler(fgProcs_SetupEditor);
|
||||
//fgProcs.StartEdit += new C1.Win.C1FlexGrid.RowColEventHandler(fgProcs_StartEdit);
|
||||
//fgProcs.ValidateEdit += new C1.Win.C1FlexGrid.ValidateEditEventHandler(fgProcs_ValidateEdit);
|
||||
fgProcs.ComboCloseUp -= new C1.Win.C1FlexGrid.RowColEventHandler(fgProcs_ComboCloseUp);
|
||||
fgProcs.ComboCloseUp += new C1.Win.C1FlexGrid.RowColEventHandler(fgProcs_ComboCloseUp);
|
||||
//fgProcs.MouseDown += new MouseEventHandler(fgProcs_MouseDown);
|
||||
//fgProcs.MouseUp += new MouseEventHandler(fgProcs_MouseUp);
|
||||
}
|
||||
|
||||
void fgProcs_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
C1.Win.C1FlexGrid.HitTestInfo hti = fgProcs.HitTest(e.X, e.Y);
|
||||
//Console.WriteLine("fgProcs_MouseUp X={0},Y={1},Row={2},Col={3}", e.X, e.Y, hti.Row, hti.Column);
|
||||
}
|
||||
|
||||
void fgProcs_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
C1.Win.C1FlexGrid.HitTestInfo hti = fgProcs.HitTest(e.X, e.Y);
|
||||
//Console.WriteLine("fgProcs_MouseDown X={0},Y={1},Row={2},Col={3}", e.X, e.Y, hti.Row, hti.Column);
|
||||
|
||||
}
|
||||
|
||||
void fgProcs_ComboCloseUp(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
||||
@@ -98,6 +134,46 @@ namespace VEPROMS
|
||||
//Console.WriteLine("fgProcs_ComboCloseUp row: {0}, col: {1}, val: {2}, etostring: {3}", e.Row, e.Col, fgProcs[e.Row, e.Col], e.ToString());
|
||||
}
|
||||
|
||||
void fgProcs_ValidateEdit(object sender, C1.Win.C1FlexGrid.ValidateEditEventArgs e)
|
||||
{
|
||||
//Console.WriteLine("fgProcs_ValidateEdit");
|
||||
}
|
||||
|
||||
void fgProcs_StartEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
||||
{
|
||||
|
||||
object val = fgProcs[e.Row, e.Col];
|
||||
DateTime dt = (DateTime)val;
|
||||
if (dt != null)
|
||||
dt = dt.AddHours(1);
|
||||
fgProcs[e.Row, e.Col] = dt;
|
||||
//Console.WriteLine("fgProcs_StartEdit val: {0}, dt: {1}", val, dt);
|
||||
}
|
||||
|
||||
void fgProcs_SetupEditor(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
||||
{
|
||||
//Console.WriteLine("fgProcs_SetupEditor");
|
||||
}
|
||||
|
||||
void fgProcs_LeaveEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
||||
{
|
||||
object val = fgProcs[e.Row, e.Col];
|
||||
DateTime dt = (DateTime)val;
|
||||
if (dt != null && dt.Hour != 0)
|
||||
dt = dt.AddHours(-1);
|
||||
fgProcs[e.Row, e.Col] = dt;
|
||||
//Console.WriteLine("fgProcs_LeaveEdit val: {0}, dt: {1}, mouserow={2}, mousecol={3}", val, dt, fgProcs.MouseRow, fgProcs.MouseCol);
|
||||
}
|
||||
|
||||
void fgProcs_ImeModeChanged(object sender, EventArgs e)
|
||||
{
|
||||
//Console.WriteLine("fgProcs_ImeModeChanged");
|
||||
}
|
||||
|
||||
void fgProcs_ChangeEdit(object sender, EventArgs e)
|
||||
{
|
||||
//Console.WriteLine("fgProcs_ChangeEdit");
|
||||
}
|
||||
//C2020-036 returns a string of duplicate procedure numbers separated by newlines for use in FlexibleMessageBox
|
||||
private string dupProcList
|
||||
{
|
||||
@@ -107,13 +183,12 @@ namespace VEPROMS
|
||||
if (dpl.Count > 0)
|
||||
{
|
||||
foreach (string pn in dpl)
|
||||
rtn += $"{pn}\n";
|
||||
rtn += pn + "\n";
|
||||
rtn = rtn.TrimEnd('\n');
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
}
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private List<string> dpl = new List<string>(); //C2020-036 used to create list duplicate procedure numbers
|
||||
|
||||
private bool InitializePanelSelect()
|
||||
@@ -121,7 +196,7 @@ namespace VEPROMS
|
||||
if (clbMore.Items.Count == 0)
|
||||
{
|
||||
dpl.Clear();
|
||||
foreach (ProcedureInfo pi in _MyDocVersion.Procedures.OfType<ProcedureInfo>())
|
||||
foreach (ProcedureInfo pi in _MyDocVersion.Procedures)
|
||||
{
|
||||
bool includeProc = pi.ApplInclude(ApplicabilityIndex); // C2021-027: Procedure level PC/PC
|
||||
if (includeProc)
|
||||
@@ -170,22 +245,22 @@ namespace VEPROMS
|
||||
lblViewPDF.Enabled = false;
|
||||
if (_MyApproval.MyProcedures.Count == 1)
|
||||
{
|
||||
Text = "Approve " + _MyApproval.MyProcedures[0].ProcInfo.DisplayNumber;
|
||||
this.Text = "Approve " + _MyApproval.MyProcedures[0].ProcInfo.DisplayNumber;
|
||||
swtbtViewPDF.Value = false;
|
||||
swtbtViewPDF.Enabled = true;
|
||||
lblViewPDF.Enabled = true;
|
||||
}
|
||||
else if (_MyApproval.MyProcedures.Count == _MyDocVersion.Procedures.Count)
|
||||
Text = "Approve All Procedures";
|
||||
this.Text = "Approve All Procedures";
|
||||
else
|
||||
Text = "Approve Selected Procedures";
|
||||
this.Text = "Approve Selected Procedures";
|
||||
}
|
||||
private void InitializePanelApprove()
|
||||
{
|
||||
setupLablesAndSwitches(); // C2018-008 redesign of user interface
|
||||
SetupMyApproval();
|
||||
}
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
|
||||
private Dictionary<string, ProcedureInfo> tmpProcedures = new Dictionary<string, ProcedureInfo>();
|
||||
private ProcedureInfo GetProcedureInfoByKey(string key)
|
||||
{
|
||||
@@ -202,13 +277,12 @@ namespace VEPROMS
|
||||
return tmpProcedures[GetDisplayNumberOnly(key)];
|
||||
}
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "selectsome Kept for Legacy - To give Constructor a different Signature")]
|
||||
public dlgApproveProcedure(DocVersionInfo myDocVersion, bool selectSome, frmVEPROMS myFrmVEPROMS) // approve some procedures
|
||||
{
|
||||
MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing
|
||||
_MyApproval = new ApprovalInfo(myFrmVEPROMS);// Save frmVEPROMS for Import to shutoff SessionPing
|
||||
ConsistencyPrintRequest -= new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
ConsistencyPrintRequest += new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
this.ConsistencyPrintRequest -= new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
this.ConsistencyPrintRequest += new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
_MyDocVersion = myDocVersion;
|
||||
_MyDocVersion.ResetProcedures(); // B2021-035: Pasted, modified number and deleted procedures not refreshed so missing from list
|
||||
InitializeComponent();
|
||||
@@ -229,8 +303,8 @@ namespace VEPROMS
|
||||
{
|
||||
MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing
|
||||
_MyApproval = new ApprovalInfo(myFrmVEPROMS);// Save frmVEPROMS for Import to shutoff SessionPing
|
||||
ConsistencyPrintRequest -= new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
ConsistencyPrintRequest += new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
this.ConsistencyPrintRequest -= new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
this.ConsistencyPrintRequest += new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
_MyDocVersion = myProcedure.MyDocVersion;
|
||||
_MyDocVersion.ResetProcedures(); // B2021-035: Pasted, modified number and deleted procedures not refreshed so missing from list
|
||||
ApplicabilityIndex = _MyDocVersion.DocVersionConfig.SelectedSlave; // B2022-033 set the child being approved or workflow so other procedure list can populate
|
||||
@@ -254,7 +328,12 @@ namespace VEPROMS
|
||||
}
|
||||
_initializing = false;
|
||||
}
|
||||
private bool ProcedureSetHasDuplicateProcedureNumbers()
|
||||
{
|
||||
bool hasDuplicateProcNums = false;
|
||||
|
||||
return hasDuplicateProcNums;
|
||||
}
|
||||
void _MyApproval_StatusUpdated(ApprovalInfo sender, ApprovalMessageArgs e)
|
||||
{
|
||||
tsslMsg2.Text = e.MyStatus;
|
||||
@@ -263,16 +342,33 @@ namespace VEPROMS
|
||||
private void SetupMyApproval()
|
||||
{
|
||||
approvalInfoBindingSource.DataSource = _MyApproval;
|
||||
_MyApproval.RevType = 1; // C2018-008 redesign of user interface
|
||||
//if(_MyApproval.MyProcedures.Count == 1)
|
||||
// lblOldRevNumber.Text = _MyApproval.RevNumber;
|
||||
//else if (_MyApproval.MyProcedures.Count > 1)
|
||||
// lblMaxRevNumber1.Text = GetMaxRevNumber();
|
||||
_MyApproval.RevType = 1; // C2018-008 redesign of user interface //(revTypeBindingSource.Current as RevType).TypeID;
|
||||
_MyApproval.RevStage = (stageInfoBindingSource.Current == null) ? 0 : (stageInfoBindingSource.Current as StageInfo).StageID;// C2018-008 redesign of user interface
|
||||
approvalInfoBindingSource.ResetBindings(false);
|
||||
approvalProcedureBindingSource.DataSource = _MyApproval.MyProcedures;
|
||||
approvalProcedureBindingSource.ResetBindings(false);
|
||||
//this.ConsistencyPrintRequest -= new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest);
|
||||
}
|
||||
|
||||
private string GetMaxRevNumber()
|
||||
{
|
||||
string mrn = string.Empty;
|
||||
foreach (ApprovalProcedure ap in _MyApproval.MyProcedures)
|
||||
{
|
||||
int k = _MyApproval.FancyShmancyRevCompare(mrn, ap.RevNumber);
|
||||
if (k < 0)
|
||||
mrn = ap.RevNumber;
|
||||
}
|
||||
return mrn;
|
||||
}
|
||||
|
||||
void dlgApproveProcedure_ConsistencyPrintRequest(object sender, ConsistencyReportArgs args)
|
||||
{
|
||||
foreach (ProcedureInfo pi in args.MyItems.OfType<ProcedureInfo>())
|
||||
foreach (ProcedureInfo pi in args.MyItems)
|
||||
pi.IsSelected = _MyApproval.ProcedureExists(pi);
|
||||
PDFConsistencyCheckReport rpt = new PDFConsistencyCheckReport(args.ReportName, args.MyItems, args.MyDocVersion); //B2020-020 needed to pass in DocVersion to get paper size from format
|
||||
rpt.BuildReport();
|
||||
@@ -293,12 +389,20 @@ namespace VEPROMS
|
||||
|
||||
private void btnApprove_Click(object sender, EventArgs e)
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
if(!_MyApproval.Approve(new Point(Left,Bottom),cmbRevisionStage2.Text)) // C2021-020 pass in the revision stage name
|
||||
DialogResult = DialogResult.None;
|
||||
Cursor = Cursors.Default;
|
||||
this.DialogResult = DialogResult.None;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
// C2018-008 redesign of user interface
|
||||
// -- Note that the Revison Type data source is still connected (revTypeBindingSource) - commented out for documentatin purposes
|
||||
//private void cmbRevisionType_SelectedIndexChanged(object sender, EventArgs e)
|
||||
//{
|
||||
// RevType rt = cmbRevisionType2.SelectedItem as RevType;
|
||||
// _MyApproval.RevType = rt.TypeID;
|
||||
//}
|
||||
|
||||
private void cmbRevisionStage_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
StageInfo si = cmbRevisionStage2.SelectedItem as StageInfo;
|
||||
@@ -327,6 +431,7 @@ namespace VEPROMS
|
||||
SetupComboBoxes();
|
||||
for (int i = 0; i < clbMore.Items.Count; i++)
|
||||
{
|
||||
string xyz = clbMore.Items[i].ToString();
|
||||
ProcedureInfo pi = GetProcedureInfoByKey(clbMore.Items[i].ToString());
|
||||
if (clbMore.GetItemChecked(i))
|
||||
{
|
||||
@@ -344,7 +449,10 @@ namespace VEPROMS
|
||||
RefreshCount(); // B2021-015: select/clear all not populating left panel & count not refreshed.
|
||||
}
|
||||
|
||||
private void btnCheck_Click(object sender, EventArgs e) => UpdateClbMore();
|
||||
private void btnCheck_Click(object sender, EventArgs e)
|
||||
{
|
||||
UpdateClbMore();
|
||||
}
|
||||
|
||||
private ItemInfoList _MyItemInfoList;
|
||||
private void UpdateClbMore()
|
||||
@@ -377,7 +485,7 @@ namespace VEPROMS
|
||||
if (info.Contains(" - ("))
|
||||
clbMore.Items[i] = info.Substring(0, info.IndexOf(" - ("));
|
||||
}
|
||||
foreach (ProcedureInfo npi in _MyItemInfoList.OfType<ProcedureInfo>())
|
||||
foreach (ProcedureInfo npi in _MyItemInfoList)
|
||||
{
|
||||
string info = string.Format("{0} - ({1})", npi.DisplayNumber, npi.MyDifferenceReasons);
|
||||
//checked list box
|
||||
@@ -398,7 +506,7 @@ namespace VEPROMS
|
||||
for (int i = 0; i < clbMore.Items.Count; i++)
|
||||
{
|
||||
if (!clbMore.Items[i].ToString().Contains(" - ("))
|
||||
clbMore.Items[i] = $"{clbMore.Items[i]} - (none)";
|
||||
clbMore.Items[i] = clbMore.Items[i].ToString() + " - (none)";
|
||||
}
|
||||
Application.DoEvents();
|
||||
clbMore.Enabled = btnAll.Enabled = btnClear.Enabled = true;
|
||||
@@ -415,7 +523,10 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
// B2021-015: select/clear all not populating left panel & count not refreshed.
|
||||
private void RefreshCount() => lblMore.Text = string.Format("{0} Procedures, {1} Selected", clbMore.Items.Count, clbMore.CheckedItems.Count);
|
||||
private void RefreshCount()
|
||||
{
|
||||
lblMore.Text = string.Format("{0} Procedures, {1} Selected", clbMore.Items.Count, clbMore.CheckedItems.Count);
|
||||
}
|
||||
|
||||
void ItemInfoList_ConsistencyCheckUpdated(object sender, ItemInfoListCCEventArgs args)
|
||||
{
|
||||
@@ -461,12 +572,14 @@ namespace VEPROMS
|
||||
if (clbMore.Items[itemIndex] != null)
|
||||
{
|
||||
SuperTooltipInfo stti = sttMore.GetSuperTooltip(clbMore);
|
||||
//string headerText = tmpProcedures[xyz].DisplayNumber;
|
||||
//string bodyText = tmpProcedures[xyz].MyDifferencesText;
|
||||
stti.HeaderText = GetProcedureInfoByKey(clbMore.Items[itemIndex].ToString()).DisplayNumber;
|
||||
stti.BodyText = GetProcedureInfoByKey(clbMore.Items[itemIndex].ToString()).MyDifferencesText;
|
||||
stti.FooterVisible = false;
|
||||
using (Graphics g = CreateGraphics())
|
||||
{
|
||||
SizeF sf = g.MeasureString(stti.BodyText, Font);
|
||||
SizeF sf = g.MeasureString(stti.BodyText, this.Font);
|
||||
stti.CustomSize = new Size(10 + sf.ToSize().Width, 0);
|
||||
}
|
||||
sttMore.ShowTooltip(sender);
|
||||
@@ -498,7 +611,10 @@ namespace VEPROMS
|
||||
|
||||
}
|
||||
|
||||
private void btnReportMore_Click(object sender, EventArgs e) => OnConsistencyPrintRequest(new ConsistencyReportArgs(Volian.Base.Library.VlnSettings.TemporaryFolder + @"\MyConsistency.pdf", _MyItemInfoList, _MyDocVersion)); //B2020-020 needed to pass in DocVersion to get paper size from format
|
||||
private void btnReportMore_Click(object sender, EventArgs e)
|
||||
{
|
||||
OnConsistencyPrintRequest(new ConsistencyReportArgs(Volian.Base.Library.VlnSettings.TemporaryFolder + @"\MyConsistency.pdf", _MyItemInfoList, _MyDocVersion)); //B2020-020 needed to pass in DocVersion to get paper size from format
|
||||
}
|
||||
|
||||
private void fgProcs_AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
|
||||
{
|
||||
@@ -608,16 +724,19 @@ namespace VEPROMS
|
||||
private void expAddProcConChk_ExpandedChanged(object sender, ExpandedChangeEventArgs e) // C2018-008 redesign of user interface
|
||||
{
|
||||
if (expAddProcConChk.Expanded)
|
||||
Size = new Size(Size.Width + (expAddProcConChk.Size.Width - expAddProcConChk.TitlePanel.Size.Height), Size.Height);
|
||||
this.Size = new Size(this.Size.Width + (expAddProcConChk.Size.Width - expAddProcConChk.TitlePanel.Size.Height), this.Size.Height);
|
||||
}
|
||||
|
||||
private void expAddProcConChk_ExpandedChanging(object sender, ExpandedChangeEventArgs e) // C2018-008 redesign of user interface
|
||||
{
|
||||
if (expAddProcConChk.Expanded)
|
||||
Size = new Size(Size.Width - (expAddProcConChk.Size.Width - expAddProcConChk.TitlePanel.Size.Height), Size.Height);
|
||||
this.Size = new Size(this.Size.Width - (expAddProcConChk.Size.Width - expAddProcConChk.TitlePanel.Size.Height), this.Size.Height);
|
||||
}
|
||||
|
||||
private void fgProcs_AfterDataRefresh(object sender, ListChangedEventArgs e) => btnApprove2.Enabled = CanApprove && tsslStatus.Text.Length == 0; // B2016-057 If did un-successful Auto Increament Rev Number, then don't enable Approve (Do Work Flow) button
|
||||
private void fgProcs_AfterDataRefresh(object sender, ListChangedEventArgs e)
|
||||
{
|
||||
btnApprove2.Enabled = CanApprove && tsslStatus.Text.Length == 0; // B2016-057 If did un-successful Auto Increament Rev Number, then don't enable Approve (Do Work Flow) button
|
||||
}
|
||||
|
||||
// C2020-040 automatically update left panel when tree item in right panel is selected or deselected
|
||||
private void clbMore_SelectedIndexChanged(object sender, EventArgs e)
|
||||
@@ -639,11 +758,18 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
private void clbMore_MouseLeave(object sender, EventArgs e) //C2020-045 - added switch to control if pop-ups are displayed in procedure list
|
||||
=> sttMore.Enabled = true;
|
||||
{
|
||||
sttMore.Enabled = true;
|
||||
}
|
||||
}
|
||||
public class ApprovalProcedure
|
||||
{
|
||||
public ProcedureInfo ProcInfo { get; set; }
|
||||
private ProcedureInfo _ProcInfo;
|
||||
public ProcedureInfo ProcInfo
|
||||
{
|
||||
get { return _ProcInfo; }
|
||||
set { _ProcInfo = value; }
|
||||
}
|
||||
private string _RevNumber;
|
||||
public string RevNumber
|
||||
{
|
||||
@@ -653,17 +779,37 @@ namespace VEPROMS
|
||||
if (value.Trim() != _RevNumber)
|
||||
{
|
||||
_RevNumber = value.Trim();
|
||||
//_RevDate = DateTime.Now; // commented out for bug fix B2013-012
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime RevDate { get; set; }
|
||||
private DateTime _RevDate;
|
||||
public DateTime RevDate
|
||||
{
|
||||
get { return _RevDate; }
|
||||
set { _RevDate = value; }
|
||||
}
|
||||
// added RevNumAndDate to handle the use use of the DoRevDate flag
|
||||
// this fixes bug B2013-011 where Today's date would print on the approved procedures (Westinghouse data)
|
||||
// instead of the the Revision Date assigned to the procedure.
|
||||
public string RevNumAndDate => ProcInfo.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate ? $"{RevNumber}/{RevDate:M/d/yyyy}" : RevNumber;
|
||||
public string DisplayNumber => ProcInfo.DisplayNumber;
|
||||
public override string ToString() => string.Format("{0}\t{1}\t{2:M/d/yyyy}", ProcInfo.DisplayNumber, _RevNumber, RevDate);
|
||||
public string RevNumAndDate
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_ProcInfo.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate)
|
||||
return RevNumber + "/" + RevDate.ToString("M/d/yyyy");
|
||||
else
|
||||
return RevNumber;
|
||||
}
|
||||
}
|
||||
public string DisplayNumber
|
||||
{
|
||||
get { return _ProcInfo.DisplayNumber; }
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}\t{1}\t{2:M/d/yyyy}", _ProcInfo.DisplayNumber, _RevNumber, _RevDate);
|
||||
}
|
||||
public ApprovalProcedure(ProcedureInfo proc)
|
||||
{
|
||||
proc.ProcedureConfig.SelectedSlave = proc.MyDocVersion.DocVersionConfig.SelectedSlave;
|
||||
@@ -672,42 +818,105 @@ namespace VEPROMS
|
||||
string sRevDate = proc.ProcedureConfig.Print_RevDate;
|
||||
if (sRevDate == string.Empty)
|
||||
sRevDate = DateTime.Now.ToString("M/d/y");
|
||||
if (!DateTime.TryParse(sRevDate, out DateTime revDate)) revDate = DateTime.Now;
|
||||
DateTime revDate;
|
||||
if (!DateTime.TryParse(sRevDate, out revDate)) revDate = DateTime.Now;
|
||||
RevDate = revDate;
|
||||
}
|
||||
}
|
||||
public class ApprovalMessageArgs : EventArgs
|
||||
{
|
||||
public ApprovalMessageArgs(string msg) => MyStatus = msg;
|
||||
|
||||
public string MyStatus { get; set; }
|
||||
public ApprovalMessageArgs(string msg)
|
||||
{
|
||||
_MyStatus = msg;
|
||||
}
|
||||
private string _MyStatus;
|
||||
public string MyStatus
|
||||
{
|
||||
get { return _MyStatus; }
|
||||
set { _MyStatus = value; }
|
||||
}
|
||||
}
|
||||
public delegate void ApprovalStatusChangeEvent(ApprovalInfo sender, ApprovalMessageArgs e);
|
||||
public class ApprovalInfo
|
||||
{
|
||||
public frmVEPROMS MyFrmVEPROMS { get; set; } = null;
|
||||
frmVEPROMS _MyFrmVEPROMS = null;
|
||||
public frmVEPROMS MyFrmVEPROMS
|
||||
{
|
||||
get { return _MyFrmVEPROMS; }
|
||||
set { _MyFrmVEPROMS = value; }
|
||||
}
|
||||
public event ApprovalStatusChangeEvent StatusUpdated;
|
||||
public void OnStatusUpdated(ApprovalInfo sender, ApprovalMessageArgs e) => StatusUpdated?.Invoke(sender, e);
|
||||
|
||||
public SessionInfo MySessionInfo { get; set; }
|
||||
public int RevType { get; set; }
|
||||
public string RevNumber { get; set; }
|
||||
private DateTime? _RevDate;
|
||||
public DateTime? RevDate
|
||||
public void OnStatusUpdated(ApprovalInfo sender, ApprovalMessageArgs e)
|
||||
{
|
||||
if (StatusUpdated != null)
|
||||
StatusUpdated(sender, e);
|
||||
}
|
||||
private SessionInfo _MySessionInfo;
|
||||
public SessionInfo MySessionInfo
|
||||
{
|
||||
get { return _MySessionInfo; }
|
||||
set { _MySessionInfo = value; }
|
||||
}
|
||||
private int _RevType;
|
||||
public int RevType
|
||||
{
|
||||
get { return _RevType; }
|
||||
set { _RevType = value; }
|
||||
}
|
||||
private string _RevNumber;
|
||||
public string RevNumber
|
||||
{
|
||||
get { return _RevNumber; }
|
||||
set { _RevNumber = value; }
|
||||
}
|
||||
private Nullable<DateTime> _RevDate;
|
||||
public Nullable<DateTime> RevDate
|
||||
{
|
||||
get { return _RevDate == null ? _RevDate : _RevDate.Value; }
|
||||
set { _RevDate = value; }
|
||||
}
|
||||
|
||||
public int RevStage { get; set; }
|
||||
public string RevNote { get; set; }
|
||||
public bool ViewPDF { get; set; }
|
||||
public string MsgNumber { get; set; }
|
||||
public string MsgDate { get; set; }
|
||||
public bool CanIncrement { get; set; }
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private int _RevStage;
|
||||
public int RevStage
|
||||
{
|
||||
get { return _RevStage; }
|
||||
set { _RevStage = value; }
|
||||
}
|
||||
private string _RevNote;
|
||||
public string RevNote
|
||||
{
|
||||
get { return _RevNote; }
|
||||
set { _RevNote = value; }
|
||||
}
|
||||
private bool _ViewPDF;
|
||||
public bool ViewPDF
|
||||
{
|
||||
get { return _ViewPDF; }
|
||||
set { _ViewPDF = value; }
|
||||
}
|
||||
private string _MsgNumber;
|
||||
public string MsgNumber
|
||||
{
|
||||
get { return _MsgNumber; }
|
||||
set { _MsgNumber = value; }
|
||||
}
|
||||
private string _MsgDate;
|
||||
public string MsgDate
|
||||
{
|
||||
get { return _MsgDate; }
|
||||
set { _MsgDate = value; }
|
||||
}
|
||||
private bool _CanIncrement;
|
||||
public bool CanIncrement
|
||||
{
|
||||
get { return _CanIncrement; }
|
||||
set { _CanIncrement = value; }
|
||||
}
|
||||
private List<ApprovalProcedure> _MyProcedures;
|
||||
public List<ApprovalProcedure> MyProcedures => _MyProcedures;
|
||||
public List<ApprovalProcedure> MyProcedures
|
||||
{
|
||||
get { return _MyProcedures; }
|
||||
//set { _MyProcedures = value; }
|
||||
}
|
||||
|
||||
//B2026-058 - If approving multiple procedures at the same time with a multiunit set and one of the procedures is open, PROMS sometimes loses that it is set for an individual unit.
|
||||
// this will save the SectedSlave in case a refresh causes it to get lost
|
||||
@@ -718,6 +927,10 @@ namespace VEPROMS
|
||||
MyFrmVEPROMS = myFrmVEPROMS;// Save frmVEPROMS for Import to shutoff SessionPing
|
||||
_MyProcedures = new List<ApprovalProcedure>();
|
||||
}
|
||||
private static string FormatRev(Match m)
|
||||
{
|
||||
return "".PadLeft(5 - m.Groups[1].Value.Length, '0') + m.Groups[1].Value;
|
||||
}
|
||||
public void AddProcedure(ProcedureInfo proc)
|
||||
{
|
||||
ApprovalProcedure ap = new ApprovalProcedure(proc);
|
||||
@@ -750,11 +963,64 @@ namespace VEPROMS
|
||||
public void Refresh()
|
||||
{
|
||||
bool ok = true;
|
||||
int rv = 0;
|
||||
foreach (ApprovalProcedure ap in MyProcedures)
|
||||
{
|
||||
ok = ok && int.TryParse(ap.RevNumber, out int rv);
|
||||
ok = ok && int.TryParse(ap.RevNumber, out rv);
|
||||
}
|
||||
CanIncrement = ok;
|
||||
_CanIncrement = ok;
|
||||
//if (MyProcedures.Count == 1)
|
||||
//{
|
||||
// ProcedureInfo pi = _MyProcedures[0].ProcInfo;
|
||||
// RevNumber = pi.ProcedureConfig.Print_Rev == string.Empty ? "0" : pi.ProcedureConfig.Print_Rev;
|
||||
// DateTime revdate = pi.ProcedureConfig.Print_RevDate == string.Empty ? DateTime.Now : DateTime.TryParse(pi.ProcedureConfig.Print_RevDate, out revdate) ? revdate : DateTime.Now;
|
||||
// RevDate = revdate;
|
||||
// RevNote = string.Empty;
|
||||
// ViewPDF = false;
|
||||
//}
|
||||
//else if (MyProcedures.Count > 1)
|
||||
//{
|
||||
// Regex myRegEx = new Regex("^([0-9]{1,5})");
|
||||
// SortedList<string, ProcedureInfo> printRevs = new SortedList<string, ProcedureInfo>();
|
||||
// SortedList<string, ProcedureInfo> printRevDates = new SortedList<string, ProcedureInfo>();
|
||||
// string printRev = string.Empty;
|
||||
// foreach (ApprovalProcedure pi in MyProcedures)
|
||||
// {
|
||||
// printRev = myRegEx.Replace(pi.RevNumber, new MatchEvaluator(FormatRev));
|
||||
// printRev = printRev == string.Empty ? "0" : printRev;
|
||||
// if (printRev != string.Empty)
|
||||
// if (!printRevs.ContainsKey(printRev))
|
||||
// printRevs.Add(printRev, pi.ProcInfo);
|
||||
// if (pi.RevDate != null)
|
||||
// if (!printRevDates.ContainsKey(pi.RevDate.ToString()))
|
||||
// printRevDates.Add(pi.RevDate.ToString(), pi.ProcInfo);
|
||||
// }
|
||||
// if (printRevs.Count > 1)
|
||||
// {
|
||||
// ProcedureInfo pi = printRevs[printRevs.Keys[printRevs.Count - 1]];
|
||||
// RevNumber = "*";
|
||||
// MsgNumber = "Multiple Revision Numbers found. Enter asterisk (*) to use current revision numbers or plus sign (+) to increment revision numbers";
|
||||
// }
|
||||
// else if (printRevs.Count == 1)
|
||||
// {
|
||||
// ProcedureInfo pi = printRevs[printRevs.Keys[printRevs.Count - 1]];
|
||||
// RevNumber = pi.ProcedureConfig.Print_Rev;
|
||||
// MsgNumber = string.Empty;
|
||||
// }
|
||||
// if (printRevDates.Count > 1)
|
||||
// {
|
||||
// RevDate = null;
|
||||
// MsgDate = "Multiple Revision Dates found. Use current revision dates or manually assign revision date by selecting a date";
|
||||
// }
|
||||
// else if (printRevDates.Count == 1)
|
||||
// {
|
||||
// ProcedureInfo pi = printRevDates[printRevDates.Keys[printRevDates.Count - 1]];
|
||||
// RevDate = DateTime.Parse(pi.ProcedureConfig.Print_RevDate);
|
||||
// MsgDate = string.Empty;
|
||||
// }
|
||||
// else if (printRevDates.Count == 0)
|
||||
// RevDate = DateTime.Now;
|
||||
//}
|
||||
}
|
||||
public void DeleteProcedure(ProcedureInfo pi)
|
||||
{
|
||||
@@ -770,7 +1036,10 @@ namespace VEPROMS
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
public bool CanApprove => RevType > 0 && RevNumber != string.Empty && RevStage > 0;
|
||||
public bool CanApprove
|
||||
{
|
||||
get { return _RevType > 0 && _RevNumber != string.Empty && _RevStage > 0; }
|
||||
}
|
||||
public int FancyShmancyRevCompare(string s1, string s2)
|
||||
{
|
||||
if (s1 == s2)
|
||||
@@ -895,13 +1164,13 @@ namespace VEPROMS
|
||||
if (MessageBox.Show(sb.ToString(),string.Format("Revert to {0}",nsi.Name),MessageBoxButtons.YesNo,MessageBoxIcon.Stop) == DialogResult.No)
|
||||
return false;
|
||||
}
|
||||
|
||||
DialogResult doSumChgDR = FlexibleMessageBox.Show("Do you want to save the Summary of Changes along with the Approved PDF?\r\n\r\nSelecting 'Cancel' will cancel the approval process.", "Create Summary of Changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);// == DialogResult.Yes;
|
||||
if (doSumChgDR == DialogResult.Cancel) return false;
|
||||
// C2018-007: When performing more than a single procedure approval (approve all or some), only prompt once whether to include
|
||||
// Summary of Changes (use the following 2 flags, code using them is below)
|
||||
// C2022-022: Moved the prompt once for Summary of changes out of loop and allow user to cancel, go back to approval dialog
|
||||
bool doSumChg = doSumChgDR == DialogResult.Yes;
|
||||
bool doSumChg = false;
|
||||
DialogResult doSumChgDR = FlexibleMessageBox.Show("Do you want to save the Summary of Changes along with the Approved PDF?\r\n\r\nSelecting 'Cancel' will cancel the approval process.", "Create Summary of Changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);// == DialogResult.Yes;
|
||||
if (doSumChgDR == DialogResult.Cancel) return false;
|
||||
doSumChg = doSumChgDR == DialogResult.Yes;
|
||||
List<string> procsApproved = new List<string>();
|
||||
foreach (ApprovalProcedure ap in MyProcedures)
|
||||
{
|
||||
@@ -917,8 +1186,9 @@ namespace VEPROMS
|
||||
//B2026-058 - If approving multiple procedures at the same time with a multiunit set and one of the procedures is open, PROMS sometimes loses that it is set for an individual unit.
|
||||
ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave = SavedSlave;
|
||||
}
|
||||
procsApproved.Add($"{ap.ProcInfo.DisplayNumber} {ap.ProcInfo.DisplayText}");
|
||||
procsApproved.Add(ap.ProcInfo.DisplayNumber + " " + ap.ProcInfo.DisplayText);
|
||||
RevisionInfo ric = pi.MyDocVersion.DocVersionConfig.SelectedSlave > 0 ? RevisionInfo.GetCurrentByItemIDandUnitID(pi.ItemID, pi.MyDocVersion.DocVersionConfig.SelectedSlave) : RevisionInfo.GetCurrentByItemID(pi.ItemID);
|
||||
// RevisionInfo rip = RevisionInfo.GetPreviousByItemID(pi.ItemID);
|
||||
DateTime myDTS = pi.DTS; // pi.DTS is date of last approval
|
||||
string cbDTS = (pi.MyConfig as ProcedureConfig).Print_ChangeBarDate;
|
||||
// pi.DTS was the field that was used to store the approval date before master/slave code was added. Use ChangeBarDate if it is set - this is set either manually if no approval date (from treeview menu) or
|
||||
@@ -933,6 +1203,7 @@ namespace VEPROMS
|
||||
if (ap.RevNumber == ric.RevisionNumber)
|
||||
{
|
||||
myDTS = ric.MyConfig.History_StartDate;
|
||||
//UpdateProcedureDTS(pi, myDTS);
|
||||
}
|
||||
// New approval, i.e. not same revision number, use the date from the latest approved version
|
||||
else
|
||||
@@ -940,24 +1211,26 @@ namespace VEPROMS
|
||||
myDTS = ric.LatestVersion.DTS; // B2019-051: Extra info in Change Summary. Use the last 'approved' (ric.LatestVersion.MyStage.IsApproved==1)
|
||||
}
|
||||
}
|
||||
Revision revision;
|
||||
Revision revision = null;
|
||||
if (ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave > 0)
|
||||
{
|
||||
revision = Revision.GetByItemIDAndRevisionNumberAndUnitID(pi.ItemID, ap.RevNumber, ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave);
|
||||
if (revision == null) // no revision yet, need to set the StartDate & which slave
|
||||
{
|
||||
RevisionConfig cfg = new RevisionConfig
|
||||
{
|
||||
History_StartDate = myDTS, // if there is a slave, date found from above code
|
||||
Applicability_Index = ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave
|
||||
};
|
||||
RevisionConfig cfg = new RevisionConfig();
|
||||
cfg.History_StartDate = myDTS; // if there is a slave, date found from above code
|
||||
cfg.Applicability_Index = ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave;
|
||||
//cfg.Save();
|
||||
revision = Revision.MakeRevision(pi.ItemID, RevType, ap.RevNumber, ap.RevDate, RevNote, cfg.ToString(), now, Volian.Base.Library.VlnSettings.UserID);
|
||||
// revision.MyConfig.History_StartDate = pi.DTS;
|
||||
// revision.MyConfig.Save();
|
||||
// revision = revision.Save();
|
||||
}
|
||||
else if (revision.Notes != RevNote || revision.RevisionDate != ap.RevDate)
|
||||
{
|
||||
//C2016-036 - Inform the user that an existing approved version will be replaced
|
||||
//C2022-016 - Improve/clarify the dialog message
|
||||
if (MessageBox.Show($"Replace Existing Revision {ap.RevNumber}?\r\n\r\nTo create a new revision, click Cancel then change\r\nthe Rev. Number.", "Replace Existing", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
|
||||
if (MessageBox.Show("Replace Existing Revision " + ap.RevNumber + "?\r\n\r\nTo create a new revision, click Cancel then change\r\nthe Rev. Number.", "Replace Existing", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
|
||||
return false;
|
||||
revision.Notes = RevNote;
|
||||
revision.RevisionDate = ap.RevDate;
|
||||
@@ -972,17 +1245,19 @@ namespace VEPROMS
|
||||
// went wrong, the revision could be created but not the version. Added the count check below.
|
||||
if (revision == null || revision.RevisionVersionCount==0) // no revision yet, need to set the StartDate. If there is a revision, it uses the revision date as the startdate
|
||||
{
|
||||
RevisionConfig cfg = new RevisionConfig
|
||||
{
|
||||
History_StartDate = pi.DTS // todo: this should probably be myDTS, found during fix of B2019-051.
|
||||
};
|
||||
RevisionConfig cfg = new RevisionConfig();
|
||||
cfg.History_StartDate = pi.DTS; // todo: this should probably be myDTS, found during fix of B2019-051.
|
||||
//cfg.Save();
|
||||
revision = Revision.MakeRevision(pi.ItemID, RevType, ap.RevNumber, ap.RevDate, RevNote, cfg.ToString(), now, Volian.Base.Library.VlnSettings.UserID);
|
||||
// revision.MyConfig.History_StartDate = pi.DTS;
|
||||
// revision.MyConfig.Save();
|
||||
// revision = revision.Save();
|
||||
}
|
||||
else if (revision.Notes != RevNote || revision.RevisionDate != ap.RevDate)
|
||||
{
|
||||
//C2016-036 - Inform the user that an existing approved version will be replaced
|
||||
//C2022-016 - Improve/clarify the dialog message
|
||||
if (MessageBox.Show($"Replace Existing Revision {ap.RevNumber}?\r\n\r\nTo create a new revision, click Cancel then change\r\nthe Rev. Number.", "Replace Existing", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
|
||||
if (MessageBox.Show("Replace Existing Revision " + ap.RevNumber + "?\r\n\r\nTo create a new revision, click Cancel then change\r\nthe Rev. Number.", "Replace Existing", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel)
|
||||
return false;
|
||||
revision.Notes = RevNote;
|
||||
revision.RevisionDate = ap.RevDate;
|
||||
@@ -993,7 +1268,10 @@ namespace VEPROMS
|
||||
//B2017-149 Allow the user to choose if they want the Summary of Changes report created during the approval process
|
||||
if (doSumChg) summaryBuf = CreateSummary(ref pi, summaryPDF, myDTS);
|
||||
DateTime currentDTS = now;
|
||||
_ = Check.MakeCheck(revision, Stage.GetJustStage(RevStage), RevisionInfo.BuildRevisionChecks(pi), currentDTS, VlnSettings.UserID);
|
||||
Check check = Check.MakeCheck(revision, Stage.GetJustStage(RevStage), RevisionInfo.BuildRevisionChecks(pi), currentDTS, VlnSettings.UserID);
|
||||
//make pdf with promsprinter and get byte stream
|
||||
// Moved to end so that Item and Content are saved at the same time
|
||||
//UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, myDTS);
|
||||
string watermarkColor = "Blue"; // this is the default watermark color
|
||||
string waterMark = Stage.GetJustStage(RevStage).IsApproved > 0 ? null : Stage.GetJustStage(RevStage).Name;
|
||||
// C2022-004 - BNPP if doing an approval stage, and the format file uses the UseUnitWatermarkOnApproved format flag (<PrintData UseUnitWatermarkOnApproved = "true"\>)
|
||||
@@ -1003,14 +1281,39 @@ namespace VEPROMS
|
||||
waterMark = "Unit Designator";
|
||||
frmPDFStatusForm.SetUnitWatermark(MyProcedures[0].ProcInfo, ref waterMark, ref watermarkColor);
|
||||
}
|
||||
//ProcedureInfo myproc = pi;
|
||||
//frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumber, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location);
|
||||
//myproc.ChangeBarDate = myDTS;
|
||||
frmPDFStatusForm frm = new frmPDFStatusForm(pi, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location, pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts, true, "", false, 0, false,
|
||||
MyProcedures.Count > (MyProcedures[0].ProcInfo.MyDocVersion.Procedures.Count / 4), pi.MyDocVersion.DocVersionConfig.Print_DuplexBlankPageText, null, watermarkColor)
|
||||
{
|
||||
AllowAllWatermarks = true,
|
||||
CloseWhenDone = !ViewPDF,
|
||||
DocReplace = new Dictionary<int, byte[]>() // will hold the Word Attachments with resolved ROs
|
||||
}; // C2019-004: Allow user to define duplex lank page text at the docversion level
|
||||
MyProcedures.Count > (MyProcedures[0].ProcInfo.MyDocVersion.Procedures.Count / 4), pi.MyDocVersion.DocVersionConfig.Print_DuplexBlankPageText, null, watermarkColor); // C2019-004: Allow user to define duplex lank page text at the docversion level
|
||||
frm.AllowAllWatermarks = true;
|
||||
frm.CloseWhenDone = !ViewPDF;
|
||||
frm.DocReplace = new Dictionary<int, byte[]>(); // will hold the Word Attachments with resolved ROs
|
||||
frm.ShowDialog();
|
||||
//if (ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave > 0)
|
||||
//{
|
||||
// using (ProcedureInfo myproc = ProcedureInfo.GetItemAndChildrenByUnit(pi.ItemID, 0, ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave))
|
||||
// {
|
||||
// //frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumber, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location);
|
||||
// myproc.ChangeBarDate = myDTS;
|
||||
// frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location);
|
||||
// frm.AllowAllWatermarks = true;
|
||||
// frm.CloseWhenDone = !ViewPDF;
|
||||
// frm.ShowDialog();
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// using (ProcedureInfo myproc = ProcedureInfo.GetItemAndChildren(pi.ItemID))
|
||||
// {
|
||||
// //frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumber, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location);
|
||||
// myproc.ChangeBarDate = myDTS;
|
||||
// frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location);
|
||||
// frm.AllowAllWatermarks = true;
|
||||
// frm.CloseWhenDone = !ViewPDF;
|
||||
// frm.ShowDialog();
|
||||
// }
|
||||
//}
|
||||
FileInfo pdfFile = new FileInfo(pdfPath);
|
||||
FileStream fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||
byte[] buf = new byte[pdfFile.Length];
|
||||
@@ -1030,10 +1333,8 @@ namespace VEPROMS
|
||||
return false;
|
||||
}
|
||||
|
||||
dlgExportImport dlg = new dlgExportImport("Export", pi, MyFrmVEPROMS, (selectedSlave))
|
||||
{
|
||||
DocReplace = frm.DocReplace // this tells approval to prepare an export file with resolved transitions and ROs, word sections are saved with resolved ROs during approval PDF creation and saved in DocReplace
|
||||
}; // "true tell export to convert ROs and Transitions to text
|
||||
dlgExportImport dlg = new dlgExportImport("Export", pi, MyFrmVEPROMS, (selectedSlave)); // "true tell export to convert ROs and Transitions to text
|
||||
dlg.DocReplace = frm.DocReplace; // this tells approval to prepare an export file with resolved transitions and ROs, word sections are saved with resolved ROs during approval PDF creation and saved in DocReplace
|
||||
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
|
||||
dlg.ExportItem(xd, pi, "procedure");
|
||||
frm.DocReplace = dlg.DocReplace = null;
|
||||
@@ -1075,20 +1376,21 @@ namespace VEPROMS
|
||||
}
|
||||
else
|
||||
UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, myDTS, selectedSlave);
|
||||
//UpdateProcedureDTS(pi, DateTime.Now);
|
||||
pi.MyDocVersion.DocVersionConfig.SelectedSlave = selectedSlave;
|
||||
}
|
||||
// C2019-019: Put out a complete message when approval is done.
|
||||
// C2020-024 Display a more descriptive end message
|
||||
if (procsApproved.Count > 0)
|
||||
{
|
||||
string msg;
|
||||
string msg = "";
|
||||
if (procsApproved.Count == (MyProcedures[0]).ProcInfo.MyDocVersion.Procedures.Count)
|
||||
msg = "All Procedures were Approved.";
|
||||
else
|
||||
{
|
||||
msg = "The following procedures were approved:\n";
|
||||
foreach (string prc in procsApproved)
|
||||
msg += $"\n{prc}";
|
||||
msg += "\n" + prc;
|
||||
}
|
||||
FlexibleMessageBox.Show( msg, "Approve Procedure(s)", MessageBoxButtons.OK);
|
||||
}
|
||||
@@ -1132,7 +1434,7 @@ namespace VEPROMS
|
||||
{
|
||||
while (!(ex is System.Data.SqlClient.SqlException) && ex.InnerException != null)
|
||||
ex = ex.InnerException;
|
||||
MessageBox.Show(ex.Message +"\r\n\r\nApproval will continue without the Summary of Change Report", $"{ex.GetType().Name} while trying to create Summary of Changes.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
MessageBox.Show(ex.Message +"\r\n\r\nApproval will continue without the Summary of Change Report", ex.GetType().Name + " while trying to create Summary of Changes." , MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1154,7 +1456,7 @@ namespace VEPROMS
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine("Could not create");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine($"{pdfFile}.");
|
||||
sb.AppendLine(pdfFile + ".");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("If it is open, close it then press the OK button.");
|
||||
if (cntr >= 3) // after two tries offer additional troubleshooting information
|
||||
@@ -1169,9 +1471,18 @@ namespace VEPROMS
|
||||
return true;
|
||||
}
|
||||
|
||||
private void UpdateProcedureDTS(ProcedureInfo pi, DateTime dts)
|
||||
{
|
||||
using (Item itm = Item.Get(pi.ItemID))
|
||||
{
|
||||
itm.DTS = dts;
|
||||
itm.Save();
|
||||
}
|
||||
}
|
||||
private void UpdateProcedureConfig(ProcedureInfo procedureInfo, string revNumber, DateTime revDate, DateTime dts, int selectedSlave)
|
||||
{
|
||||
if (!(procedureInfo.MyConfig is ProcedureConfig pc)) return;
|
||||
ProcedureConfig pc = procedureInfo.MyConfig as ProcedureConfig;
|
||||
if (pc == null) return;
|
||||
|
||||
pc.SelectedSlave = selectedSlave;
|
||||
pc.Print_Rev = revNumber;
|
||||
@@ -1181,6 +1492,7 @@ namespace VEPROMS
|
||||
using (Item itm = Item.Get(procedureInfo.ItemID))
|
||||
{
|
||||
itm.MyContent.Config = pc.ToString();
|
||||
//itm.DTS = dts;
|
||||
itm.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
itm.Save();
|
||||
|
||||
@@ -1203,12 +1515,22 @@ namespace VEPROMS
|
||||
}
|
||||
public class RevType
|
||||
{
|
||||
public int TypeID { get; set; }
|
||||
public string TypeName { get; set; }
|
||||
private int _TypeID;
|
||||
public int TypeID
|
||||
{
|
||||
get { return _TypeID; }
|
||||
set { _TypeID = value; }
|
||||
}
|
||||
private string _TypeName;
|
||||
public string TypeName
|
||||
{
|
||||
get { return _TypeName; }
|
||||
set { _TypeName = value; }
|
||||
}
|
||||
public RevType(int i, string s)
|
||||
{
|
||||
TypeID = i;
|
||||
TypeName = s;
|
||||
_TypeID = i;
|
||||
_TypeName = s;
|
||||
}
|
||||
}
|
||||
public class RevTypes : List<RevType>
|
||||
@@ -1217,14 +1539,29 @@ namespace VEPROMS
|
||||
public delegate void DisplayConsistencyReportEvent(object sender, ConsistencyReportArgs args);
|
||||
public class ConsistencyReportArgs : EventArgs
|
||||
{
|
||||
public string ReportName { get; set; }
|
||||
public ItemInfoList MyItems { get; set; }
|
||||
public DocVersionInfo MyDocVersion { get; set; }
|
||||
private string _ReportName;
|
||||
public string ReportName
|
||||
{
|
||||
get { return _ReportName; }
|
||||
set { _ReportName = value; }
|
||||
}
|
||||
private ItemInfoList _MyItems;
|
||||
public ItemInfoList MyItems
|
||||
{
|
||||
get { return _MyItems; }
|
||||
set { _MyItems = value; }
|
||||
}
|
||||
private DocVersionInfo _MyDocVersion;
|
||||
public DocVersionInfo MyDocVersion
|
||||
{
|
||||
get { return _MyDocVersion; }
|
||||
set { _MyDocVersion = value; }
|
||||
}
|
||||
public ConsistencyReportArgs(string reportName, ItemInfoList myItems, DocVersionInfo myDocVerion)
|
||||
{
|
||||
ReportName = reportName;
|
||||
MyItems = myItems;
|
||||
MyDocVersion = myDocVerion; //B2020-020 needed to pass in DocVersion to get paper size from format
|
||||
_ReportName = reportName;
|
||||
_MyItems = myItems;
|
||||
_MyDocVersion = myDocVerion; //B2020-020 needed to pass in DocVersion to get paper size from format
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
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
|
||||
@@ -14,8 +21,8 @@ namespace VEPROMS
|
||||
|
||||
private void btnTabs_Click(object sender, EventArgs e)
|
||||
{
|
||||
Remember = cbRemember.Checked;
|
||||
Close();
|
||||
Remember = this.cbRemember.Checked;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
@@ -19,22 +23,36 @@ namespace VEPROMS
|
||||
_MySessionInfo = SessionInfo.Get(_MyOwnerInfo.SessionID);
|
||||
_MyUserInfo = ui;
|
||||
}
|
||||
private readonly ProcedureInfo _MyProcedureInfo;
|
||||
public ProcedureInfo MyProcedureInfo => _MyProcedureInfo;
|
||||
private readonly SectionInfo _MySectionInfo;
|
||||
public SectionInfo MySectionInfo => _MySectionInfo;
|
||||
private readonly OwnerInfo _MyOwnerInfo;
|
||||
public OwnerInfo MyOwnerInfo => _MyOwnerInfo;
|
||||
private readonly SessionInfo _MySessionInfo;
|
||||
public SessionInfo MySessionInfo => _MySessionInfo;
|
||||
private readonly UserInfo _MyUserInfo;
|
||||
public UserInfo MyUserInfo => _MyUserInfo;
|
||||
|
||||
private ProcedureInfo _MyProcedureInfo;
|
||||
public ProcedureInfo MyProcedureInfo
|
||||
{
|
||||
get { return _MyProcedureInfo; }
|
||||
}
|
||||
private SectionInfo _MySectionInfo;
|
||||
public SectionInfo MySectionInfo
|
||||
{
|
||||
get { return _MySectionInfo; }
|
||||
}
|
||||
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)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (MyProcedureInfo != null)
|
||||
if (MyProcedureInfo != null)
|
||||
sb.AppendLine(string.Format("The procedure {0} - {1}", MyProcedureInfo.DisplayNumber, MyProcedureInfo.DisplayText));
|
||||
else
|
||||
sb.AppendLine(string.Format("The document {0}", MySectionInfo.DisplayText));
|
||||
@@ -56,8 +74,7 @@ namespace VEPROMS
|
||||
|
||||
private void btnForce_Click(object sender, EventArgs e)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
MySessionInfo.CheckInItem(MyOwnerInfo.OwnerID);
|
||||
MySessionInfo.CheckInItem(MyOwnerInfo.OwnerID);
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("Forced Check In has been completed");
|
||||
lblInfo.Text = sb.ToString();
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Controls.Library;
|
||||
using Volian.Base.Library;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
@@ -18,9 +20,14 @@ namespace VEPROMS
|
||||
{
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
public frmVEPROMS MyFrmVEPROMS { get; set; } = null;
|
||||
private bool _ConvertROsToTextDuringImport = false;
|
||||
#endregion
|
||||
frmVEPROMS _MyFrmVEPROMS = null;// Save frmVEPROMS for Import to shutoff SessionPing
|
||||
public frmVEPROMS MyFrmVEPROMS
|
||||
{
|
||||
get { return _MyFrmVEPROMS; }
|
||||
set { _MyFrmVEPROMS = value; }
|
||||
}
|
||||
private bool _ConvertROsToTextDuringImport = false;
|
||||
private bool _ConvertROsAndTransitionsToText = false; // set to true when Approval creates an Export file
|
||||
protected bool _ExportBothConvertedandNot = false; // set to true when Electronic Procedure export
|
||||
|
||||
@@ -33,18 +40,32 @@ namespace VEPROMS
|
||||
//this will hold if a specific unit was selected
|
||||
readonly protected int _UnitIndex;
|
||||
|
||||
public ItemInfo ExternalTransitionItem { get; set; } = null;
|
||||
private Dictionary<int, int> floatFoldout;
|
||||
private ItemInfo _ExternalTransitionItem = null;
|
||||
public ItemInfo ExternalTransitionItem
|
||||
{
|
||||
get { return _ExternalTransitionItem; }
|
||||
set { _ExternalTransitionItem = value; }
|
||||
}
|
||||
private Dictionary<int, int> floatFoldout;
|
||||
private Dictionary<int, string> importedFormat;
|
||||
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 newRODbID;
|
||||
private FolderInfo _MyNewFolder;
|
||||
public FolderInfo MyNewFolder => _MyNewFolder;
|
||||
|
||||
public ProcedureInfo MyNewProcedure { get; set; }
|
||||
private string PEIPath;
|
||||
private readonly string _MyMode;
|
||||
public FolderInfo MyNewFolder
|
||||
{
|
||||
get { return _MyNewFolder; }
|
||||
}
|
||||
private ProcedureInfo _MyNewProcedure;
|
||||
public ProcedureInfo MyNewProcedure
|
||||
{
|
||||
get { return _MyNewProcedure; }
|
||||
set { _MyNewProcedure = value; }
|
||||
}
|
||||
private string PEIPath;
|
||||
private string _MyMode;
|
||||
protected FolderInfo MyFolder = null;
|
||||
protected DocVersionInfo MyDocVersion = null;
|
||||
protected ProcedureInfo MyProcedure = null;
|
||||
@@ -60,7 +81,7 @@ namespace VEPROMS
|
||||
_MyMode = mode;
|
||||
MyFolder = folderInfo;
|
||||
InitializeComponent();
|
||||
Text = $"{mode} Dialog for {folderInfo.Name}";
|
||||
this.Text = mode + " Dialog for " + folderInfo.Name;
|
||||
_UnitIndex = unitIndex;
|
||||
|
||||
if (_UnitIndex > 0)
|
||||
@@ -82,9 +103,9 @@ namespace VEPROMS
|
||||
MyDocVersion = docVersionInfo;
|
||||
InitializeComponent();
|
||||
if (mode.ToUpper().Contains("FORMAT"))
|
||||
Text = mode;
|
||||
this.Text = mode;
|
||||
else
|
||||
Text = $"{mode} Dialog for {docVersionInfo.Name} of {docVersionInfo.MyFolder.Name}";
|
||||
this.Text = mode + " Dialog for " + docVersionInfo.Name + " of " + docVersionInfo.MyFolder.Name;
|
||||
_UnitIndex = unitIndex;
|
||||
|
||||
if (_UnitIndex > 0)
|
||||
@@ -103,7 +124,7 @@ namespace VEPROMS
|
||||
_MyMode = mode;
|
||||
MyProcedure = procedureInfo;
|
||||
InitializeComponent();
|
||||
Text = $"{mode} Dialog for {procedureInfo.DisplayNumber}";
|
||||
this.Text = mode + " Dialog for " + procedureInfo.DisplayNumber;
|
||||
_UnitIndex = unitIndex;
|
||||
|
||||
if (_UnitIndex > 0)
|
||||
@@ -152,7 +173,7 @@ namespace VEPROMS
|
||||
ofd.InitialDirectory = PEIPath;
|
||||
pnlImport.BringToFront();
|
||||
}
|
||||
Height /= formsize;
|
||||
this.Height = this.Height / formsize;
|
||||
}
|
||||
private void btnExport_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -199,19 +220,19 @@ namespace VEPROMS
|
||||
string msg = "Finished Exporting:\n\n";
|
||||
if (_MyMode.ToUpper().Contains("FORMAT"))
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
MyStart = DateTime.Now;
|
||||
btnDoExport.Enabled = false;
|
||||
lblExportStatus.Text = "Performing Export of UC Formats";
|
||||
SaveExportUCF();
|
||||
|
||||
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
||||
lblExportStatus.Text = $"Format Export Completed in {elapsed}";
|
||||
Cursor = Cursors.Default;
|
||||
lblExportStatus.Text = "Format Export Completed in " + elapsed.ToString();
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
else if (MyFolder != null)
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
MyStart = DateTime.Now;
|
||||
btnDoExport.Enabled = false;
|
||||
lblExportStatus.Text = "Performing Export";
|
||||
@@ -219,7 +240,7 @@ namespace VEPROMS
|
||||
|
||||
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
||||
lblExportStatus.Text = "Export Completed in " + elapsed.ToString();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
msg += MyFolder.Name;
|
||||
}
|
||||
else if (MyProcedure != null)
|
||||
@@ -260,7 +281,7 @@ namespace VEPROMS
|
||||
|
||||
}
|
||||
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
MyStart = DateTime.Now;
|
||||
btnDoExport.Enabled = false;
|
||||
lblExportStatus.Text = "Performing Export";
|
||||
@@ -273,7 +294,7 @@ namespace VEPROMS
|
||||
xd.Save(fileLocation);
|
||||
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
||||
lblExportStatus.Text = "Export Completed in " + elapsed.ToString();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
// added message to user when export of a procedure or procedure set has completed
|
||||
if (successfullExport)
|
||||
@@ -317,7 +338,7 @@ namespace VEPROMS
|
||||
bool isImported = false;
|
||||
bool canceledPressed = false;
|
||||
btnImport.Enabled = false;
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
MyStart = DateTime.Now;
|
||||
btnDoImport.Enabled = false;
|
||||
lblImportStatus.Text = "Performing Import";
|
||||
@@ -329,13 +350,13 @@ namespace VEPROMS
|
||||
{
|
||||
TurnChangeManagerOff.Execute();
|
||||
MyFrmVEPROMS.DisablePing = true;// Turn-off SessionPing
|
||||
bool result = TryToImportUCFs(ref isImported);
|
||||
bool result = TryToImportUCFs(ref isImported, ref canceledPressed);
|
||||
MyFrmVEPROMS.DisablePing = false;// Turn-on SessionPing
|
||||
TurnChangeManagerOn.Execute();
|
||||
if (!result) // B2019-006: let user know there was an error during import:
|
||||
{
|
||||
MessageBox.Show("Error occurred during import. Format(s) not imported.");
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
btnCloseImport.Enabled = true;
|
||||
return;
|
||||
}
|
||||
@@ -379,7 +400,7 @@ namespace VEPROMS
|
||||
if (isImported)
|
||||
{
|
||||
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
|
||||
lblImportStatus.Text = $"Import Completed in {elapsed}";
|
||||
lblImportStatus.Text = "Import Completed in " + elapsed.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -387,7 +408,7 @@ namespace VEPROMS
|
||||
btnDoImport.Enabled = true;
|
||||
}
|
||||
}
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
btnCloseImport.Enabled = true;
|
||||
if (isImported)
|
||||
{
|
||||
@@ -415,7 +436,7 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryToImportUCFs(ref bool isImported)
|
||||
private bool TryToImportUCFs(ref bool isImported, ref bool canceledPressed)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -429,7 +450,7 @@ namespace VEPROMS
|
||||
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);
|
||||
Close();
|
||||
this.Close();
|
||||
isImported = false;
|
||||
return false;
|
||||
}
|
||||
@@ -483,7 +504,7 @@ namespace VEPROMS
|
||||
{
|
||||
MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||
_MyLog.Warn("Failed during UC Formats Import", ex);
|
||||
Close();
|
||||
this.Close();
|
||||
isImported = false;
|
||||
return false;
|
||||
}
|
||||
@@ -498,7 +519,7 @@ namespace VEPROMS
|
||||
{
|
||||
MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||||
_MyLog.Warn("Failed during Procedure Import", ex);
|
||||
Close();
|
||||
this.Close();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -507,9 +528,11 @@ namespace VEPROMS
|
||||
private bool _ImportingApprovedExportFile = false;
|
||||
private bool ImportingApprovedExport(string fnAndPath)
|
||||
{
|
||||
int idx = fnAndPath.LastIndexOf("//") + 1;
|
||||
bool rtnval = false;
|
||||
int idx = fnAndPath.LastIndexOf("//") + 1;
|
||||
string tmp = fnAndPath.Substring(idx);
|
||||
return tmp.ToUpper().Contains("APPROVED_REV_");
|
||||
rtnval = tmp.ToUpper().Contains("APPROVED_REV_");
|
||||
return rtnval;
|
||||
}
|
||||
private bool ImportProcedure(ref bool isImported, ref bool canceledPressed)
|
||||
{
|
||||
@@ -521,17 +544,15 @@ namespace VEPROMS
|
||||
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);
|
||||
Cursor = Cursors.Default;
|
||||
btnImport.Enabled = true; // allow user to select a different export file to import
|
||||
btnCloseImport.Enabled = true; // allow user to close import dialog
|
||||
this.Cursor = Cursors.Default;
|
||||
this.btnImport.Enabled = true; // allow user to select a different export file to import
|
||||
this.btnCloseImport.Enabled = true; // allow user to close import dialog
|
||||
return false;
|
||||
}
|
||||
string rofolderpath = xd.DocumentElement.Attributes.GetNamedItem("rofolderpath").InnerText;
|
||||
int rodbid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rodbid").InnerText);
|
||||
#pragma warning disable IDE0059 // Unnecessary assignment of a value - rofstid for Debugging/future use
|
||||
int rofstid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rofstid").InnerText);
|
||||
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||
if (MyDocVersion.DocVersionAssociationCount > 0)
|
||||
int rofstid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rofstid").InnerText);
|
||||
if (MyDocVersion.DocVersionAssociationCount > 0)
|
||||
{
|
||||
// use current ROPath
|
||||
MyRODb = RODb.GetJustRoDb(MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID);
|
||||
@@ -539,17 +560,15 @@ namespace VEPROMS
|
||||
// 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
|
||||
{
|
||||
dlgImpHowToHandleROs dlg = new dlgImpHowToHandleROs
|
||||
{
|
||||
ImportedROFolder = rofolderpath,
|
||||
WorkingDraftROFolder = MyRODb.FolderPath
|
||||
};
|
||||
dlg.ShowDialog(this);
|
||||
dlgImpHowToHandleROs dlg = new dlgImpHowToHandleROs();
|
||||
dlg.ImportedROFolder = rofolderpath;
|
||||
dlg.WorkingDraftROFolder = MyRODb.FolderPath;
|
||||
dlg.ShowDialog(this);
|
||||
if (dlg.CancelImport)
|
||||
{
|
||||
Cursor = Cursors.Default;
|
||||
btnImport.Enabled = true; // allow user to select a different export file to import
|
||||
btnDoImport.Enabled = true; // allow user to change mind and perform the import
|
||||
this.Cursor = Cursors.Default;
|
||||
this.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
|
||||
return false; // Return False to Indicate that the Import did not succeed
|
||||
}
|
||||
_ConvertROsToTextDuringImport = dlg.ConvertROsToText;
|
||||
@@ -593,18 +612,16 @@ namespace VEPROMS
|
||||
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.");
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
return false;// Return False to Indicate that the Import did not succeed
|
||||
}
|
||||
else
|
||||
{
|
||||
Cursor = Cursors.Default;
|
||||
dlgPickROFolder dlg = new dlgPickROFolder
|
||||
{
|
||||
ImportedROFolder = rofolderpath,
|
||||
LocalROFolders = localROPaths
|
||||
};
|
||||
dlg.ShowDialog(this);
|
||||
this.Cursor = Cursors.Default;
|
||||
dlgPickROFolder dlg = new dlgPickROFolder();
|
||||
dlg.ImportedROFolder = rofolderpath;
|
||||
dlg.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
|
||||
{
|
||||
MyRODb = RODb.GetByFolderPath(dlg.SelectedROFolder);
|
||||
@@ -628,7 +645,7 @@ namespace VEPROMS
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Since you did not pick an existing RO folder defined for this database, the import process will terminate.");
|
||||
Close();// Close the Import Window
|
||||
this.Close();// Close the Import Window
|
||||
return false;// Return False to Indicate that the Import did not succeed
|
||||
}
|
||||
}
|
||||
@@ -638,9 +655,9 @@ namespace VEPROMS
|
||||
bool didImp = LoadFormats(xd, "procedure/formats/format");
|
||||
if (!didImp)
|
||||
{
|
||||
Cursor = Cursors.Default;
|
||||
btnImport.Enabled = true; // allow user to select a different export file to import
|
||||
btnDoImport.Enabled = true; // allow user to change mind and perform the import
|
||||
this.Cursor = Cursors.Default;
|
||||
this.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
|
||||
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
|
||||
@@ -746,7 +763,7 @@ namespace VEPROMS
|
||||
ProcedureInfo lastProcedure = null;
|
||||
foreach (ProcedureInfo pi in MyDocVersion.Procedures.OfType<ProcedureInfo>())
|
||||
lastProcedure = pi;
|
||||
MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||
_MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||
//update transitions
|
||||
AddTransitions(PendingTransitions);
|
||||
PendingTransitions.Save(fn);
|
||||
@@ -786,7 +803,7 @@ namespace VEPROMS
|
||||
}
|
||||
xd.SelectSingleNode("procedure/content/@number").InnerText = string.Format("Copy({0}) of {1}", count.ToString(), number);
|
||||
//add imported procedure and copy count
|
||||
MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||
_MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||
//update transitions
|
||||
AddTransitions(PendingTransitions);
|
||||
FixFloatingFoldouts();
|
||||
@@ -844,7 +861,7 @@ namespace VEPROMS
|
||||
return false;
|
||||
}
|
||||
//add imported procedure
|
||||
MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||
_MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure);
|
||||
//update transitions
|
||||
AddTransitions(PendingTransitions);
|
||||
FixFloatingFoldouts();
|
||||
@@ -867,9 +884,9 @@ namespace VEPROMS
|
||||
bool didImp = LoadFormats(xd, "folder/formats/format");
|
||||
if (!didImp)
|
||||
{
|
||||
Cursor = Cursors.Default;
|
||||
btnImport.Enabled = true; // allow user to select a different export file to import
|
||||
btnDoImport.Enabled = true; // allow user to change mind and perform the import
|
||||
this.Cursor = Cursors.Default;
|
||||
this.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
|
||||
return false; // Return False to Indicate that the Import did not succeed
|
||||
}
|
||||
string name = xd.DocumentElement.Attributes.GetNamedItem("name").InnerText;
|
||||
@@ -987,8 +1004,7 @@ namespace VEPROMS
|
||||
c.Save();
|
||||
}
|
||||
}
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
Dictionary<string, string> existingCopyFCName = new Dictionary<string, string>();
|
||||
Dictionary<string, string> existingCopyFCName = new Dictionary<string, string>();
|
||||
// note that this is used when importing a folder or a procedure (procedure was added for UCF changes)
|
||||
private bool LoadFormats(XmlDocument xd, string xmlpath)
|
||||
{
|
||||
@@ -999,20 +1015,21 @@ namespace VEPROMS
|
||||
|
||||
importedFormat = new Dictionary<int, string>();
|
||||
XmlNodeList nl = xd.SelectNodes(xmlpath);
|
||||
|
||||
bool conflictingUCFdata = false;
|
||||
List<string> existingFC = new List<string>();
|
||||
List<string> importedFC = new List<string>();
|
||||
List<string> fname = new List<string>();
|
||||
|
||||
foreach (XmlNode nd in nl)
|
||||
{
|
||||
// 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
|
||||
// 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.
|
||||
#pragma warning disable IDE0059 // Unnecessary assignment of a value - formatid for Debugging/future use
|
||||
int formatid = int.Parse(nd.Attributes.GetNamedItem("formatid").InnerText);
|
||||
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||
string name = nd.Attributes.GetNamedItem("name").InnerText;
|
||||
string copyOfUCF = null;
|
||||
// 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
|
||||
// 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.
|
||||
int formatid = int.Parse(nd.Attributes.GetNamedItem("formatid").InnerText);
|
||||
string name = nd.Attributes.GetNamedItem("name").InnerText;
|
||||
string config = null;
|
||||
XmlNode cfg = nd.Attributes.GetNamedItem("config");
|
||||
if (cfg != null) config = cfg.InnerText;
|
||||
@@ -1021,10 +1038,10 @@ namespace VEPROMS
|
||||
FormatInfo exFI = FormatInfo.Get(existingFormat[name]);
|
||||
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
|
||||
// use it before stating there is conflicting data.
|
||||
string copyOfUCF = ContentsOfUCFExists(name, config);
|
||||
if (copyOfUCF == null)
|
||||
// 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.
|
||||
copyOfUCF = ContentsOfUCFExists(name, config);
|
||||
if (copyOfUCF == null)
|
||||
{
|
||||
existingFC.Add(exFI.Config);
|
||||
importedFC.Add(config);
|
||||
@@ -1052,16 +1069,15 @@ namespace VEPROMS
|
||||
if (pnameAttrib != null)
|
||||
pname = pnameAttrib.InnerText;
|
||||
if (pname == null) continue;
|
||||
XmlNode descript = nd.Attributes.GetNamedItem("description");
|
||||
#pragma warning disable IDE0059 // Unnecessary assignment of a value - description, userid, dts for future use
|
||||
string description = descript?.InnerText;
|
||||
string userid = nd.Attributes.GetNamedItem("userid").InnerText;
|
||||
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
|
||||
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||
// If the format that is being imported exists as a copy (already was imported and a 'Copy x of name' was created) and the imported and
|
||||
// existing config match, use the existing (copied) format's name rather than importing it again (the dictionary was set up during
|
||||
// the import formats process.
|
||||
if (existingCopyFCName.ContainsKey(name)) name = existingCopyFCName[name];
|
||||
string description = null;
|
||||
XmlNode descript = nd.Attributes.GetNamedItem("description");
|
||||
if (descript != null) description = descript.InnerText;
|
||||
string userid = nd.Attributes.GetNamedItem("userid").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
|
||||
// existing config match, use the existing (copied) format's name rather than importing it again (the dictionary was set up during
|
||||
// the import formats process.
|
||||
if (existingCopyFCName.ContainsKey(name)) name = existingCopyFCName[name];
|
||||
|
||||
// compare this imported format to the original in the database.
|
||||
// If format name exists, or if it has same config data, just use it.
|
||||
@@ -1082,11 +1098,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).
|
||||
if (!existingFormat.ContainsKey(pname)) break;
|
||||
int pid = existingFormat[pname];
|
||||
_ = Format.Get(pid);
|
||||
Format pformat = Format.Get(pid);
|
||||
|
||||
// if the new format doesn't exist, it will be added (after these other checks). Otherwise, handle the
|
||||
// various cases listed above:
|
||||
if (existingFormat.ContainsKey(name))
|
||||
// if the new format doesn't exist, it will be added (after these other checks). Otherwise, handle the
|
||||
// various cases listed above:
|
||||
if (existingFormat.ContainsKey(name))
|
||||
{
|
||||
|
||||
|
||||
@@ -1205,6 +1221,7 @@ namespace VEPROMS
|
||||
{
|
||||
int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText);
|
||||
int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText);
|
||||
//if (!Old2NewContent.ContainsKey(oldid))
|
||||
Old2NewLibDoc.Add(oldid, newid);
|
||||
}
|
||||
File.Delete(fn);
|
||||
@@ -1345,8 +1362,8 @@ namespace VEPROMS
|
||||
}
|
||||
private void ExportFormats(FormatInfoList fil, XmlElement xn, string nodename, bool doElement)
|
||||
{
|
||||
XmlElement xe;
|
||||
if (doElement) xe = xn.OwnerDocument.CreateElement(nodename);
|
||||
XmlElement xe = null;
|
||||
if (doElement) xe = xn.OwnerDocument.CreateElement(nodename);
|
||||
else xe = xn;
|
||||
foreach (FormatInfo fi in fil)
|
||||
ExportFormat(xe, fi, "format");
|
||||
@@ -1472,7 +1489,7 @@ namespace VEPROMS
|
||||
{
|
||||
pbExportProcedure.Value = 0;
|
||||
pbExportProcedure.Maximum = dvi.Procedures.Count;
|
||||
lblExportProcedure.Text = $"{pbExportProcedure.Maximum} Procedures";
|
||||
lblExportProcedure.Text = pbExportProcedure.Maximum.ToString() + " Procedures";
|
||||
foreach (ItemInfo ii in dvi.Procedures)
|
||||
{
|
||||
XmlDocument xd = new XmlDocument();
|
||||
@@ -1624,14 +1641,14 @@ namespace VEPROMS
|
||||
|
||||
private void ExportItem(XmlElement xn, ItemInfo ii, string nodename)
|
||||
{
|
||||
/*
|
||||
/*
|
||||
ItemID
|
||||
PreviousID
|
||||
ContentID
|
||||
DTS
|
||||
*/
|
||||
XmlElement xe;
|
||||
if (xn.Name == "procedure")
|
||||
XmlElement xe = null;
|
||||
if (xn.Name == "procedure")
|
||||
xe = xn;
|
||||
else
|
||||
{
|
||||
@@ -2417,9 +2434,12 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
private void AddTransitions() => AddTransitions(PendingTransitions);
|
||||
private void AddTransitions()
|
||||
{
|
||||
AddTransitions(PendingTransitions);
|
||||
}
|
||||
|
||||
private void AddTransitions(XmlDocument xd)
|
||||
private void AddTransitions(XmlDocument xd)
|
||||
{
|
||||
/*
|
||||
Content
|
||||
@@ -2439,7 +2459,7 @@ namespace VEPROMS
|
||||
type,id,toid,rangeid
|
||||
*/
|
||||
XmlNodeList nl = xd.SelectNodes("//transition");
|
||||
lblImportStatus.Text = $"Updating {nl.Count} Tranistions";
|
||||
lblImportStatus.Text = string.Format("Updating {0} Tranistions", nl.Count.ToString());
|
||||
|
||||
foreach (XmlNode nd in nl)
|
||||
{
|
||||
@@ -2502,8 +2522,9 @@ namespace VEPROMS
|
||||
}
|
||||
else //transition to existing itemid (external)
|
||||
{
|
||||
int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText);
|
||||
int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText);
|
||||
bool forceConvertToText = false;
|
||||
int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText);
|
||||
int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText);
|
||||
string config = nd.Attributes.GetNamedItem("config").InnerText;
|
||||
string userid = nd.Attributes.GetNamedItem("userid").InnerText;
|
||||
DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText);
|
||||
@@ -2517,44 +2538,43 @@ namespace VEPROMS
|
||||
fromid = Old2NewContent[fromid];
|
||||
Content cc = Content.Get(fromid);
|
||||
Transition tt = Transition.MakeTransition(cc, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid);
|
||||
|
||||
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
|
||||
cc.Save();
|
||||
nd.InnerText = "done";
|
||||
}
|
||||
else
|
||||
{
|
||||
transitionid = tt.TransitionID;
|
||||
string replacewith;
|
||||
|
||||
if (isrange == 0)
|
||||
replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid);
|
||||
else
|
||||
replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid);
|
||||
|
||||
cc.Text = cc.Text.Replace(lookfor, replacewith);
|
||||
|
||||
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
|
||||
cc.Save();
|
||||
nd.InnerText = "done";
|
||||
}
|
||||
else
|
||||
{
|
||||
transitionid = tt.TransitionID;
|
||||
string replacewith;
|
||||
if (cc.MyGrid != null && !string.IsNullOrEmpty(cc.MyGrid.Data))
|
||||
{
|
||||
cc.MyGrid.Data = cc.MyGrid.Data.Replace(lookfor, replacewith);
|
||||
}
|
||||
|
||||
if (isrange == 0)
|
||||
replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid);
|
||||
else
|
||||
replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid);
|
||||
|
||||
cc.Text = cc.Text.Replace(lookfor, replacewith);
|
||||
|
||||
if (cc.MyGrid != null && !string.IsNullOrEmpty(cc.MyGrid.Data))
|
||||
{
|
||||
cc.MyGrid.Data = cc.MyGrid.Data.Replace(lookfor, replacewith);
|
||||
}
|
||||
|
||||
// B2016-176, B2016-197 - external transitions should be converted to text
|
||||
forceConvertToText = true;
|
||||
_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.
|
||||
// done here because FixTransitionText() could update the transitions in the grid
|
||||
if (cc.MyGrid != null && cc.MyGrid.Data != "")
|
||||
cc.MyGrid.Save();
|
||||
cc.Save();
|
||||
nd.InnerText = "done";
|
||||
_DidConvertTransitionsToText |= (forceConvertToText && _DidProcessTransitions); // B2016-225 - notify user when transitions are converted to text
|
||||
}
|
||||
}
|
||||
// B2016-176, B2016-197 - external transitions should be converted to text
|
||||
forceConvertToText = true;
|
||||
_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.
|
||||
// done here because FixTransitionText() could update the transitions in the grid
|
||||
if (cc.MyGrid != null && cc.MyGrid.Data != "")
|
||||
cc.MyGrid.Save();
|
||||
cc.Save();
|
||||
nd.InnerText = "done";
|
||||
_DidConvertTransitionsToText |= (forceConvertToText && _DidProcessTransitions); // B2016-225 - notify user when transitions are converted to text
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2600,6 +2620,7 @@ namespace VEPROMS
|
||||
if (formatID >= importedFormat.Count) return null; // formatID not found, use default file name
|
||||
formatName = importedFormat[formatID]; // for backwards compatibility with older export files
|
||||
}
|
||||
if (renamedUCFFormatName != null && renamedUCFFormatName.ContainsKey(formatFileName)) formatName = renamedUCFFormatName[formatName];
|
||||
formatID = existingFormat[formatName];
|
||||
return Format.Get(formatID);
|
||||
}
|
||||
@@ -2647,11 +2668,9 @@ namespace VEPROMS
|
||||
MyRODb = AddRODb(xrodb);
|
||||
ROFst rofst = AddROFst(xrofst);
|
||||
|
||||
#pragma warning disable IDE0059 // Unnecessary assignment of a value - dva kept for side effect code
|
||||
DocVersionAssociation dva = dv.DocVersionAssociations.Add(rofst);
|
||||
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||
DocVersionAssociation dva = dv.DocVersionAssociations.Add(rofst);
|
||||
|
||||
dv.Save();
|
||||
dv.Save();
|
||||
}
|
||||
|
||||
return DocVersionInfo.Get(dv.VersionID);
|
||||
@@ -2886,11 +2905,9 @@ namespace VEPROMS
|
||||
foreach (XmlNode nd in xn.SelectNodes("rousage"))
|
||||
{
|
||||
string rousageid = nd.Attributes.GetNamedItem("rousageid").InnerText;
|
||||
#pragma warning disable IDE0059 // Unnecessary assignment of a value - roid for Debugging/future use
|
||||
string roid = nd.Attributes.GetNamedItem("roid").InnerText;
|
||||
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||
string roid = nd.Attributes.GetNamedItem("roid").InnerText;
|
||||
|
||||
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.Save();
|
||||
MatchCollection ms = Regex.Matches(content.Text, findLink);
|
||||
@@ -2926,7 +2943,7 @@ namespace VEPROMS
|
||||
if (prefix == @"\v ")
|
||||
part1 = part1.Substring(0, part1.Length - 3);
|
||||
else
|
||||
part1 = $"{part1.Substring(0, part1.Length - 3)} ";
|
||||
part1 = part1.Substring(0, part1.Length - 3) + " ";
|
||||
//modify part3 based on suffix
|
||||
if (suffix == @"\v0 ")
|
||||
part3 = part3.Substring(4);
|
||||
@@ -3097,10 +3114,8 @@ namespace VEPROMS
|
||||
{
|
||||
foreach (XmlNode nd in xn.SelectNodes("annotation"))
|
||||
{
|
||||
#pragma warning disable IDE0059 // Unnecessary assignment of a value - typeid for debugging/future use
|
||||
int typeid = int.Parse(nd.Attributes.GetNamedItem("typeid").InnerText);
|
||||
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||
string rtftext = nd.Attributes.GetNamedItem("rtftext").InnerText;
|
||||
int typeid = int.Parse(nd.Attributes.GetNamedItem("typeid").InnerText);
|
||||
string rtftext = nd.Attributes.GetNamedItem("rtftext").InnerText;
|
||||
string searchtext = nd.Attributes.GetNamedItem("searchtext").InnerText;
|
||||
string config = nd.Attributes.GetNamedItem("config").InnerText;
|
||||
string userid = nd.Attributes.GetNamedItem("userid").InnerText;
|
||||
@@ -3835,7 +3850,7 @@ namespace VEPROMS
|
||||
if (d == null)
|
||||
{
|
||||
// B2019-035 better memory management. Prior logic would eat up memory (and not free it).
|
||||
string libkey = $"{libtitle}_{dts}";
|
||||
string libkey = libtitle + "_" + dts.ToString();
|
||||
if (ExistingLibDocs.ContainsKey(libkey))
|
||||
d = Document.Get(ExistingLibDocs[libkey]); // found library document in existing database
|
||||
}
|
||||
@@ -3848,7 +3863,7 @@ namespace VEPROMS
|
||||
string config = xn.Attributes.GetNamedItem("config").InnerText;
|
||||
string userid = xn.Attributes.GetNamedItem("userid").InnerText;
|
||||
string fileextension = xn.Attributes.GetNamedItem("fileextension").InnerText;
|
||||
if (libtitle != "") libtitle = $"{libtitle}_{dts}"; // if a lib document, append the date/time to the title incase there are duplicate titles
|
||||
if (libtitle != "") libtitle = libtitle + "_" + dts.ToString(); // 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.Save();
|
||||
Old2NewLibDoc.Add(docid, d.DocID);
|
||||
@@ -3858,14 +3873,20 @@ namespace VEPROMS
|
||||
|
||||
return d;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
private void btnCloseExport_Click(object sender, EventArgs e) => Close();
|
||||
private void btnCloseExport_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnCloseImport_Click(object sender, EventArgs e) => Close();
|
||||
private void btnCloseImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
//unset the unit (SelectedSlave)
|
||||
private void RemoveUnit_OnClose(object sender, EventArgs e)
|
||||
//unset the unit (SelectedSlave)
|
||||
private void RemoveUnit_OnClose(object sender, EventArgs e)
|
||||
{
|
||||
if (MyProcedure != null)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace VEPROMS
|
||||
private readonly AnnotationTypeInfo _AnnotationType;
|
||||
private readonly string multiseparator = ",";
|
||||
|
||||
private static readonly Regex _ROAccPageTokenPattern = new Regex("[<][^<>-]+-[^<>]+[>]");
|
||||
private static Regex _ROAccPageTokenPattern = new Regex("[<][^<>-]+-[^<>]+[>]");
|
||||
|
||||
public dlgExportImportEP(string mode, FolderInfo folderInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex = 0) : base(mode, folderInfo, myFrmVEPROMS, ( unitIndex))
|
||||
{
|
||||
@@ -261,8 +261,10 @@ namespace VEPROMS
|
||||
{
|
||||
string rodbpath = rodb.FolderPath;
|
||||
|
||||
string rocval = roc.value ?? Array.Find(roc.children, x => x.value.Contains('.')).value;
|
||||
if (rocval == null) return "";
|
||||
string rocval = roc.value;
|
||||
if (rocval == null) rocval = Array.Find(roc.children, x => x.value.Contains('.')).value;
|
||||
|
||||
if (rocval == null) return "";
|
||||
string imgname;
|
||||
if (isMulti)
|
||||
{
|
||||
|
||||
@@ -1,23 +1,54 @@
|
||||
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;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
public partial class dlgImpHowToHandleROs : Form
|
||||
{
|
||||
public string ImportedROFolder { get; set; }
|
||||
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
|
||||
public bool CancelImport => _CancelImport;
|
||||
private bool _ConvertROsToText = false;
|
||||
public bool ConvertROsToText => _ConvertROsToText;
|
||||
public dlgImpHowToHandleROs() => InitializeComponent();
|
||||
private string _ImportedROFolder;
|
||||
public string ImportedROFolder
|
||||
{
|
||||
get { return _ImportedROFolder; }
|
||||
set { _ImportedROFolder = value; }
|
||||
}
|
||||
private string _WorkingDraftROFolder;
|
||||
public string WorkingDraftROFolder
|
||||
{
|
||||
get { return _WorkingDraftROFolder; }
|
||||
set { _WorkingDraftROFolder = value; }
|
||||
}
|
||||
private bool _CancelImport = true; // default to truen in case the dialog is closed with the red X in the upper right corner
|
||||
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) => 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 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);
|
||||
}
|
||||
|
||||
private void btnUseCurrentROs_Click(object sender, EventArgs e) => _ConvertROsToText = _CancelImport = false;
|
||||
private void btnUseCurrentROs_Click(object sender, EventArgs e)
|
||||
{
|
||||
_ConvertROsToText = _CancelImport = false;
|
||||
}
|
||||
|
||||
private void btnROsToText_Click(object sender, EventArgs e)
|
||||
private void btnROsToText_Click(object sender, EventArgs e)
|
||||
{
|
||||
_CancelImport = false;
|
||||
_ConvertROsToText = true;
|
||||
@@ -29,6 +60,9 @@ namespace VEPROMS
|
||||
_ConvertROsToText = false;
|
||||
}
|
||||
|
||||
private void dlgImpHowToHandleROs_Resize(object sender, EventArgs e) => rtbROPathInfo.Refresh();
|
||||
}
|
||||
private void dlgImpHowToHandleROs_Resize(object sender, EventArgs e)
|
||||
{
|
||||
rtbROPathInfo.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
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 VEPROMS.CSLA.Library;
|
||||
using Volian.Base.Library;
|
||||
@@ -31,7 +38,7 @@ namespace VEPROMS
|
||||
usersettings.SetUserSetting_MSWord_Summary_Prompt(false);
|
||||
}
|
||||
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Base.Library;
|
||||
using Volian.Controls.Library;
|
||||
using System.Linq;
|
||||
|
||||
@@ -21,8 +26,11 @@ namespace VEPROMS
|
||||
private List<MembershipInfo> myMembershipInfoList;
|
||||
private Folder myFolder;
|
||||
|
||||
public dlgManageSecurity() => InitializeComponent();
|
||||
private void dlgManageSecurity_Load(object sender, EventArgs e)
|
||||
public dlgManageSecurity()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
private void dlgManageSecurity_Load(object sender, EventArgs e)
|
||||
{
|
||||
//load all folders
|
||||
myFolder = Folder.Get(1);
|
||||
@@ -323,12 +331,10 @@ namespace VEPROMS
|
||||
private void addUserToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
User u = User.MakeUser("[Enter New UserID]", "", "", "", "", "", "", "", "", "", "", DateTime.Now, "");
|
||||
frmManageUser frm = new frmManageUser("add")
|
||||
{
|
||||
MyUser = u,
|
||||
Text = "Enter New UserID" //C2026-002 Change Title bar on Add/Edit User
|
||||
};
|
||||
if (frm.ShowDialog(this) == DialogResult.OK)
|
||||
frmManageUser frm = new frmManageUser("add");
|
||||
frm.MyUser = u;
|
||||
frm.Text = "Enter New UserID"; //C2026-002 Change Title bar on Add/Edit User
|
||||
if (frm.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
u = frm.MyUser;
|
||||
u.Save();
|
||||
@@ -356,11 +362,9 @@ namespace VEPROMS
|
||||
UserInfo ui = myUserInfoList[lstUsers.SelectedIndex];
|
||||
using (User u = User.Get(ui.UID))
|
||||
{
|
||||
frmManageUser frm = new frmManageUser("edit")
|
||||
{
|
||||
MyUser = u
|
||||
};
|
||||
if (frm.ShowDialog(this) == DialogResult.OK)
|
||||
frmManageUser frm = new frmManageUser("edit");
|
||||
frm.MyUser = u;
|
||||
if (frm.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
frm.MyUser.Save();
|
||||
|
||||
@@ -501,14 +505,12 @@ namespace VEPROMS
|
||||
pnlGroups.Controls.Clear();
|
||||
foreach (GroupInfo gi in myGroupInfoList)
|
||||
{
|
||||
RadioButton rb = new RadioButton
|
||||
{
|
||||
Text = gi.GroupName,
|
||||
Parent = pnlGroups,
|
||||
Dock = DockStyle.Top,
|
||||
Tag = gi
|
||||
};
|
||||
rb.CheckedChanged -= new EventHandler(rb_CheckedChanged);
|
||||
RadioButton rb = new RadioButton();
|
||||
rb.Text = gi.GroupName;
|
||||
rb.Parent = pnlGroups;
|
||||
rb.Dock = DockStyle.Top;
|
||||
rb.Tag = gi;
|
||||
rb.CheckedChanged -= new EventHandler(rb_CheckedChanged);
|
||||
rb.CheckedChanged += new EventHandler(rb_CheckedChanged);
|
||||
pnlGroups.Controls.Add(rb);
|
||||
rb.BringToFront();
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
@@ -6,8 +11,8 @@ namespace VEPROMS
|
||||
{
|
||||
public partial class dlgPhoneList : Form
|
||||
{
|
||||
private readonly DocVersionConfig _docVersionConfig;
|
||||
private readonly string _origPhoneList;
|
||||
private DocVersionConfig _docVersionConfig;
|
||||
private string _origPhoneList;
|
||||
public dlgPhoneList(DocVersionConfig dvc)
|
||||
{
|
||||
_docVersionConfig = dvc;
|
||||
|
||||
@@ -1,24 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
public partial class dlgPickROFolder : Form
|
||||
{
|
||||
public string ImportedROFolder { get; set; }
|
||||
public List<string> LocalROFolders { get; set; }
|
||||
public string SelectedROFolder { get; set; }
|
||||
public dlgPickROFolder() => InitializeComponent();
|
||||
|
||||
private void dlgPickROFolder_Load(object sender, EventArgs e)
|
||||
private string _ImportedROFolder;
|
||||
public string ImportedROFolder
|
||||
{
|
||||
lblImportRO.Text = string.Format("The procedure you are trying to import was exported from a database that had the following RO folder path:\r\n\r\n{0}\r\n\r\nSelect from the following RO Folders that exist in the database you are trying to import this procedure into so that the import process can continue", ImportedROFolder);
|
||||
get { return _ImportedROFolder; }
|
||||
set { _ImportedROFolder = value; }
|
||||
}
|
||||
private List<string> _LocalROFolders;
|
||||
public List<string> LocalROFolders
|
||||
{
|
||||
get { return _LocalROFolders; }
|
||||
set { _LocalROFolders = value; }
|
||||
}
|
||||
private string _SelectedROFolder;
|
||||
public string SelectedROFolder
|
||||
{
|
||||
get { return _SelectedROFolder; }
|
||||
set { _SelectedROFolder = value; }
|
||||
}
|
||||
public dlgPickROFolder()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void dlgPickROFolder_Load(object sender, EventArgs e)
|
||||
{
|
||||
lblImportRO.Text = string.Format("The procedure you are trying to import was exported from a database that had the following RO folder path:\r\n\r\n{0}\r\n\r\nSelect from the following RO Folders that exist in the database you are trying to import this procedure into so that the import process can continue", _ImportedROFolder);
|
||||
clbLocalROFolders.DataSource = LocalROFolders;
|
||||
}
|
||||
|
||||
private void clbLocalROFolders_SelectedIndexChanged(object sender, EventArgs e) => btnOkay.Enabled = clbLocalROFolders.CheckedItems.Count > 0;
|
||||
private void clbLocalROFolders_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (clbLocalROFolders.CheckedItems.Count > 0)
|
||||
{
|
||||
btnOkay.Enabled = true;
|
||||
}
|
||||
else
|
||||
btnOkay.Enabled = false;
|
||||
}
|
||||
|
||||
private void btnOkay_Click(object sender, EventArgs e) => SelectedROFolder = clbLocalROFolders.CheckedItems[0].ToString();
|
||||
}
|
||||
private void btnOkay_Click(object sender, EventArgs e)
|
||||
{
|
||||
SelectedROFolder = clbLocalROFolders.CheckedItems[0].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,24 @@
|
||||
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.IO;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using JR.Utils.GUI.Forms;
|
||||
using System.Linq;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
public partial class dlgPrintAllApprovedProcedures : DevComponents.DotNetBar.Office2007Form
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private readonly StringBuilder NotApproved;
|
||||
private readonly DocVersionInfo _DocVersionInfo = null;
|
||||
private readonly int unitId = 0;
|
||||
private StringBuilder NotApproved;
|
||||
private DocVersionInfo _DocVersionInfo = null;
|
||||
private int unitId = 0;
|
||||
public dlgPrintAllApprovedProcedures(DocVersionInfo dvi)
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -38,7 +43,7 @@ namespace VEPROMS
|
||||
// if SelectedSlave is > 0 then we are printing Approved Child Procedures and
|
||||
// subtract one from the index (unitId) into the list of child names (UnitNames)
|
||||
if (unitId > 0)
|
||||
rtnstr += $"\\{_DocVersionInfo.UnitNames[unitId - 1]}"; // append Child name to path
|
||||
rtnstr += "\\" + _DocVersionInfo.UnitNames[unitId - 1]; // append Child name to path
|
||||
return rtnstr;
|
||||
}
|
||||
|
||||
@@ -86,7 +91,7 @@ namespace VEPROMS
|
||||
int pdfCount = 0;
|
||||
DeleteExistingPDFs(); // delete existing PDFs in the target folder
|
||||
// Get the Child index for Parent/Child procedure - if not Parent/Child this will be zero
|
||||
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures.OfType<ProcedureInfo>())
|
||||
foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures)
|
||||
{
|
||||
RevisionInfoList ril = RevisionInfoList.GetByItemID(myProc.ItemID);
|
||||
if (ril.Count == 0)
|
||||
@@ -139,7 +144,7 @@ namespace VEPROMS
|
||||
_MyLog.Error("Print All Approved PDFs", ex);// save error in PROMS error log
|
||||
MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
Close(); // close dialog
|
||||
this.Close(); // close dialog
|
||||
}
|
||||
private void SaveApprovedPDFToFolder(RevisionInfo revInfo,string PDFName)
|
||||
{
|
||||
@@ -163,6 +168,10 @@ namespace VEPROMS
|
||||
{
|
||||
DirectoryInfo di = new DirectoryInfo(txbApprovedPDFsPath.Text);
|
||||
FileInfo[] fis;
|
||||
//DirectoryInfo[] diAry = di.GetDirectories(txbApprovedPDFsPath.Text);
|
||||
//DirectoryInfo di_fmtgen;
|
||||
// remove all of the PDF fils
|
||||
//di_fmtgen = diAry[0];
|
||||
try
|
||||
{
|
||||
fis = di.GetFiles("*.pdf");
|
||||
@@ -180,8 +189,14 @@ namespace VEPROMS
|
||||
|
||||
}
|
||||
}
|
||||
private void txbApprovedPDFsPath_TextChanged(object sender, EventArgs e) => btnPrntAllAprv.Enabled = txbApprovedPDFsPath.Text.Length > 0;
|
||||
private void txbApprovedPDFsPath_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
btnPrntAllAprv.Enabled = txbApprovedPDFsPath.Text.Length > 0;
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e) => Close();
|
||||
}
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
@@ -28,7 +29,7 @@ namespace VEPROMS
|
||||
|
||||
if (tmp[0] == null || tmp[0] == "") // First time date set.
|
||||
{
|
||||
cbdt = $"{DateTime.Now:MM/dd/yyyy} {DateTime.Now:HH:mm:ss}";
|
||||
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + DateTime.Now.ToString("HH:mm:ss");
|
||||
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
||||
return;
|
||||
}
|
||||
@@ -42,13 +43,13 @@ namespace VEPROMS
|
||||
var time = tmpdt.TimeOfDay;
|
||||
if (start < time) // If time is greater than 12:00:00 AM
|
||||
{
|
||||
cbdt = $"{DateTime.Now:MM/dd/yyyy} {tmpdt.TimeOfDay}";
|
||||
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + tmpdt.TimeOfDay.ToString();
|
||||
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
||||
return;
|
||||
}
|
||||
else // if time is 12:00:00 AM
|
||||
{
|
||||
cbdt = $"{DateTime.Now:MM/dd/yyyy} 00:00:00";
|
||||
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + " 00:00:00";
|
||||
dateTimeInput1.Value = DateTime.Parse(cbdt);
|
||||
return;
|
||||
}
|
||||
@@ -67,7 +68,7 @@ namespace VEPROMS
|
||||
MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");// ("MM/dd/yyyy HH:mm:ss");
|
||||
|
||||
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
|
||||
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({dateTimeInput1.Value:MM/dd/yyyy HH:mm:ss}) by ({VlnSettings.UserID}) on ({DateTime.Now})", DateTime.Now, VlnSettings.UserID, 0);
|
||||
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({VlnSettings.UserID}) on ({DateTime.Now})", DateTime.Now, VlnSettings.UserID, 0);
|
||||
|
||||
//CSM C2026-014 if multi-unit, set for each unit
|
||||
System.Data.DataTable dt = RevisionData.GetRevisionDataByUnit(MyProcInfo.ItemID);
|
||||
@@ -82,7 +83,7 @@ namespace VEPROMS
|
||||
MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");
|
||||
|
||||
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
|
||||
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({dateTimeInput1.Value:MM/dd/yyyy HH:mm:ss}) by ({VlnSettings.UserID}) on ({DateTime.Now}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave);
|
||||
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({VlnSettings.UserID}) on ({DateTime.Now}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave);
|
||||
}
|
||||
}
|
||||
MyProcConfig.SelectedSlave = 0;
|
||||
@@ -90,9 +91,12 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
|
||||
private void btnNow_Click(object sender, EventArgs e) => dateTimeInput1.Value = DateTime.Now;
|
||||
private void btnNow_Click(object sender, EventArgs e)
|
||||
{
|
||||
dateTimeInput1.Value = DateTime.Now;
|
||||
}
|
||||
|
||||
//C2026-009 Add Option to Reset Change Bar to Last Approved Date/Time
|
||||
//C2026-009 Add Option to Reset Change Bar to Last Approved Date/Time
|
||||
private void btnResetToApproved_Click(object sender, EventArgs e)
|
||||
{
|
||||
System.Data.DataTable dt = RevisionData.GetRevisionDataByUnit(MyProcInfo.ItemID);
|
||||
@@ -130,7 +134,7 @@ namespace VEPROMS
|
||||
|
||||
sb.Append("\r\n Any Change Bars for Units not listed above will use the Overall/Procedure Viewer Change Bar Date (as these Units have no approvals).");
|
||||
|
||||
if (CustomMessageBox.Show($"This will reset ChangeBars to show for changes newer than the last approval.\r\nThis includes the following changes:\r\n{sb}\r\n\r\nAre you sure you wish to reset ChangeBars?", "Reset ChangeBar Date", "Yes", "No") == DialogResult.Yes)
|
||||
if (CustomMessageBox.Show($"This will reset ChangeBars to show for changes newer than the last approval.\r\nThis includes the following changes:\r\n{sb.ToString()}\r\n\r\nAre you sure you wish to reset ChangeBars?", "Reset ChangeBar Date", "Yes", "No") == DialogResult.Yes)
|
||||
{
|
||||
//Change the overall ChangeBarDate
|
||||
MyProcConfig.Print_ChangeBarDate = maxDTS;
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Print.Library;
|
||||
@@ -9,11 +13,10 @@ namespace VEPROMS
|
||||
{
|
||||
public partial class dlgTransitionReport : Form
|
||||
{
|
||||
private readonly FolderInfo folderInfo = null;
|
||||
private readonly ProcedureInfo procedureInfo = null;
|
||||
private FolderInfo folderInfo = null;
|
||||
private ProcedureInfo procedureInfo = null;
|
||||
private PDFTransitionReport rpt;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private List<DocVersionInfo> lstDocVersions;
|
||||
private List<DocVersionInfo> lstDocVersions;
|
||||
public dlgTransitionReport(FolderInfo fi)
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -23,7 +26,7 @@ namespace VEPROMS
|
||||
if (lstDocVersions.Count == 1)
|
||||
{
|
||||
pnlVersions.Visible = false;
|
||||
Height -= pnlVersions.Height;
|
||||
this.Height = this.Height - pnlVersions.Height;
|
||||
}
|
||||
}
|
||||
public dlgTransitionReport(ProcedureInfo pi)
|
||||
@@ -31,17 +34,16 @@ namespace VEPROMS
|
||||
InitializeComponent();
|
||||
procedureInfo = pi;
|
||||
pnlVersions.Visible = pnlProcs.Visible = false;
|
||||
Height = Height - pnlVersions.Height - pnlProcs.Height;
|
||||
this.Height = this.Height - pnlVersions.Height - pnlProcs.Height;
|
||||
}
|
||||
//private DocVersionInfo docVersionInfo;
|
||||
private void dlgTransitionReport_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (folderInfo != null)
|
||||
{
|
||||
rpt = new PDFTransitionReport(folderInfo, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf")
|
||||
{
|
||||
MyDocVersionList = lstDocVersions
|
||||
};
|
||||
if (lstDocVersions.Count == 1)
|
||||
rpt = new PDFTransitionReport(folderInfo, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf");
|
||||
rpt.MyDocVersionList = lstDocVersions;
|
||||
if (lstDocVersions.Count == 1)
|
||||
pbProcs.Maximum = lstDocVersions[0].Procedures.Count;
|
||||
else
|
||||
pbVersions.Maximum = lstDocVersions.Count;
|
||||
@@ -52,8 +54,8 @@ namespace VEPROMS
|
||||
if (VlnSettings.GetCommandFlag("PROFILE")) ProfileTimer.TurnOnTracking("Profile.txt");
|
||||
VEPROMS.CSLA.Library.Database.TrackDBUsage = VlnSettings.GetCommandFlag("DBTrack");
|
||||
ProfileTimer.Reset();
|
||||
_ = ProfileTimer.Push(">>>> transitionreport");
|
||||
rpt = new PDFTransitionReport(procedureInfo, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf");
|
||||
int profileDepth = ProfileTimer.Push(">>>> transitionreport");
|
||||
rpt = new PDFTransitionReport(procedureInfo, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf");
|
||||
pbTrans.Maximum = rpt.TransitionInfoCount;
|
||||
tmrReportStart.Enabled = true;
|
||||
}
|
||||
@@ -129,7 +131,7 @@ namespace VEPROMS
|
||||
{
|
||||
tmrReportFinish.Enabled = false;
|
||||
System.Diagnostics.Process.Start(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\TransitionReport.pdf");
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,32 @@
|
||||
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 VEPROMS.CSLA.Library;
|
||||
using Volian.Base.Library;
|
||||
//using Volian.Pipe.Library;
|
||||
using System.Xml;
|
||||
using System.Diagnostics;
|
||||
using JR.Utils.GUI.Forms;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
public partial class frmAnnotationsCleanup : Form
|
||||
{
|
||||
Label mylab = new Label();
|
||||
string procList = "";
|
||||
string docvList = "";
|
||||
int AnnotationTyp;
|
||||
string AnnotationName = "";
|
||||
string totalDeleteCnt = "";
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
List<ProcedureInfo> pil2 = new List<ProcedureInfo>();
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
List<DocVersionInfo> dvil2 = new List<DocVersionInfo>();
|
||||
private readonly frmBatchRefresh mainForm = null;
|
||||
List<ProcedureInfo> pil2 = new List<ProcedureInfo>();
|
||||
List<DocVersionInfo> dvil2 = new List<DocVersionInfo>();
|
||||
private frmBatchRefresh mainForm = null;
|
||||
// frmAnnotationsCleanup constructor passes users procedure and docversion selections from frmBatchRefresh
|
||||
public frmAnnotationsCleanup(Form callingForm, List<ProcedureInfo> pil, List<DocVersionInfo> dvil)
|
||||
|
||||
@@ -37,6 +47,7 @@ namespace VEPROMS
|
||||
foreach (LocalAnnotationTypeInfo lati in myLocalAnnotationTypeInfoList)
|
||||
{
|
||||
AnnotationsList.Add(lati.TypeID.ToString(), lati.Name);
|
||||
//cbAnnotationTypes.Items.Add(new { Name = lati.Name, Value = lati.TypeID });
|
||||
}
|
||||
|
||||
lbAnnotationTypes.DataSource = new BindingSource(AnnotationsList, null);
|
||||
@@ -56,11 +67,11 @@ namespace VEPROMS
|
||||
{
|
||||
if (procList == "")
|
||||
{
|
||||
procList += p.ItemID.ToString();
|
||||
procList = procList + p.ItemID.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
procList = $"{procList},{p.ItemID}";
|
||||
procList = procList + "," + p.ItemID.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,20 +88,19 @@ namespace VEPROMS
|
||||
{
|
||||
if (docvList == "")
|
||||
{
|
||||
docvList += d.VersionID.ToString();
|
||||
docvList = docvList + d.VersionID.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
docvList = $"{docvList},{d.VersionID}";
|
||||
docvList = docvList + "," + d.VersionID.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return docvList;
|
||||
}
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private AnnotationTypeInfoList myAnnotationTypeInfoList = null;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private LocalAnnotationTypeInfoList myLocalAnnotationTypeInfoList = null;
|
||||
|
||||
private AnnotationTypeInfoList myAnnotationTypeInfoList = null;
|
||||
private LocalAnnotationTypeInfoList myLocalAnnotationTypeInfoList = null;
|
||||
|
||||
// Process used to cleanup annotations "(Proceed?" button)
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
@@ -102,15 +112,21 @@ namespace VEPROMS
|
||||
TextBox frm3 = mainForm.GettxtResults();
|
||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||
AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
||||
frm3.AppendText($"Deleting Annotations: Annotation Type: \"{AnnotationName}\"");
|
||||
frm3.AppendText($"{Environment.NewLine}P = Procedure, F = Folder{Environment.NewLine}");
|
||||
foreach (var p in pil2)
|
||||
frm3.AppendText("Deleting Annotations: Annotation Type: " + '"' + AnnotationName + '"');
|
||||
frm3.AppendText(Environment.NewLine + "P = Procedure, F = Folder" + Environment.NewLine);
|
||||
int deletecountProc = 0;
|
||||
int deletecountDocv = 0;
|
||||
foreach (var p in pil2)
|
||||
{
|
||||
if (p.IsProcedure)
|
||||
{
|
||||
int deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, p.ItemID.ToString());
|
||||
frm2.AppendText($"{Environment.NewLine}{p.DisplayNumber} {p.DisplayText}");
|
||||
frm3.AppendText($"{Environment.NewLine}P: {p.DisplayNumber}\"{p.DisplayText}\" Delete count: {deletecountProc}");
|
||||
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
||||
//deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, getAnnotationProcItems(p));
|
||||
deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, p.ItemID.ToString());
|
||||
frm2.AppendText(Environment.NewLine + p.DisplayNumber + ' ' + p.DisplayText);
|
||||
//frm3.AppendText(Environment.NewLine + "P: " + p.DisplayNumber + '"' + p.DisplayText + '"' + " Type: " + '"' + AnnotationName + '"' + " count: " + deletecountProc);
|
||||
frm3.AppendText(Environment.NewLine + "P: " + p.DisplayNumber + '"' + p.DisplayText + '"' + " Delete count: " + deletecountProc);
|
||||
Annotation.DeleteAnnotationProcByType(AnnotationTyp, p.ItemID.ToString());
|
||||
lblCountNumber.Text = "0";
|
||||
}
|
||||
@@ -120,16 +136,18 @@ namespace VEPROMS
|
||||
{
|
||||
if (d.IsDocVersion)
|
||||
{
|
||||
int deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, d.VersionID.ToString());
|
||||
frm2.AppendText(Environment.NewLine + d.ActiveParent.ToString());
|
||||
frm3.AppendText($"{Environment.NewLine}F: \"{d.ActiveParent.ToString()}\" Delete count: {deletecountDocv}");
|
||||
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
||||
deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, d.VersionID.ToString());
|
||||
frm2.AppendText(Environment.NewLine + d.ActiveParent.ToString());
|
||||
frm3.AppendText(Environment.NewLine + "F: " + '"' + d.ActiveParent.ToString() + '"' + " Delete count: " + deletecountDocv);
|
||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||
Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString());
|
||||
|
||||
lblCountNumber.Text = "0";
|
||||
}
|
||||
}
|
||||
frm3.AppendText($"{Environment.NewLine}{Environment.NewLine}Total Annotations Deleted: {totalDeleteCnt}{Environment.NewLine}{Environment.NewLine}");
|
||||
frm3.AppendText(Environment.NewLine + Environment.NewLine + "Total Annotations Deleted: " + totalDeleteCnt + Environment.NewLine + Environment.NewLine);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -160,10 +178,13 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
}
|
||||
// Close form.
|
||||
private void btnClose_Click(object sender, EventArgs e) => Close();
|
||||
// Close form.
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,23 +15,28 @@ namespace VEPROMS
|
||||
{
|
||||
public partial class frmBatchRefresh : Form
|
||||
{
|
||||
public SessionInfo MySessionInfo { get; set; }
|
||||
private readonly bool IsAdministratorUser = false; //C2020-035 used to control what Set Amins can do
|
||||
private SessionInfo _MySessionInfo;
|
||||
public SessionInfo MySessionInfo
|
||||
{
|
||||
get { return _MySessionInfo; }
|
||||
set { _MySessionInfo = value; }
|
||||
}
|
||||
private bool IsAdministratorUser = false; //C2020-035 used to control what Set Amins can do
|
||||
// C2017-030 - new Admin Tools user interface
|
||||
// pass in session info to constructor
|
||||
|
||||
private readonly frmVEPROMS _veProms;
|
||||
private frmVEPROMS _veProms;
|
||||
|
||||
public frmBatchRefresh(SessionInfo sessionInfo, frmVEPROMS veProms)
|
||||
{
|
||||
InitializeComponent();
|
||||
MySessionInfo = sessionInfo;
|
||||
_MySessionInfo = sessionInfo;
|
||||
|
||||
_veProms = veProms;
|
||||
|
||||
|
||||
// When opening Admin tools Repair tab will be default.
|
||||
sideNavItmRepair.Checked = true;
|
||||
this.sideNavItmRepair.Checked = true;
|
||||
|
||||
if (sideNavItmDelete.Checked)
|
||||
{
|
||||
@@ -68,22 +73,28 @@ namespace VEPROMS
|
||||
//default to 10 years back
|
||||
dtePurge.Value = DateTime.Now.AddYears(-10);
|
||||
}
|
||||
// Make txtProcess text box available to frmAnnotationsClean form.
|
||||
internal TextBox GettxtProcess() => txtProcess;
|
||||
|
||||
// Make txtResults text box available to frmAnnotationsClean form.
|
||||
internal TextBox GettxtResults() => txtResults;
|
||||
|
||||
// NOTE: removed the Refresh ROs and Refresh Transitions and ROs options (now only Transitions can be refreshed)
|
||||
// the Update ROs and Refresh ROs logic was merged together. The Update ROs will functionally do both
|
||||
// also annotations will be placed on step elements that have RO changes
|
||||
|
||||
// make all of the hyphen character consistant so they can all be found with the Search function
|
||||
|
||||
|
||||
private void FixHyphens()
|
||||
// Make txtProcess text box available to frmAnnotationsClean form.
|
||||
internal TextBox GettxtProcess()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
return txtProcess;
|
||||
}
|
||||
|
||||
// Make txtResults text box available to frmAnnotationsClean form.
|
||||
internal TextBox GettxtResults()
|
||||
{
|
||||
return txtResults;
|
||||
}
|
||||
|
||||
// NOTE: removed the Refresh ROs and Refresh Transitions and ROs options (now only Transitions can be refreshed)
|
||||
// the Update ROs and Refresh ROs logic was merged together. The Update ROs will functionally do both
|
||||
// also annotations will be placed on step elements that have RO changes
|
||||
|
||||
// make all of the hyphen character consistant so they can all be found with the Search function
|
||||
|
||||
|
||||
private void FixHyphens()
|
||||
{
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Standardizing Hyphens");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
@@ -101,26 +112,29 @@ namespace VEPROMS
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private Dictionary<TreeNode, ProcedureInfo> myProcedures = new Dictionary<TreeNode, ProcedureInfo>();
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private Dictionary<TreeNode, DocVersionInfo> myDocVersions = new Dictionary<TreeNode, DocVersionInfo>();
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private Dictionary<TreeNode, FolderInfo> myFolders = new Dictionary<TreeNode, FolderInfo>();
|
||||
private Dictionary<TreeNode, ProcedureInfo> myProcedures = new Dictionary<TreeNode, ProcedureInfo>();
|
||||
private Dictionary<TreeNode, DocVersionInfo> myDocVersions = new Dictionary<TreeNode, DocVersionInfo>();
|
||||
private Dictionary<TreeNode, FolderInfo> myFolders = new Dictionary<TreeNode, FolderInfo>();
|
||||
|
||||
private void frmBatchRefresh_Load(object sender, EventArgs e) => IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||
private bool IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||
private void frmBatchRefresh_FormClosing(object sender, EventArgs e) => IsClosing = true;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||
// C2017-030 - new Admin Tools user interface
|
||||
// check to see if at least one tree node is checked.
|
||||
// Used to determin whether to make the process button active for
|
||||
// Refresh Transitions and for Update RO Values
|
||||
// B2025-013 Admin Tool Tree Behavior
|
||||
//Made this generic so same logic for all the TreeViews on this form
|
||||
private bool AtLeastOneNodeChecked(TreeNodeCollection col)
|
||||
private void frmBatchRefresh_Load(object sender, EventArgs e)
|
||||
{
|
||||
IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||
}
|
||||
private bool IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||
private void frmBatchRefresh_FormClosing(object sender, EventArgs e)
|
||||
{
|
||||
IsClosing = true;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||
}
|
||||
// C2017-030 - new Admin Tools user interface
|
||||
// check to see if at least one tree node is checked.
|
||||
// Used to determin whether to make the process button active for
|
||||
// Refresh Transitions and for Update RO Values
|
||||
// B2025-013 Admin Tool Tree Behavior
|
||||
//Made this generic so same logic for all the TreeViews on this form
|
||||
private bool AtLeastOneNodeChecked(TreeNodeCollection col)
|
||||
{
|
||||
foreach (TreeNode tn in col)
|
||||
if (NodeIsChecked(tn))
|
||||
@@ -140,7 +154,7 @@ namespace VEPROMS
|
||||
//C2026-002 Enhancements to new admin Tool for ROs not used.
|
||||
private void ResetmyTV_RO_DBs()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
myTV_RO_DBs.Nodes.Clear();
|
||||
|
||||
TreeNode tn = myTV_RO_DBs.Nodes.Add("Select All");
|
||||
@@ -155,13 +169,13 @@ namespace VEPROMS
|
||||
}
|
||||
tn.Expand();
|
||||
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
private void ResetTV(bool noProcs)
|
||||
{
|
||||
btnFixLinks.Enabled = false;
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
myTV.Nodes.Clear();
|
||||
myDocVersions.Clear();
|
||||
myFolders.Clear();
|
||||
@@ -170,13 +184,14 @@ namespace VEPROMS
|
||||
tn.Tag = fi;
|
||||
if (fi.ChildFolderCount > 0)
|
||||
LoadChildFolders(fi, tn, noProcs);
|
||||
myTV.SelectedNode?.Expand();
|
||||
Cursor = Cursors.Default;
|
||||
if (myTV.SelectedNode != null)
|
||||
myTV.SelectedNode.Expand();
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
private void ResetDelTV(bool noProcs)
|
||||
{
|
||||
btnFixLinks.Enabled = false;
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
myTVdel.Nodes.Clear();
|
||||
myDocVersions.Clear();
|
||||
FolderInfo fi = FolderInfo.GetTop();
|
||||
@@ -185,22 +200,21 @@ namespace VEPROMS
|
||||
|
||||
if (fi.ChildFolderCount > 0)
|
||||
{
|
||||
TreeNode tn = new TreeNode(fi.Name)
|
||||
{
|
||||
Tag = fi,
|
||||
StateImageIndex = -1 // Hide the checkbox for the root node
|
||||
};
|
||||
LoadChildFolders(fi, tn, noProcs);
|
||||
TreeNode tn = new TreeNode(fi.Name);
|
||||
tn.Tag = fi;
|
||||
tn.StateImageIndex = -1; // Hide the checkbox for the root node
|
||||
LoadChildFolders(fi, tn, noProcs);
|
||||
myTVdel.Nodes.Add(tn);
|
||||
}
|
||||
|
||||
myTVdel.SelectedNode?.Expand();
|
||||
if (myTVdel.SelectedNode != null)
|
||||
myTVdel.SelectedNode.Expand();
|
||||
|
||||
//Expand if folders
|
||||
if (noProcs)
|
||||
myTVdel.ExpandAll();
|
||||
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
// B2021-060 Higher level folders where being removed from the tree even if there was a child folder that containe a working draft set
|
||||
@@ -290,7 +304,7 @@ namespace VEPROMS
|
||||
|
||||
private void UpdateROValues()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
List<ProcedureInfo> pil = new List<ProcedureInfo>(); // C2023-002: list of checked out procedures, used in frmBatchRefreshCheckedOut dialog
|
||||
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
|
||||
foreach (TreeNode tn in myDocVersions.Keys)
|
||||
@@ -363,16 +377,14 @@ namespace VEPROMS
|
||||
sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately.");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?");
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(1)
|
||||
{
|
||||
MySessionInfo = MySessionInfo,
|
||||
CheckedOutProcedures = pil // C2023-002: set list of checked out procedures
|
||||
};
|
||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(1);
|
||||
frmCO.MySessionInfo = MySessionInfo;
|
||||
frmCO.CheckedOutProcedures = pil; // C2023-002: set list of checked out procedures
|
||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||
// C2023-002: Allow close of dialog that has list of procedures that are checked out
|
||||
if (frmCO.ShowDialog(this) != DialogResult.Cancel)
|
||||
{
|
||||
while (!Visible)
|
||||
while (!this.Visible)
|
||||
Application.DoEvents();
|
||||
}
|
||||
else
|
||||
@@ -388,7 +400,7 @@ namespace VEPROMS
|
||||
txtProcess.AppendText(string.Format("Could Not Complete: {0} {1} Seconds Elapsed", pEnd.ToString("MM/dd/yyyy @ HH:mm"), TimeSpan.FromTicks(pEnd.Ticks - pStart.Ticks).TotalSeconds));
|
||||
pbProcess.Value = pbProcess.Maximum;
|
||||
}
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
//C2025-011 RO Update Admin Tool Memory Enhancements
|
||||
@@ -413,7 +425,7 @@ namespace VEPROMS
|
||||
private void CheckROLinks()
|
||||
{
|
||||
bool badLinksFound = false;
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
||||
// populate a list of procedures that the user selected to process
|
||||
foreach (TreeNode tn in myProcedures.Keys)
|
||||
@@ -488,17 +500,15 @@ namespace VEPROMS
|
||||
|
||||
if (piq.Count > 0)
|
||||
{
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(0)
|
||||
{
|
||||
MySessionInfo = MySessionInfo
|
||||
};
|
||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(0);
|
||||
frmCO.MySessionInfo = MySessionInfo;
|
||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||
frmCO.Show(this);
|
||||
while (!Visible)
|
||||
while (!this.Visible)
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
// B2018-002 - Invalid Transitions - Define Transition Refresh Statistics
|
||||
@@ -518,7 +528,7 @@ namespace VEPROMS
|
||||
{
|
||||
// B2018-002 - Invalid Transitions - Initialize Transition Refresh Statistics
|
||||
ResetTransNumbers();
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
||||
foreach (TreeNode tn in myProcedures.Keys)
|
||||
if (tn.Checked)
|
||||
@@ -596,18 +606,16 @@ namespace VEPROMS
|
||||
sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately.");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?");
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(0)
|
||||
{
|
||||
MySessionInfo = MySessionInfo,
|
||||
CheckedOutProcedures = pil
|
||||
};
|
||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(0);
|
||||
frmCO.MySessionInfo = MySessionInfo;
|
||||
frmCO.CheckedOutProcedures = pil;
|
||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||
frmCO.Show(this);
|
||||
while (!Visible)
|
||||
while (!this.Visible)
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
// B2018-002 - Invalid Transitions - Display Transition Refresh Statistic
|
||||
if (numTransFixed == 0 && numTransConverted == 0 && numTransCantFix == 0)
|
||||
MessageBox.Show(string.Format("{0} Transitions Checked.\n\nNo Transitions Modified.", numTransProcessed), "Refresh Transitions Completed");
|
||||
@@ -621,7 +629,7 @@ namespace VEPROMS
|
||||
// the next time the procedures are printed. This also forces ROs to be refreshed in the attachments
|
||||
private void DeletePDFs()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Refreshing Word Attachments");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
@@ -639,7 +647,7 @@ namespace VEPROMS
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
private int RegenCounter = 0;
|
||||
@@ -651,7 +659,7 @@ namespace VEPROMS
|
||||
// so that this is not needed the next time the procedures are printed. This also forces ROs to be refreshed in the attachments
|
||||
private void RegenPDFs()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Generating missing Word Attachments");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
@@ -729,7 +737,7 @@ namespace VEPROMS
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
//Outputs the Progress of Regenerating the PDFs every __ minutes
|
||||
@@ -748,7 +756,7 @@ namespace VEPROMS
|
||||
// rerun until all tables/text fields are completed.
|
||||
private void RefreshTablesForSearch()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Refreshing Tables for Search");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
@@ -775,7 +783,7 @@ namespace VEPROMS
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
private int RefreshForSearch()
|
||||
{
|
||||
@@ -816,7 +824,7 @@ namespace VEPROMS
|
||||
}
|
||||
catch
|
||||
{
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
return -cntfix;
|
||||
}
|
||||
}
|
||||
@@ -831,7 +839,7 @@ namespace VEPROMS
|
||||
// tool renamed to Remove Orphan Items
|
||||
private void PurgeDisconnectedItems()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Purging Orphan Items");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
@@ -873,13 +881,13 @@ namespace VEPROMS
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
// C2017-030 - new Admin Tools user interface is one of two tools run from Remove Obsolete RO Data
|
||||
private void RemoveUnusedRoFstsAndFigures()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Purging Unused RoFSTs and Figures Items");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
@@ -928,14 +936,14 @@ namespace VEPROMS
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
// C2017-030 - new Admin Tools user interface
|
||||
// is one of two tools run from Remove Obsolete RO Data
|
||||
private void CleanUpROAssociations()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Purging Unused Referenced Object Associations");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
@@ -977,14 +985,14 @@ namespace VEPROMS
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
// C2017-030 - new Admin Tools user interface
|
||||
// tool was renamed to Show Users
|
||||
private void GetDatabaseSessions()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Show Users in PROMS");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
@@ -996,7 +1004,7 @@ namespace VEPROMS
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
MessageBox.Show("Show Users Completed", "Show Users");
|
||||
}
|
||||
|
||||
@@ -1038,10 +1046,10 @@ namespace VEPROMS
|
||||
FinalProgressBarMessage = "No existing RO.FST";
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText($"No existing ro.fst in path {roFstInfo.MyRODb.FolderPath}. Check for invalid path");
|
||||
txtProcess.AppendText("No existing ro.fst in path " + roFstInfo.MyRODb.FolderPath + ". Check for invalid path");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtResults.AppendText($"No existing ro.fst in path {roFstInfo.MyRODb.FolderPath}. Check for invalid path");
|
||||
txtResults.AppendText("No existing ro.fst in path " + roFstInfo.MyRODb.FolderPath + ". Check for invalid path");
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
return;
|
||||
@@ -1115,12 +1123,15 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
StringBuilder myFixes;
|
||||
int myFixesCount = 0;
|
||||
int myConvertCount = 0;
|
||||
// show the changes made in the Results pannel, include the ItemId of the step element
|
||||
void ContentInfo_StaticContentInfoChange(object sender, StaticContentInfoEventArgs args)
|
||||
{
|
||||
|
||||
if (args.Type == "TX")
|
||||
{
|
||||
myFixesCount++;
|
||||
if (args.NewValue.StartsWith("Reason for Change:"))
|
||||
myFixes.AppendLine(string.Format("Fixed Transition for {1}({4}){0}Old Text: {2}{0}{3}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue, (sender as ItemInfo).ItemID));
|
||||
else
|
||||
@@ -1144,15 +1155,13 @@ namespace VEPROMS
|
||||
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveFileDialog sfd = new SaveFileDialog
|
||||
{
|
||||
DefaultExt = "txt",
|
||||
AddExtension = true,
|
||||
Filter = "Text Files (*.txt)|*.txt",
|
||||
FileName = string.Format("BatchRefreshResults_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm")),
|
||||
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS"
|
||||
};
|
||||
DialogResult dr = sfd.ShowDialog();
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.DefaultExt = "txt";
|
||||
sfd.AddExtension = true;
|
||||
sfd.Filter = "Text Files (*.txt)|*.txt";
|
||||
sfd.FileName = string.Format("BatchRefreshResults_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm"));
|
||||
sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS";
|
||||
DialogResult dr = sfd.ShowDialog();
|
||||
|
||||
if (dr == DialogResult.OK)
|
||||
{
|
||||
@@ -1177,7 +1186,7 @@ namespace VEPROMS
|
||||
{
|
||||
|
||||
//Purge Change History
|
||||
string statmsg = $"Purging all Change History before {dtePurge.Value.Date:MM/dd/yyyy}";
|
||||
string statmsg = $"Purging all Change History before {dtePurge.Value.Date.ToString("MM/dd/yyyy")}";
|
||||
InitialProgressBarMessage = statmsg;
|
||||
txtResults.AppendText(statmsg);
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
@@ -1185,7 +1194,7 @@ namespace VEPROMS
|
||||
Maintenance.PurgeChangeHistory(dtePurge.Value);
|
||||
|
||||
//update status
|
||||
statmsg = $"Finished Purging all Change History before {dtePurge.Value.Date:MM/dd/yyyy}. Updating indexes to reflect cleaned data.";
|
||||
statmsg = $"Finished Purging all Change History before {dtePurge.Value.Date.ToString("MM/dd/yyyy")}. Updating indexes to reflect cleaned data.";
|
||||
DoProgressBarRefresh(50, 100, statmsg);
|
||||
txtProcess.AppendText(statmsg);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
@@ -1371,11 +1380,14 @@ namespace VEPROMS
|
||||
ResetTV(false);
|
||||
}
|
||||
|
||||
// C2017-030 new Admin Tools user interface
|
||||
private void sideNavItmExit_Click(object sender, EventArgs e) => Close();
|
||||
// C2017-030 new Admin Tools user interface
|
||||
private void sideNavItmExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// new Admin Tools user interface for deletes
|
||||
private void sideNavItmDelete_Click(object sender, EventArgs e)
|
||||
// new Admin Tools user interface for deletes
|
||||
private void sideNavItmDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
AdminToolType = E_AdminToolType.Delete;
|
||||
lblAdmToolProgressType.Text = "";
|
||||
@@ -1414,12 +1426,12 @@ namespace VEPROMS
|
||||
};
|
||||
private E_AdminToolType AdminToolType = E_AdminToolType.Repair;
|
||||
|
||||
readonly DevComponents.DotNetBar.StepItem siOrphDatRecs = new DevComponents.DotNetBar.StepItem("siOrphDatRecs", "Orphan Data Records");
|
||||
readonly DevComponents.DotNetBar.StepItem siObsoleteROData = new DevComponents.DotNetBar.StepItem("siObsoleteROData", "Obsolete RO Data");
|
||||
readonly DevComponents.DotNetBar.StepItem siStandardHyphens = new DevComponents.DotNetBar.StepItem("siStandardHyphens", "Standardize Hyphens");
|
||||
readonly DevComponents.DotNetBar.StepItem siRefreshAttmts = new DevComponents.DotNetBar.StepItem("siRefreshAttmts", "Refresh Word Attachments");
|
||||
readonly DevComponents.DotNetBar.StepItem siRegenAttmts = new DevComponents.DotNetBar.StepItem("siRegenAttmts", "Regenerate Word Attachments");
|
||||
readonly DevComponents.DotNetBar.StepItem siRefreshTblsSrchTxt = new DevComponents.DotNetBar.StepItem("siRefreshTblsSrchTxt", "Refresh Tables For Search");
|
||||
DevComponents.DotNetBar.StepItem siOrphDatRecs = new DevComponents.DotNetBar.StepItem("siOrphDatRecs", "Orphan Data Records");
|
||||
DevComponents.DotNetBar.StepItem siObsoleteROData = new DevComponents.DotNetBar.StepItem("siObsoleteROData", "Obsolete RO Data");
|
||||
DevComponents.DotNetBar.StepItem siStandardHyphens = new DevComponents.DotNetBar.StepItem("siStandardHyphens", "Standardize Hyphens");
|
||||
DevComponents.DotNetBar.StepItem siRefreshAttmts = new DevComponents.DotNetBar.StepItem("siRefreshAttmts", "Refresh Word Attachments");
|
||||
DevComponents.DotNetBar.StepItem siRegenAttmts = new DevComponents.DotNetBar.StepItem("siRegenAttmts", "Regenerate Word Attachments");
|
||||
DevComponents.DotNetBar.StepItem siRefreshTblsSrchTxt = new DevComponents.DotNetBar.StepItem("siRefreshTblsSrchTxt", "Refresh Tables For Search");
|
||||
// this will update/rebuild the progress bar in the bottom panel of Admin Tools
|
||||
private void setupProgessSteps1()
|
||||
{
|
||||
@@ -1471,10 +1483,13 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
// used for all of the Switch buttons (ON/OFF buttons)
|
||||
private void swCk_ValueChanged(object sender, EventArgs e) => setupProgessSteps1();
|
||||
// used for all of the Switch buttons (ON/OFF buttons)
|
||||
private void swCk_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
setupProgessSteps1();
|
||||
}
|
||||
|
||||
private void swUpdateROVals_ValueChanged(object sender, EventArgs e)
|
||||
private void swUpdateROVals_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (swUpdateROVals.Value)
|
||||
{
|
||||
@@ -1494,13 +1509,16 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
// C2017-030 New Admin Tools user interface
|
||||
// functions to handle the progress bar in the bottom panel of Admin Tools
|
||||
private void StepProgress(int prgStpIdx, int val) => ((DevComponents.DotNetBar.StepItem)progressSteps1.Items[prgStpIdx]).Value = val;
|
||||
// C2017-030 New Admin Tools user interface
|
||||
// functions to handle the progress bar in the bottom panel of Admin Tools
|
||||
private void StepProgress(int prgStpIdx, int val)
|
||||
{
|
||||
((DevComponents.DotNetBar.StepItem)progressSteps1.Items[prgStpIdx]).Value = val;
|
||||
}
|
||||
|
||||
private void ClearStepProgress()
|
||||
private void ClearStepProgress()
|
||||
{
|
||||
for (int i = 0; i < progressSteps1.Items.Count; i++)
|
||||
{
|
||||
@@ -1655,7 +1673,7 @@ namespace VEPROMS
|
||||
txtResults.Clear();
|
||||
txtProcess.Clear();
|
||||
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
|
||||
//Create checked proce and doc info lists.
|
||||
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
||||
@@ -1738,7 +1756,7 @@ namespace VEPROMS
|
||||
sb.AppendLine("If you want to delete annotations from these working drafts, please contact the respective users and have them close any procedures in the working draft.");
|
||||
sb.AppendLine();
|
||||
txtProcess.AppendText(sb.ToString());
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1772,7 +1790,7 @@ namespace VEPROMS
|
||||
|
||||
|
||||
}
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
private void ProcessDelete(List<DocVersionInfo> foldersToDelete, List<FolderInfo> emptyFoldersToDelete)
|
||||
@@ -1934,16 +1952,14 @@ namespace VEPROMS
|
||||
//CSM - C2025-043 report RO's that are not used in any of the PROMS data.
|
||||
private void btnROsNotUsed_Click(object sender, EventArgs e)
|
||||
{
|
||||
//Get the path to save the Image to
|
||||
SaveFileDialog sfd = new SaveFileDialog
|
||||
{
|
||||
DefaultExt = "bmp",
|
||||
AddExtension = true,
|
||||
Filter = "Image Files (*.bmp)|*.bmp",
|
||||
FileName = string.Format("ROsNotUsed_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm")),
|
||||
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS"
|
||||
};
|
||||
DialogResult dr = sfd.ShowDialog();
|
||||
//Get the path to save the Image to
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.DefaultExt = "bmp";
|
||||
sfd.AddExtension = true;
|
||||
sfd.Filter = "Image Files (*.bmp)|*.bmp";
|
||||
sfd.FileName = string.Format("ROsNotUsed_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm"));
|
||||
sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS";
|
||||
DialogResult dr = sfd.ShowDialog();
|
||||
|
||||
if (dr == DialogResult.OK)
|
||||
{
|
||||
|
||||
@@ -1,18 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using LBOutlookLibrary;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Net.Mail;
|
||||
using System.Net;
|
||||
using System.IO;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
public partial class frmBatchRefreshCheckedOut : Form
|
||||
{
|
||||
public SessionInfo MySessionInfo { get; set; }
|
||||
public List<ProcedureInfo> CheckedOutProcedures { get; set; }
|
||||
private readonly int RType = -1; // C2023-002: Flag type of checkout, docversion -1 or procedures 0
|
||||
private SessionInfo _MySessionInfo;
|
||||
public SessionInfo MySessionInfo
|
||||
{
|
||||
get { return _MySessionInfo; }
|
||||
set { _MySessionInfo = value; }
|
||||
}
|
||||
private List<ProcedureInfo> _CheckedOutProcedures;
|
||||
public List<ProcedureInfo> CheckedOutProcedures
|
||||
{
|
||||
get { return _CheckedOutProcedures; }
|
||||
set { _CheckedOutProcedures = value; }
|
||||
}
|
||||
private int RType = -1; // C2023-002: Flag type of checkout, docversion -1 or procedures 0
|
||||
public frmBatchRefreshCheckedOut(int type)
|
||||
{
|
||||
RType = type;
|
||||
@@ -36,39 +53,32 @@ namespace VEPROMS
|
||||
}
|
||||
private void AddToDisplayList(ProcedureInfo pi)
|
||||
{
|
||||
Panel p = new Panel
|
||||
{
|
||||
BorderStyle = BorderStyle.FixedSingle,
|
||||
Dock = DockStyle.Top,
|
||||
Height = 28
|
||||
};
|
||||
if (RType != 1) // C2023-002: only put out ForceCheckin & sendemail buttons if on procedures (can't check in a docversion)
|
||||
Panel p = new Panel();
|
||||
p.BorderStyle = BorderStyle.FixedSingle;
|
||||
p.Dock = DockStyle.Top;
|
||||
p.Height = 28;
|
||||
if (RType != 1) // C2023-002: only put out ForceCheckin & sendemail buttons if on procedures (can't check in a docversion)
|
||||
{
|
||||
Button b = new Button
|
||||
{
|
||||
Dock = DockStyle.Right,
|
||||
Text = "Force Check In",
|
||||
Tag = pi
|
||||
};
|
||||
b.Click += new EventHandler(ForceCheckIn_Click);
|
||||
Button b = new Button();
|
||||
//b.FlatStyle = FlatStyle.Popup;
|
||||
b.Dock = DockStyle.Right;
|
||||
b.Text = "Force Check In";
|
||||
b.Tag = pi;
|
||||
b.Click += new EventHandler(ForceCheckIn_Click);
|
||||
p.Controls.Add(b);
|
||||
b = new Button
|
||||
{
|
||||
//b.FlatStyle = FlatStyle.Popup;
|
||||
Dock = DockStyle.Right,
|
||||
Text = "Send Email",
|
||||
Tag = pi
|
||||
};
|
||||
b.Click += new EventHandler(SendEmail_Click);
|
||||
b = new Button();
|
||||
//b.FlatStyle = FlatStyle.Popup;
|
||||
b.Dock = DockStyle.Right;
|
||||
b.Text = "Send Email";
|
||||
b.Tag = pi;
|
||||
b.Click += new EventHandler(SendEmail_Click);
|
||||
p.Controls.Add(b);
|
||||
}
|
||||
Label l = new Label
|
||||
{
|
||||
Dock = DockStyle.Fill,
|
||||
TextAlign = ContentAlignment.MiddleLeft,
|
||||
Text = $"Procedure {pi.DisplayNumber} is checked out to {UserInfo.GetByUserID(OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure).SessionUserID).UserID}"
|
||||
};
|
||||
p.Controls.Add(l);
|
||||
Label l = new Label();
|
||||
l.Dock = DockStyle.Fill;
|
||||
l.TextAlign = ContentAlignment.MiddleLeft;
|
||||
l.Text = string.Format("Procedure {0} is checked out to {1}", pi.DisplayNumber, UserInfo.GetByUserID(OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure).SessionUserID).UserID);
|
||||
p.Controls.Add(l);
|
||||
pnlList.Controls.Add(p);
|
||||
p.BringToFront();
|
||||
pnlList.Focus();
|
||||
@@ -93,7 +103,15 @@ namespace VEPROMS
|
||||
private string BuildEmailMessageBody(ProcedureInfo pi)
|
||||
{
|
||||
StringBuilder body = new StringBuilder();
|
||||
body.AppendLine($"The administrator needs you to check in procedure {pi.DisplayNumber} so the administrator can continue an administrative tool process");
|
||||
//body.AppendLine("THIS IS A TEST MESSAGE FROM JIM BODINE");
|
||||
//body.AppendLine();
|
||||
body.AppendLine(string.Format("The administrator needs you to check in procedure {0} so the administrator can continue an administrative tool process", pi.DisplayNumber));
|
||||
//body.AppendLine();
|
||||
//body.AppendLine("Obviously, you do not really have this procedure checked out, so you really do not have to do anything.");
|
||||
//body.AppendLine();
|
||||
//body.AppendLine("However, I would appreciate it if you would reply to this email so I know the email worked");
|
||||
//body.AppendLine();
|
||||
//body.AppendLine("I will try NOT to overwhelm your email system :-)");
|
||||
return body.ToString();
|
||||
}
|
||||
void ForceCheckIn_Click(object sender, EventArgs e)
|
||||
@@ -116,7 +134,15 @@ namespace VEPROMS
|
||||
private string BuildForcedMessageBody(ProcedureInfo pi)
|
||||
{
|
||||
StringBuilder body = new StringBuilder();
|
||||
body.AppendLine($"The administrator needed to force check in procedure {pi.DisplayNumber} so the administrator could continue an administrative tool process");
|
||||
//body.AppendLine("THIS IS A TEST MESSAGE FROM JIM BODINE");
|
||||
//body.AppendLine();
|
||||
body.AppendLine(string.Format("The administrator needed to force check in procedure {0} so the administrator could continue an administrative tool process", pi.DisplayNumber));
|
||||
//body.AppendLine();
|
||||
//body.AppendLine("Obviously, you do not really have this procedure checked out, so nothing really got forced checked in.");
|
||||
//body.AppendLine();
|
||||
//body.AppendLine("However, I would appreciate it if you would reply to this email so I know the email worked");
|
||||
//body.AppendLine();
|
||||
//body.AppendLine("I will try NOT to overwhelm your email system :-)");
|
||||
return body.ToString();
|
||||
}
|
||||
private bool SendOutlookEmail(string email, string subject, string body)
|
||||
@@ -137,7 +163,7 @@ namespace VEPROMS
|
||||
if (ex.Message.ToLower().Contains("failed due to the following error: 80080005"))
|
||||
MessageBox.Show("You cannot send email via a running instance of Outlook from VE PROMS running from within Visual Studio.");
|
||||
else
|
||||
MessageBox.Show($"{ex.GetType().Name} - {ex.Message}");
|
||||
MessageBox.Show(string.Format("{0} - {1}", ex.GetType().Name, ex.Message));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -154,7 +180,7 @@ namespace VEPROMS
|
||||
CheckedOutProcedures = tmp;
|
||||
if (CheckedOutProcedures.Count == 0)
|
||||
{
|
||||
Close();
|
||||
this.Close();
|
||||
return;
|
||||
}
|
||||
foreach (ProcedureInfo pi in CheckedOutProcedures)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using System.IO;
|
||||
using Volian.Controls.Library;
|
||||
using DevComponents.DotNetBar;
|
||||
using JR.Utils.GUI.Forms;
|
||||
using System.Linq;
|
||||
using System.Data;
|
||||
using xls = Microsoft.Office.Interop.Excel;
|
||||
|
||||
@@ -11,42 +16,52 @@ namespace VEPROMS
|
||||
{
|
||||
public partial class frmGenTools : Form
|
||||
{
|
||||
public SessionInfo MySessionInfo { get; set; }
|
||||
private SessionInfo _MySessionInfo;
|
||||
public SessionInfo MySessionInfo
|
||||
{
|
||||
get { return _MySessionInfo; }
|
||||
set { _MySessionInfo = value; }
|
||||
}
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping veProms for potential future use")]
|
||||
public frmGenTools(SessionInfo sessionInfo, frmVEPROMS veProms)
|
||||
public frmGenTools(SessionInfo sessionInfo, frmVEPROMS veProms)
|
||||
{
|
||||
InitializeComponent();
|
||||
MySessionInfo = sessionInfo;
|
||||
_MySessionInfo = sessionInfo;
|
||||
|
||||
// When opening General tools Check tab will be default.
|
||||
sideNavItmCheck.Checked = true;
|
||||
this.sideNavItmCheck.Checked = true;
|
||||
|
||||
setupProgessSteps1(); // C2017-030 - new Tools user interface
|
||||
|
||||
}
|
||||
|
||||
private void frmGenTools_Load(object sender, EventArgs e) => IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||
private bool IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||
private void frmGenTools_FormClosing(object sender, EventArgs e) => IsClosing = true;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||
|
||||
// C2017-030 - new Tools user interface
|
||||
// tool renamed to Identify Orphan Items
|
||||
private void IdentifyDisconnectedItems()
|
||||
private void frmGenTools_Load(object sender, EventArgs e)
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||
}
|
||||
private bool IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||
private void frmGenTools_FormClosing(object sender, EventArgs e)
|
||||
{
|
||||
IsClosing = true;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||
}
|
||||
|
||||
// C2017-030 - new Tools user interface
|
||||
// tool renamed to Identify Orphan Items
|
||||
private void IdentifyDisconnectedItems()
|
||||
{
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Identifing Orphan Items");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
int rowCount = ESP_IdentifyDisconnectedItems.Execute("vesp_GetDisconnectedItemsCount");
|
||||
txtProcess.AppendText($"Orphan Items Count: {rowCount}");
|
||||
txtProcess.AppendText(string.Format("Orphan Items Count: {0}", rowCount));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
if (rowCount > 0)
|
||||
{
|
||||
txtResults.AppendText($"The database contains {rowCount} Orphan items.");
|
||||
txtResults.AppendText(string.Format("The database contains {0} Orphan items.", rowCount));
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
txtResults.AppendText("These can be removed via the Remove Orphan Data Records in the Repair tools");
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
@@ -59,33 +74,33 @@ namespace VEPROMS
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
}
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText($"Completed: {pEnd:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
// C2017-030 - new Tools user interface
|
||||
// is one of two tools run from Check Obsolete RO Data
|
||||
private void IdentifyUnusedRoFstsAndFigures()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Identifing Unused RoFsts and Figures");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
int rowCountRoFst = ESP_GetUnusedRoFsts.Execute("vesp_GetUnusedRoFstsCount");
|
||||
int rowCountFigures = ESP_GetUnusedFigures.Execute("vesp_GetUnusedFiguresCount");
|
||||
txtProcess.AppendText($"Unused RoFsts Count: {rowCountRoFst}, Unused Figures Count: {rowCountFigures}");
|
||||
txtProcess.AppendText(string.Format("Unused RoFsts Count: {0}, Unused Figures Count: {1}", rowCountRoFst, rowCountFigures));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
if (rowCountRoFst > 0 || rowCountFigures > 0)
|
||||
{
|
||||
txtResults.AppendText($"The database contains {rowCountRoFst} unused RoFsts.");
|
||||
txtResults.AppendText(string.Format("The database contains {0} unused RoFsts.", rowCountRoFst));
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
txtResults.AppendText($"The database contains {rowCountFigures} unused Figures items.");
|
||||
txtResults.AppendText(string.Format("The database contains {0} unused Figures items.", rowCountFigures));
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
}
|
||||
@@ -97,31 +112,31 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText($"Completed: {pEnd:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
// C2017-030 - new Tools user interface
|
||||
// is one of two tools run from Check Obsolete RO Data
|
||||
private void IdentifyROAssociations()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Identifing Unused RO Associations");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
int rowCount = ESP_GetROAssoc.Execute("vesp_GetUnusedROAssociationsCount");
|
||||
txtProcess.AppendText($"Unused RO Associations Count: {rowCount}");
|
||||
txtProcess.AppendText(string.Format("Unused RO Associations Count: {0}", rowCount));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
if (rowCount > 0)
|
||||
{
|
||||
txtResults.AppendText($"The database contains {rowCount} unused RO Associations.");
|
||||
txtResults.AppendText(string.Format("The database contains {0} unused RO Associations.", rowCount));
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
}
|
||||
@@ -132,26 +147,26 @@ namespace VEPROMS
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
}
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText($"Completed: {pEnd:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
// C2017-030 - new Tools user interface
|
||||
// tool was renamed to Hidden Data Locations (on Check list)
|
||||
private void IdentifyNonEditableItems()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Identifing Hidden Item Locations");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
List<ItemInfo> myItems = ESP_IdentifyNonEditableItems.Execute("vesp_GetNonEditableItems");
|
||||
txtProcess.AppendText($"Hidden Items Count: {myItems.Count}");
|
||||
txtProcess.AppendText(string.Format("Hidden Items Count: {0}", myItems.Count));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
if (myItems.Count > 0)
|
||||
{
|
||||
@@ -175,46 +190,52 @@ namespace VEPROMS
|
||||
//clear the list since no longer using it
|
||||
myItems.Clear();
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText($"Completed: {pEnd:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
// C2017-030 - new Tools user interface
|
||||
// tool was renamed to Show Users
|
||||
private void GetDatabaseSessions()
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Show Users in PROMS");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
txtResults.Clear();
|
||||
txtResults.AppendText(ESP_GetDatabaseSessions.Execute("vesp_GetDatabaseSessions"));
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText($"Completed: {pEnd:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
MessageBox.Show("Show Users Completed", "Show Users");
|
||||
}
|
||||
|
||||
private void btnClear_Click(object sender, EventArgs e) => txtResults.Clear();
|
||||
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
public List<string> roFstInfo_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args)
|
||||
{
|
||||
SaveFileDialog sfd = new SaveFileDialog
|
||||
{
|
||||
DefaultExt = "txt",
|
||||
AddExtension = true,
|
||||
Filter = "Text Files (*.txt)|*.txt",
|
||||
FileName = $"BatchRefreshResults_{DateTime.Now:yyyyMMdd_HHmm}",
|
||||
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS"
|
||||
};
|
||||
DialogResult dr = sfd.ShowDialog();
|
||||
return VlnFlexGrid.ROTableUpdate(sender, args);
|
||||
}
|
||||
|
||||
private void btnClear_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtResults.Clear();
|
||||
}
|
||||
|
||||
private void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.DefaultExt = "txt";
|
||||
sfd.AddExtension = true;
|
||||
sfd.Filter = "Text Files (*.txt)|*.txt";
|
||||
sfd.FileName = string.Format("BatchRefreshResults_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm"));
|
||||
sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS";
|
||||
DialogResult dr = sfd.ShowDialog();
|
||||
|
||||
if (dr == DialogResult.OK)
|
||||
{
|
||||
@@ -236,10 +257,13 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
private void chkLater_CheckedChanged(object sender, EventArgs e) => pnlLater.Enabled = chkLater.Checked;
|
||||
private void chkLater_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
pnlLater.Enabled = chkLater.Checked;
|
||||
}
|
||||
|
||||
// C2017-030 new Tools user interface
|
||||
private void sideNavItmCheck_Click(object sender, EventArgs e)
|
||||
// C2017-030 new Tools user interface
|
||||
private void sideNavItmCheck_Click(object sender, EventArgs e)
|
||||
{
|
||||
GenToolType = E_GenToolType.Check;
|
||||
lblAdmToolProgressType.Text = "Checking:";
|
||||
@@ -260,13 +284,16 @@ namespace VEPROMS
|
||||
setupProgessSteps1();
|
||||
}
|
||||
|
||||
// C2017-030 new Tools user interface
|
||||
private void sideNavItmExit_Click(object sender, EventArgs e) => Close();
|
||||
// C2017-030 new Tools user interface
|
||||
private void sideNavItmExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
#region On/Off Swiches
|
||||
#region On/Off Swiches
|
||||
|
||||
// C2017-030 new Tools user interface
|
||||
private enum E_GenToolType : int
|
||||
// C2017-030 new Tools user interface
|
||||
private enum E_GenToolType : int
|
||||
{
|
||||
Check = 0,
|
||||
Users = 3,
|
||||
@@ -274,9 +301,9 @@ namespace VEPROMS
|
||||
};
|
||||
private E_GenToolType GenToolType = 0;
|
||||
|
||||
readonly DevComponents.DotNetBar.StepItem siOrphDatRecs = new DevComponents.DotNetBar.StepItem("siOrphDatRecs", "Orphan Data Records");
|
||||
readonly DevComponents.DotNetBar.StepItem siHiddenDataLocs = new DevComponents.DotNetBar.StepItem("siHiddenDataLocs", "Hidden Data");
|
||||
readonly DevComponents.DotNetBar.StepItem siObsoleteROData = new DevComponents.DotNetBar.StepItem("siObsoleteROData", "Obsolete RO Data");
|
||||
DevComponents.DotNetBar.StepItem siOrphDatRecs = new DevComponents.DotNetBar.StepItem("siOrphDatRecs", "Orphan Data Records");
|
||||
DevComponents.DotNetBar.StepItem siHiddenDataLocs = new DevComponents.DotNetBar.StepItem("siHiddenDataLocs", "Hidden Data");
|
||||
DevComponents.DotNetBar.StepItem siObsoleteROData = new DevComponents.DotNetBar.StepItem("siObsoleteROData", "Obsolete RO Data");
|
||||
|
||||
// this will update/rebuild the progress bar in the bottom panel of Tools
|
||||
private void setupProgessSteps1()
|
||||
@@ -305,16 +332,22 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
// used for all of the Switch buttons (ON/OFF buttons)
|
||||
private void swCk_ValueChanged(object sender, EventArgs e) => setupProgessSteps1();
|
||||
// used for all of the Switch buttons (ON/OFF buttons)
|
||||
private void swCk_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
setupProgessSteps1();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
// C2017-030 New Tools user interface
|
||||
// functions to handle the progress bar in the bottom panel of Tools
|
||||
private void StepProgress(int prgStpIdx, int val) => ((DevComponents.DotNetBar.StepItem)progressSteps1.Items[prgStpIdx]).Value = val;
|
||||
// C2017-030 New Tools user interface
|
||||
// functions to handle the progress bar in the bottom panel of Tools
|
||||
private void StepProgress(int prgStpIdx, int val)
|
||||
{
|
||||
((DevComponents.DotNetBar.StepItem)progressSteps1.Items[prgStpIdx]).Value = val;
|
||||
}
|
||||
|
||||
private void ClearStepProgress()
|
||||
private void ClearStepProgress()
|
||||
{
|
||||
for (int i = 0; i < progressSteps1.Items.Count; i++)
|
||||
{
|
||||
@@ -329,7 +362,7 @@ namespace VEPROMS
|
||||
{
|
||||
if (chkLater.Checked)
|
||||
{
|
||||
long later = long.Parse($"{dtpDate.Value:yyyyMMdd}{dtpTime.Value:HHmm}");
|
||||
long later = long.Parse(dtpDate.Value.ToString("yyyyMMdd") + dtpTime.Value.ToString("HHmm"));
|
||||
long now = long.Parse(DateTime.Now.ToString("yyyyMMddHHmm"));
|
||||
|
||||
while (now < later)
|
||||
@@ -402,12 +435,10 @@ namespace VEPROMS
|
||||
{
|
||||
if (string.IsNullOrEmpty(UACfilename))
|
||||
{
|
||||
SaveFileDialog sfd = new SaveFileDialog
|
||||
{
|
||||
Filter = "Excel XLS (*.xlsx)|*.xlsx",
|
||||
FileName = "UACReport.xlsx"
|
||||
};
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.Filter = "Excel XLS (*.xlsx)|*.xlsx";
|
||||
sfd.FileName = "UACReport.xlsx";
|
||||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
UACfilename = sfd.FileName;
|
||||
}
|
||||
@@ -431,11 +462,11 @@ namespace VEPROMS
|
||||
//Get Datatable of results then loop through outputting into excel
|
||||
private void Generate_UAC_Report(string filename)
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Generate User Access Control Report in PROMS");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText($"Started: {pStart:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
txtResults.Clear();
|
||||
@@ -494,9 +525,9 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText($"Completed: {pEnd:MM/dd/yyyy @ HH:mm}");
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
Application.DoEvents();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
MessageBox.Show("Generate User Access Control Report Completed", "User Access Control Report");
|
||||
|
||||
}
|
||||
@@ -513,7 +544,7 @@ namespace VEPROMS
|
||||
catch (Exception ex)
|
||||
{
|
||||
obj = null;
|
||||
MessageBox.Show($"Exception Occurred while releasing object {ex}");
|
||||
MessageBox.Show("Exception Occurred while releasing object " + ex.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -521,11 +552,18 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
//C2025-011 RO Update Tool Memory Enhancements
|
||||
//clears the stack to help with memory - should never need to undo text changes to this.
|
||||
private void txtProcess_TextChanged(object sender, EventArgs e) => txtProcess.ClearUndo();
|
||||
//clears the stack to help with memory - should never need to undo text changes to this.
|
||||
private void txtResults_TextChanged(object sender, EventArgs e) => txtResults.ClearUndo();
|
||||
//C2025-011 RO Update Tool Memory Enhancements
|
||||
private void txtProcess_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//clears the stack to help with memory - should never need to undo text changes to this.
|
||||
txtProcess.ClearUndo();
|
||||
}
|
||||
|
||||
private void txtResults_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//clears the stack to help with memory - should never need to undo text changes to this.
|
||||
txtResults.ClearUndo();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
@@ -36,10 +40,10 @@ namespace VEPROMS
|
||||
tmp = $"{su.UserID} Information";
|
||||
}
|
||||
|
||||
Text = tmp;
|
||||
this.Text = tmp;
|
||||
}
|
||||
}
|
||||
private readonly string _Mode;
|
||||
private string _Mode;
|
||||
public frmManageUser(string mode)
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -51,7 +55,7 @@ namespace VEPROMS
|
||||
_MyUser = (pgUser.SelectedObject as SimpleUser).MyUser;
|
||||
if (_MyUser.UserID.StartsWith("["))
|
||||
{
|
||||
MessageBox.Show($"{_MyUser.UserID} is an invalid UserID");
|
||||
MessageBox.Show(string.Format("{0} is an invalid UserID", _MyUser.UserID));
|
||||
return;
|
||||
}
|
||||
if (_MyUser.UserID == string.Empty)
|
||||
@@ -61,26 +65,29 @@ namespace VEPROMS
|
||||
}
|
||||
if (UserInfo.GetByUserID(_MyUser.UserID) != null && _Mode.ToUpper() == "ADD")
|
||||
{
|
||||
MessageBox.Show($"A user already exists with the UserID '{_MyUser.UserID}'");
|
||||
MessageBox.Show(string.Format("A user already exists with the UserID '{0}'", _MyUser.UserID));
|
||||
return;
|
||||
}
|
||||
_MyUser.Save();
|
||||
DialogResult = DialogResult.OK;
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
_MyUser = User.Get(_MyUser.UID);
|
||||
DialogResult = DialogResult.Cancel;
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
}
|
||||
internal class SimpleUser
|
||||
{
|
||||
private readonly User _MyUser;
|
||||
private readonly UserConfig _MyUC;
|
||||
[Browsable(false)]
|
||||
public User MyUser => _MyUser;
|
||||
public SimpleUser(User myUser)
|
||||
private User _MyUser;
|
||||
private UserConfig _MyUC;
|
||||
[Browsable(false)]
|
||||
public User MyUser
|
||||
{
|
||||
get { return _MyUser; }
|
||||
}
|
||||
public SimpleUser(User myUser)
|
||||
{
|
||||
_MyUser = myUser;
|
||||
_MyUC = new UserConfig(myUser.Config);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Volian.Print.Library;
|
||||
using VEPROMS.CSLA.Library;
|
||||
@@ -11,24 +14,90 @@ namespace VEPROMS
|
||||
{
|
||||
public partial class frmPDFStatusForm : Form
|
||||
{
|
||||
public bool CancelPrinting { get; set; } = false;
|
||||
public bool CloseWhenDone { get; set; } = false;
|
||||
public bool CancelStop { get; set; } = false;
|
||||
public bool Stop { get; set; } = false;
|
||||
private bool _CancelPrinting = false;
|
||||
public bool CancelPrinting
|
||||
{
|
||||
get { return _CancelPrinting; }
|
||||
set { _CancelPrinting = value; }
|
||||
}
|
||||
private bool _CloseWhenDone = false;
|
||||
public bool CloseWhenDone
|
||||
{
|
||||
get { return _CloseWhenDone; }
|
||||
set { _CloseWhenDone = value; }
|
||||
}
|
||||
private bool _CancelStop = false;
|
||||
public bool CancelStop
|
||||
{
|
||||
get { return _CancelStop; }
|
||||
set { _CancelStop = value; }
|
||||
}
|
||||
private bool _Stop = false;
|
||||
public bool Stop
|
||||
{
|
||||
get { return _Stop; }
|
||||
set { _Stop = value; }
|
||||
}
|
||||
private string _PDFPath;
|
||||
|
||||
public string PDFPath { get; set; }
|
||||
public string PDFPath
|
||||
{
|
||||
get { return _PDFPath; }
|
||||
set { _PDFPath = value; }
|
||||
}
|
||||
private PromsPrinter _MyPromsPrinter;
|
||||
|
||||
public PromsPrinter MyPromsPrinter { get; set; }
|
||||
public PromsPrinter MyPromsPrinter
|
||||
{
|
||||
get { return _MyPromsPrinter; }
|
||||
set { _MyPromsPrinter = value; }
|
||||
}
|
||||
|
||||
public bool OpenPDF { get; set; }
|
||||
private Point _NewLocation;
|
||||
private bool _OpenPDF;
|
||||
|
||||
public string Prefix { get; set; } = "";
|
||||
public bool OnlyShowContinuousActionSummary { get; set; } = false;
|
||||
public bool OnlyShowTimeCriticalActionSummary { get; set; } = false;
|
||||
public bool DidAll { get; set; } = false;
|
||||
public int PrtSectID { get; set; } = -1;
|
||||
public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd, string pdfFile, Point newLocation, bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks, int removeTrailingHardReturnsAndManualPageBreaks, bool showPROMSVer, bool didAll, string blankPageText, MergedPdf mergedPdf, string watermarkColor, int PrtSectID = -1)
|
||||
public bool OpenPDF
|
||||
{
|
||||
get { return _OpenPDF; }
|
||||
set { _OpenPDF = value; }
|
||||
}
|
||||
private Point _NewLocation;
|
||||
private string _Prefix = ""; // RHM20150506 Multiline ItemID TextBox
|
||||
public string Prefix
|
||||
{
|
||||
get { return _Prefix; }
|
||||
set { _Prefix = value; }
|
||||
}
|
||||
// this flag is used when the Continuous Action Sumamry is printed from the tree or ribbon button
|
||||
// it will prevent the temporary PDF (generated with printing - needed to get page numbers) from being displayed
|
||||
// and will delete that temporary PDF file
|
||||
private bool _OnlyShowContinuousActionSummary = false;
|
||||
public bool OnlyShowContinuousActionSummary
|
||||
{
|
||||
get { return _OnlyShowContinuousActionSummary; }
|
||||
set { _OnlyShowContinuousActionSummary = value; }
|
||||
}
|
||||
// F2022-024 this flag is used when the Time Critical Action Sumamry is printed from the tree or ribbon button
|
||||
// it will prevent the temporary PDF (generated with printing - needed to get page numbers) from being displayed
|
||||
// and will delete that temporary PDF file
|
||||
private bool _OnlyShowTimeCriticalActionSummary = false;
|
||||
public bool OnlyShowTimeCriticalActionSummary
|
||||
{
|
||||
get { return _OnlyShowTimeCriticalActionSummary; }
|
||||
set { _OnlyShowTimeCriticalActionSummary = value; }
|
||||
}
|
||||
private bool _DidAll = false;
|
||||
public bool DidAll
|
||||
{
|
||||
get { return _DidAll; }
|
||||
set { _DidAll = value; }
|
||||
}
|
||||
private int _prtSectID = -1;
|
||||
public int PrtSectID
|
||||
{
|
||||
get { return _prtSectID; }
|
||||
set { _prtSectID = value; }
|
||||
}
|
||||
public frmPDFStatusForm(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, bool openPDF, bool overWrite, string pdfPath, ChangeBarDefinition cbd, string pdfFile, Point newLocation, bool insertBlankPages, bool allOrAuto, string prefix, bool saveLinks, int removeTrailingHardReturnsAndManualPageBreaks, bool showPROMSVer, bool didAll, string blankPageText, MergedPdf mergedPdf, string watermarkColor, int PrtSectID = -1)
|
||||
{
|
||||
// B2021-088 moved this if/else from CreatePDF() so that the Approval logic will have access to this logic
|
||||
ProcedureInfo MyProcedure = myItem as ProcedureInfo;
|
||||
@@ -45,29 +114,28 @@ namespace VEPROMS
|
||||
|
||||
// B2021-102 moved the baseline meta file write here too - should have been done with B2021-088 fix
|
||||
// C2018-015 add the procedure tree path and the procedure number and title to the meta file
|
||||
if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine($"!! {MyProcedure.SearchDVPath.Replace("\a", " | ")}");
|
||||
if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine($"!! {MyProcedure.DisplayNumber} | {MyProcedure.DisplayText}");
|
||||
if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0}", MyProcedure.SearchDVPath.Replace("\a", " | "));
|
||||
if (BaselineMetaFile.IsOpen) BaselineMetaFile.WriteLine("!! {0} | {1}", MyProcedure.DisplayNumber, MyProcedure.DisplayText);
|
||||
|
||||
myItem = MyProcedure;
|
||||
|
||||
Prefix = prefix;
|
||||
OpenPDF = openPDF;
|
||||
DidAll = didAll;
|
||||
this.PrtSectID = PrtSectID;
|
||||
_prtSectID = PrtSectID;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
// if the version number of PROMS is 1.0, then we are running a Demo version.
|
||||
// When running a Demo version, force a "Sample" watermark when printing.
|
||||
// B2020-022 append a ".pdf" extension if the file name does on have one.
|
||||
MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\Compare", false, overWrite, cbd, (pdfFile.ToUpper().EndsWith(".PDF")) ? pdfFile : $"{pdfFile}.pdf", insertBlankPages, allOrAuto, Prefix, saveLinks, removeTrailingHardReturnsAndManualPageBreaks, blankPageText, DidAll, mergedPdf, watermarkColor)
|
||||
{
|
||||
PromsVersion = (showPROMSVer) ? AboutVEPROMS.PROMSVersion : "" //C2018-009 print PROMS version
|
||||
};
|
||||
|
||||
|
||||
PDFPath = pdfPath;
|
||||
Text = $"Creating PDF of {myItem.DisplayNumber}";
|
||||
// if the version number of PROMS is 1.0, then we are running a Demo version.
|
||||
// When running a Demo version, force a "Sample" watermark when printing.
|
||||
// B2020-022 append a ".pdf" extension if the file name does on have one.
|
||||
MyPromsPrinter = new PromsPrinter(myItem, rev, (VlnSettings.ReleaseMode.Equals("DEMO")) ? "Sample" : watermark, debugOutput, origPgBrk, pdfPath + @"\Compare", false, overWrite, cbd, (pdfFile.ToUpper().EndsWith(".PDF"))?pdfFile:pdfFile+".pdf", insertBlankPages, allOrAuto,Prefix,saveLinks,removeTrailingHardReturnsAndManualPageBreaks, blankPageText, DidAll, mergedPdf, watermarkColor);
|
||||
|
||||
MyPromsPrinter.PromsVersion = (showPROMSVer) ? AboutVEPROMS.PROMSVersion : ""; //C2018-009 print PROMS version
|
||||
|
||||
|
||||
PDFPath = pdfPath;
|
||||
this.Text = "Creating PDF of " + myItem.DisplayNumber;
|
||||
_NewLocation = newLocation;
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
@@ -94,18 +162,24 @@ namespace VEPROMS
|
||||
if (waterMarkText.ToUpper() == "[U-TEXT]")
|
||||
{
|
||||
string utxt = (procInfo.MyDocVersion.MultiUnitCount > 1) ? procInfo.MyDocVersion.DocVersionConfig.Unit_Text : "";
|
||||
waterMarkText = utxt ?? "";
|
||||
waterMarkText = (utxt == null) ? "" : utxt;
|
||||
}
|
||||
else if (waterMarkText.ToUpper() == "[U-NUMBER]")
|
||||
{
|
||||
string uNum = (procInfo.MyDocVersion.MultiUnitCount > 1) ? procInfo.MyDocVersion.DocVersionConfig.Unit_Number : "";
|
||||
waterMarkText = uNum ?? "";
|
||||
waterMarkText = (uNum == null) ? "" : uNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<int, byte[]> DocReplace { get; set; }
|
||||
public bool AllowAllWatermarks
|
||||
// used when the approved function creates an export file with unlinked ROs and Transitons. Word sections that have RO tokens are saved with the RO Vaules in DocReplace
|
||||
// DocReplace is passed on to the Export functions.
|
||||
private Dictionary<int, byte[]> _DocReplace;
|
||||
public Dictionary<int, byte[]> DocReplace
|
||||
{
|
||||
get { return _DocReplace; }
|
||||
set { _DocReplace = value; }
|
||||
}
|
||||
public bool AllowAllWatermarks
|
||||
{
|
||||
get { return MyPromsPrinter.AllowAllWatermarks; }
|
||||
set { MyPromsPrinter.AllowAllWatermarks = value; }
|
||||
@@ -121,7 +195,7 @@ namespace VEPROMS
|
||||
if (args.Progress == pb.Maximum)
|
||||
pb.Text = args.MyStatus;
|
||||
else
|
||||
pb.Text = $"Processing {args.MyStatus} ({args.Progress + 1} of {pb.Maximum})";
|
||||
pb.Text = string.Format("Processing {0} ({1} of {2})", args.MyStatus, args.Progress + 1, pb.Maximum);
|
||||
}
|
||||
MyStatus = args.MyStatus;
|
||||
Application.DoEvents();
|
||||
@@ -143,15 +217,38 @@ namespace VEPROMS
|
||||
Text = Text.Replace("PDF", "Time Critical Action Summary"); // F2022-024 Time Critical Action
|
||||
}
|
||||
|
||||
public string PdfFile { get; set; }
|
||||
private string _PdfFile;
|
||||
public string PdfFile
|
||||
{
|
||||
get { return _PdfFile; }
|
||||
set { _PdfFile = value; }
|
||||
}
|
||||
private bool _MakePlaceKeeper = false;
|
||||
|
||||
public bool MakePlaceKeeper { get; set; } = false;
|
||||
public bool MakePlaceKeeper
|
||||
{
|
||||
get { return _MakePlaceKeeper; }
|
||||
set { _MakePlaceKeeper = value; }
|
||||
}
|
||||
|
||||
public bool MakeContinuousActionSummary { get; set; } = false;
|
||||
private bool _MakeContinuousActionSummary = false;
|
||||
|
||||
public bool MakeTimeCriticalActionSummary { get; set; } = false;
|
||||
public bool MakeContinuousActionSummary
|
||||
{
|
||||
get { return _MakeContinuousActionSummary; }
|
||||
set { _MakeContinuousActionSummary = value; }
|
||||
}
|
||||
|
||||
private void tmrRun_Tick(object sender, EventArgs e)
|
||||
// F2022-024 Time Critical Action Summary
|
||||
private bool _MakeTimeCriticalActionSummary = false;
|
||||
|
||||
public bool MakeTimeCriticalActionSummary
|
||||
{
|
||||
get { return _MakeTimeCriticalActionSummary; }
|
||||
set { _MakeTimeCriticalActionSummary = value; }
|
||||
}
|
||||
|
||||
private void tmrRun_Tick(object sender, EventArgs e)
|
||||
{
|
||||
tmrRun.Enabled = false;
|
||||
if (CancelStop) btnCancel.Visible = true;
|
||||
@@ -196,7 +293,7 @@ namespace VEPROMS
|
||||
if (OnlyShowTimeCriticalActionSummary)
|
||||
{ MyPromsPrinter.PromsPrinterPrintType = PromsPrinterPrintType.TCAS_only; }
|
||||
|
||||
PdfFile = MyPromsPrinter.Print(PDFPath, MakePlaceKeeper, MakeContinuousActionSummary, MakeTimeCriticalActionSummary, PrtSectID);
|
||||
_PdfFile = MyPromsPrinter.Print(PDFPath, MakePlaceKeeper, MakeContinuousActionSummary, MakeTimeCriticalActionSummary, PrtSectID);
|
||||
|
||||
ProfileTimer.Pop(profileDepth);
|
||||
|
||||
@@ -210,13 +307,13 @@ namespace VEPROMS
|
||||
}
|
||||
// B2024-062 Added check for EmptyProcedure. We don't need to show the Try Again message if the procedure
|
||||
// is empty, as it would be just be a waste of time for the user.
|
||||
while (!MyPromsPrinter.MergeNotIncluded && PdfFile == null && !MyPromsPrinter.EmptyProcedure &&
|
||||
while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && !MyPromsPrinter.EmptyProcedure &&
|
||||
MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes);
|
||||
|
||||
|
||||
if (PdfFile == null)
|
||||
if (_PdfFile == null)
|
||||
{
|
||||
Close();
|
||||
this.Close();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -232,13 +329,13 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
DateTime tEnd = DateTime.Now;
|
||||
MyStatus = $"{PdfFile} created.";
|
||||
MyStatus = $"{PdfFile} created in {(TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds):0.} milliseconds";
|
||||
MyStatus = _PdfFile + " created.";
|
||||
MyStatus = string.Format("{0} created in {1:0.} milliseconds", _PdfFile, (TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds));
|
||||
|
||||
if (OpenPDF)
|
||||
{
|
||||
OpenPDFandPlacekeeper(PdfFile);
|
||||
Close();
|
||||
OpenPDFandPlacekeeper(_PdfFile);
|
||||
this.Close();
|
||||
|
||||
// C2021-010: Remove trailing returns/spaces & manual page breaks & allow save. Ask if user wants to save chanages
|
||||
// if they were found.
|
||||
@@ -265,15 +362,15 @@ namespace VEPROMS
|
||||
if (CloseWhenDone)
|
||||
{
|
||||
OpenPDFandPlacekeeper(null);
|
||||
Close();
|
||||
this.Close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOpenPDF_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenPDFandPlacekeeper(PdfFile);
|
||||
Close();
|
||||
OpenPDFandPlacekeeper(_PdfFile);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// set a delay so that the word document containing the newly generated placekeeper will appear on top of everything else.
|
||||
@@ -286,7 +383,8 @@ namespace VEPROMS
|
||||
{
|
||||
System.Diagnostics.Process sdp = System.Diagnostics.Process.Start(pdffile);
|
||||
|
||||
sdp?.WaitForInputIdle();
|
||||
if (sdp != null)
|
||||
sdp.WaitForInputIdle();
|
||||
}
|
||||
|
||||
if (OnlyShowContinuousActionSummary || OnlyShowTimeCriticalActionSummary) // F2022-024 Time Critical Action Summary
|
||||
@@ -343,16 +441,16 @@ namespace VEPROMS
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string str = $"{pdffile} - {ex.GetType().Name} - {ex.Message}";
|
||||
string str = string.Format("{0} - {1} - {2}",pdffile,ex.GetType().Name,ex.Message);
|
||||
MessageBox.Show(str, "Error Opening PDFFile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnOpenFolder_Click(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("Explorer", $"/select,{PdfFile}");
|
||||
System.Diagnostics.Process.Start("Explorer", "/select," + _PdfFile);
|
||||
OpenPDFandPlacekeeper(null);
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
@@ -11,13 +13,10 @@ namespace VEPROMS
|
||||
public partial class frmPSI : Form
|
||||
{
|
||||
private ProcedureInfo _MyProcedureInfo;
|
||||
private readonly StepTabRibbon _MyStepTabRibbon;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private Dictionary<string, StepRTB> _DicStepRtb;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private Dictionary<string, CheckBox> _DicCheckBox;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private Dictionary<string, ComboBox> _DicComboBox;
|
||||
private StepTabRibbon _MyStepTabRibbon;
|
||||
private Dictionary<string, StepRTB> _DicStepRtb;
|
||||
private Dictionary<string, CheckBox> _DicCheckBox;
|
||||
private Dictionary<string, ComboBox> _DicComboBox;
|
||||
public frmPSI(ProcedureInfo pi)
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -32,23 +31,22 @@ namespace VEPROMS
|
||||
{
|
||||
_MyProcedureInfo = pi;
|
||||
PSI psiDialogDef = pi.ActiveFormat.PlantFormat.FormatData.ProcData.PSI;
|
||||
Text = psiDialogDef.Caption;
|
||||
Location = new Point((int)psiDialogDef.x * 2, (int)psiDialogDef.y * 2);
|
||||
this.Text = psiDialogDef.Caption;
|
||||
this.Location = new Point((int)psiDialogDef.x * 2, (int)psiDialogDef.y * 2);
|
||||
int maxx = 0;
|
||||
int maxy = 0;
|
||||
int xB4Scroll = 900;
|
||||
int yB4Scroll = 630;
|
||||
panelPSI.AutoScroll = false;
|
||||
this.panelPSI.AutoScroll = false;
|
||||
foreach (SILabel lbl in psiDialogDef.LabelList)
|
||||
{
|
||||
Label wlbl = new Label
|
||||
{
|
||||
Text = lbl.text,
|
||||
Location = new Point((int)lbl.x * 2, (int)lbl.y * 2),
|
||||
AutoSize = true,
|
||||
Visible = true
|
||||
};
|
||||
panelPSI.Controls.Add(wlbl);
|
||||
Label wlbl = new Label();
|
||||
wlbl.Text = lbl.text;
|
||||
wlbl.Location = new Point((int)lbl.x * 2, (int)lbl.y * 2);
|
||||
wlbl.AutoSize = true;
|
||||
//wlbl.Size = new Size((int)lbl.width * 2, (int)lbl.height * 2);
|
||||
wlbl.Visible = true;
|
||||
this.panelPSI.Controls.Add(wlbl);
|
||||
maxx = ((int)lbl.x * 2 + (int)lbl.width * 2) > maxx ? ((int)lbl.x * 2 + (int)lbl.width * 2) : maxx;
|
||||
maxy = ((int)lbl.y * 2 + (int)lbl.height * 2) > maxy ? ((int)lbl.y * 2 + (int)lbl.height * 2) : maxy;
|
||||
}
|
||||
@@ -64,7 +62,7 @@ namespace VEPROMS
|
||||
tb.MyItemInfo = pi as ItemInfo;
|
||||
tb.FieldToEdit = E_FieldToEdit.PSI;
|
||||
tb.BorderStyle = BorderStyle.FixedSingle;
|
||||
tb.Enter += new System.EventHandler(FieldStepRTB_Enter);
|
||||
tb.Enter += new System.EventHandler(this.FieldStepRTB_Enter);
|
||||
// see if config has data for this field, i.e. search for the 'name'
|
||||
// B2018-057 Replace non-breaking hyphen with hyphen.
|
||||
string val = procConfig.GetValue("PSI", fld.name).Replace("\\u8209?", "-");
|
||||
@@ -72,13 +70,13 @@ namespace VEPROMS
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 Arial;}");
|
||||
sb.Append(@"{\f1\fnil\fcharset0 Arial;}}{\colortbl ;\red255\green0\blue0;}"); //C2017-036 changed to just Arial because Microsoft removed Arial Unicode MS with Word16
|
||||
sb.Append(@"\viewkind4\uc1\pard\sl-240\slmult0\fs" + (int)(Font.SizeInPoints*2) + " " + dt.StartText + @"}");
|
||||
sb.Append(@"\viewkind4\uc1\pard\sl-240\slmult0\fs" + (int)(this.Font.SizeInPoints*2) + " " + dt.StartText + @"}");
|
||||
tb.Rtf = sb.ToString();
|
||||
tb.Location = new Point((int)fld.x * 2, (int)fld.y * 2);
|
||||
tb.Size = new Size((int)fld.width * 2, (int)fld.height * 2);
|
||||
tb.MinimumSize = new Size((int)fld.width * 2, (int)fld.height * 2);
|
||||
tb.Visible = true;
|
||||
panelPSI.Controls.Add(tb);
|
||||
this.panelPSI.Controls.Add(tb);
|
||||
maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx;
|
||||
maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy;
|
||||
}
|
||||
@@ -91,8 +89,8 @@ namespace VEPROMS
|
||||
cb.Visible = true;
|
||||
cb.Width = (int)fld.width * 2;
|
||||
string val = procConfig.GetValue("PSI", fld.name);
|
||||
cb.Checked = val !=null && val!="" && val.ToUpper()[0] == 'Y';
|
||||
panelPSI.Controls.Add(cb);
|
||||
cb.Checked = val!=null && val!="" && val.ToUpper()[0] == 'Y' ? true : false;
|
||||
this.panelPSI.Controls.Add(cb);
|
||||
maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx;
|
||||
maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy;
|
||||
}
|
||||
@@ -109,7 +107,7 @@ namespace VEPROMS
|
||||
foreach (string t in tmps) cmb.Items.Add(t);
|
||||
string val = procConfig.GetValue("PSI", fld.name);
|
||||
if (val != null && val != "") cmb.SelectedItem = val;
|
||||
panelPSI.Controls.Add(cmb);
|
||||
this.panelPSI.Controls.Add(cmb);
|
||||
maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx;
|
||||
maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy;
|
||||
}
|
||||
@@ -117,19 +115,19 @@ namespace VEPROMS
|
||||
if (maxx > xB4Scroll)
|
||||
{
|
||||
maxx = xB4Scroll;
|
||||
panelPSI.Width = xB4Scroll;
|
||||
panelPSI.AutoScroll = true;
|
||||
this.panelPSI.Width = xB4Scroll;
|
||||
this.panelPSI.AutoScroll = true;
|
||||
}
|
||||
else
|
||||
panelPSI.Width = maxx + 50;
|
||||
this.panelPSI.Width = maxx + 50;
|
||||
if (maxy > yB4Scroll)
|
||||
{
|
||||
maxy = yB4Scroll;
|
||||
panelPSI.Height = yB4Scroll;
|
||||
panelPSI.AutoScroll = true;
|
||||
this.panelPSI.Height = yB4Scroll;
|
||||
this.panelPSI.AutoScroll = true;
|
||||
}
|
||||
else
|
||||
panelPSI.Height = maxy; // B2018-062: Ok/Cancel buttons not displayed if more than a few labels/fields are defined.
|
||||
this.panelPSI.Height = maxy; // B2018-062: Ok/Cancel buttons not displayed if more than a few labels/fields are defined.
|
||||
if (psiDialogDef.ButtonsOnBottom == null || psiDialogDef.ButtonsOnBottom.ToUpper() == "NO")
|
||||
{
|
||||
btnOk.Location = new Point(maxx+70, 30);
|
||||
@@ -140,14 +138,17 @@ namespace VEPROMS
|
||||
// B2018-062: Ok/Cancel buttons not displayed if more than a few labels/fields are defined:
|
||||
// Adjust location of buttons so that they have a larger Y than the panel that holds the labels/fields
|
||||
// and adjust the dialog size if it's height is not enough.
|
||||
btnOk.Location = new Point(btnOk.Location.X, panelPSI.Location.Y + panelPSI.Height + 10);
|
||||
btnCancel.Location = new Point(btnCancel.Location.X, panelPSI.Location.Y + panelPSI.Height + 10);
|
||||
if (Height < btnOk.Location.Y + btnOk.Size.Height + 10)
|
||||
Height = btnOk.Location.Y + btnOk.Size.Height + 30;
|
||||
btnOk.Location = new Point(btnOk.Location.X, panelPSI.Location.Y + this.panelPSI.Height + 10);
|
||||
btnCancel.Location = new Point(btnCancel.Location.X, panelPSI.Location.Y + this.panelPSI.Height + 10);
|
||||
if (this.Height < btnOk.Location.Y + btnOk.Size.Height + 10)
|
||||
this.Height = btnOk.Location.Y + btnOk.Size.Height + 30;
|
||||
}
|
||||
}
|
||||
private void FieldStepRTB_Enter(object sender, EventArgs e) => _MyStepTabRibbon.MyStepRTB = (StepRTB)sender;
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
private void FieldStepRTB_Enter(object sender, EventArgs e)
|
||||
{
|
||||
_MyStepTabRibbon.MyStepRTB = (StepRTB)sender;
|
||||
}
|
||||
private void btnOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcedureConfig procConfig = _MyProcedureInfo.MyConfig as ProcedureConfig;
|
||||
PSI psiDialogDef = _MyProcedureInfo.ActiveFormat.PlantFormat.FormatData.ProcData.PSI;
|
||||
@@ -203,13 +204,13 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using VEPROMS.Properties;
|
||||
@@ -6,6 +11,8 @@ using DescriptiveEnum;
|
||||
using DevComponents.DotNetBar;
|
||||
using DevComponents.DotNetBar.Controls;
|
||||
using Volian.Controls.Library;
|
||||
using System.Xml;
|
||||
using Csla;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
@@ -13,6 +20,7 @@ namespace VEPROMS
|
||||
{
|
||||
private bool _Initializing = false;
|
||||
private string _DefaultFormatName = null;
|
||||
//private string _DefaultPagination = null;
|
||||
private string _DefaultWatermark = null;
|
||||
private string _DefaultChgBarType = null;
|
||||
private string _DefaultChgBarLoc = null;
|
||||
@@ -20,18 +28,21 @@ namespace VEPROMS
|
||||
private string _DefaultChgBarUsrMsg1 = null;
|
||||
private string _DefaultChgBarUsrMsg2 = null;
|
||||
private string _DefaultFormatColumns = null;
|
||||
private readonly ProcedureConfig _ProcedureConfig;
|
||||
private readonly StepTabRibbon _MyStepTabRibbon;
|
||||
private bool _DefaultDisableDuplex = false;
|
||||
private ProcedureConfig _ProcedureConfig;
|
||||
private StepTabRibbon _MyStepTabRibbon;
|
||||
|
||||
public frmProcedureProperties(ProcedureConfig procedureConfig)
|
||||
{
|
||||
_ProcedureConfig = procedureConfig;
|
||||
_Initializing = true;
|
||||
InitializeComponent();
|
||||
btnGeneral.PerformClick(); // always start with General tab or button
|
||||
ItemInfo itmInfo = ItemInfo.Get(_ProcedureConfig.MyProcedure.ItemID);
|
||||
btnGeneral.PerformClick(); // always start with General tab or button
|
||||
_Initializing = false;
|
||||
// build the title bar caption
|
||||
Text = $"{itmInfo.DisplayNumber} {itmInfo.DisplayText} Properties";
|
||||
//this.Text = string.Format("{0} {1} Properties", procedureConfig.Number, procedureConfig.Title);
|
||||
ItemInfo itmInfo = ItemInfo.Get(_ProcedureConfig.MyProcedure.ItemID);
|
||||
this.Text = string.Format("{0} {1} Properties", itmInfo.DisplayNumber, itmInfo.DisplayText);
|
||||
ppProcTitleStpRTB.Font = ppProcTitleStpRTB.FormatFont = new System.Drawing.Font("Microsoft Sans Serif", 10F);
|
||||
ppProcTitleStpRTB.FieldToEdit = E_FieldToEdit.Text;
|
||||
ppProcTitleStpRTB.BorderStyle = BorderStyle.Fixed3D;
|
||||
@@ -43,11 +54,12 @@ namespace VEPROMS
|
||||
ppProcNumStpRTB.MyItemInfo = itmInfo;
|
||||
ppProcNumStpRTB.RefreshDisplay(true);
|
||||
|
||||
_MyStepTabRibbon = new StepTabRibbon
|
||||
{
|
||||
Name = "displayTabRibbon1",
|
||||
Visible = false
|
||||
};
|
||||
_MyStepTabRibbon = new StepTabRibbon();
|
||||
//_MyStepTabRibbon.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
//_MyStepTabRibbon.Location = new System.Drawing.Point(0, 0);
|
||||
_MyStepTabRibbon.Name = "displayTabRibbon1";
|
||||
_MyStepTabRibbon.Visible = false;
|
||||
//defaultSettingsVisiblity();
|
||||
}
|
||||
|
||||
private void ppBtnOK_Click(object sender, EventArgs e)
|
||||
@@ -87,7 +99,7 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
public void SaveText(StepRTB myStepRTB)
|
||||
{
|
||||
@@ -106,8 +118,8 @@ namespace VEPROMS
|
||||
{
|
||||
procedureConfigBindingSource.CancelEdit();
|
||||
_ProcedureConfig.MyProcedure.MyProcedureInfo.CreateEnhanced = false;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -144,6 +156,10 @@ namespace VEPROMS
|
||||
if (!(_DefaultChgBarUsrMsg2.Equals("")))
|
||||
ppLblChgBarUserMsgTwoDefault.Text = string.Format("({0})", _DefaultChgBarUsrMsg2);
|
||||
|
||||
// Get the default Print Pagination
|
||||
//_DefaultPagination = _ProcedureConfig.Print_Pagination.ToString();
|
||||
//SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_Pagination), ppLblPaginationDefault, ppCmbxPagination);
|
||||
|
||||
// Get the default Watermark
|
||||
_DefaultWatermark = _ProcedureConfig.Print_Watermark.ToString();
|
||||
SetupDefault(EnumDescConverter.GetEnumDescription(_ProcedureConfig.Print_Watermark), ppLblWatermarkDefault, ppCmbxWatermark);
|
||||
@@ -162,6 +178,8 @@ namespace VEPROMS
|
||||
_Initializing = true;
|
||||
procedureConfigBindingSource.DataSource = _ProcedureConfig;
|
||||
|
||||
//formatInfoListBindingSource.DataSource = FormatInfoList.Get();
|
||||
|
||||
ppCmbxFormat.DataSource = null;
|
||||
ppCmbxFormat.DisplayMember = "FullName";
|
||||
ppCmbxFormat.ValueMember = "FullName";
|
||||
@@ -177,7 +195,7 @@ namespace VEPROMS
|
||||
// Get the saved settings for this user
|
||||
//
|
||||
// This setting tells us if we should display the default values on this property page
|
||||
ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultProcedureProp"] != null) && Settings.Default.ShowDefaultProcedureProp;
|
||||
ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultProcedureProp"] != null) ? Settings.Default.ShowDefaultProcedureProp : false;
|
||||
|
||||
// Get the User's property page style "PropPageStyle" (this is a system wide user setting)
|
||||
// 1 - Button Dialog (default)
|
||||
@@ -186,7 +204,7 @@ namespace VEPROMS
|
||||
{
|
||||
tcProcProp.TabsVisible = true;
|
||||
panProcBtns.Visible = false;
|
||||
Width -= panProcBtns.Width;
|
||||
this.Width -= panProcBtns.Width;
|
||||
}
|
||||
|
||||
// Get the default values for the property page information
|
||||
@@ -212,6 +230,11 @@ namespace VEPROMS
|
||||
ppCmbxChangeBarType.ValueMember = "EValue";
|
||||
ppCmbxChangeBarType.SelectedIndex = -1;
|
||||
|
||||
//ppCmbxPagination.DataSource = EnumDetail<PrintPagination>.Details();
|
||||
//ppCmbxPagination.DisplayMember = "Description";
|
||||
//ppCmbxPagination.ValueMember = "EValue";
|
||||
//ppCmbxPagination.SelectedIndex = -1;
|
||||
|
||||
ppCmbxWatermark.DataSource = EnumDetail<PrintWatermark>.Details();
|
||||
ppCmbxWatermark.DisplayMember = "Description";
|
||||
ppCmbxWatermark.ValueMember = "EValue";
|
||||
@@ -224,7 +247,8 @@ namespace VEPROMS
|
||||
|
||||
// the only time the create enhanced checkbox is visisble is if this is a 'New' procedure in a set that is the 'Source'.
|
||||
cbEnhanced.Visible = false;
|
||||
if (_ProcedureConfig.CreatingNew && _ProcedureConfig.MyProcedure.MyProcedureInfo.MyDocVersion.MyConfig is DocVersionConfig dvc && dvc.MyEnhancedDocuments != null && dvc.MyEnhancedDocuments.Count > 0 && dvc.MyEnhancedDocuments[0].Type != 0)
|
||||
DocVersionConfig dvc = _ProcedureConfig.MyProcedure.MyProcedureInfo.MyDocVersion.MyConfig as DocVersionConfig;
|
||||
if (_ProcedureConfig.CreatingNew && dvc != null && dvc.MyEnhancedDocuments != null && dvc.MyEnhancedDocuments.Count > 0 && dvc.MyEnhancedDocuments[0].Type != 0)
|
||||
cbEnhanced.Visible = true;
|
||||
cbNotIncludeInMerged.Checked = _ProcedureConfig.Print_NotInMergeAll;
|
||||
_Initializing = false;
|
||||
@@ -238,7 +262,10 @@ namespace VEPROMS
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnGeneral_Click(object sender, EventArgs e) => ProcessButtonClick(tiGeneral, btnGeneral);
|
||||
private void btnGeneral_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiGeneral, btnGeneral);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection in Default Column Mode combo box changed.
|
||||
@@ -251,6 +278,14 @@ namespace VEPROMS
|
||||
{
|
||||
FormatColumns fc = (FormatColumns)Enum.Parse(typeof(FormatColumns), _DefaultFormatColumns);
|
||||
ProcessCmbxSelectionEnumChanged(ppCmbxStpEditorCols, fc, ppBtnDefEdCols, ppLblStpEditorColsDefault);
|
||||
//if ((ppCmbxStpEditorCols.SelectedIndex != -1) && ppCmbxStpEditorCols.SelectedValue.Equals(fc))
|
||||
//{
|
||||
// ppBtnDefEdCols.Focus();
|
||||
// ppBtnDefEdCols.PerformClick();
|
||||
//}
|
||||
//ppBtnDefEdCols.Visible = ppCmbxStpEditorCols.SelectedValue != null;
|
||||
//ppLblStpEditorColsDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefEdCols.Visible;
|
||||
//tcpGeneral.Focus();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -269,7 +304,22 @@ namespace VEPROMS
|
||||
if (_InitialIndex < -1) _InitialIndex = ppCmbxFormat.SelectedIndex; // save the current format selection (happens here when current section is set to the default format)
|
||||
}
|
||||
|
||||
private void ppBtnDefaultFmt_Click(object sender, EventArgs e) => ppCmbxFormat.SelectedIndex = -1; //reset to the default Format setting
|
||||
private void ppBtnDefaultFmt_Click(object sender, EventArgs e)
|
||||
{
|
||||
ppCmbxFormat.SelectedIndex = -1; //reset to the default Format setting
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
|
||||
// Commented out as part of code change C2017-004. this also makes it consistent with section properties
|
||||
/// <summary>
|
||||
/// Selection in Format combo box changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
//private void ppCmbxFormat_SelectedValueChanged(object sender, EventArgs e)
|
||||
//{
|
||||
// ProcessCmbxSelectedValueChange(ppCmbxFormat, _DefaultFormatName, ppBtnDefaultFmt, ppLblFormatDefault);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Enable or disable the user specified change bar options base on the type
|
||||
@@ -277,6 +327,14 @@ namespace VEPROMS
|
||||
/// </summary>
|
||||
private void setEnabledUserSpecifiedChgBarCombos(PrintChangeBar pcb)
|
||||
{
|
||||
//ppGpbxUserSpecCB.Enabled =
|
||||
//ppCmbxChgBarPos.Enabled =
|
||||
//ppCmbxChgBarTxtType.Enabled =
|
||||
//ppBtnDefaultCbPos.Enabled =
|
||||
//ppBtnDefCbTxtTyp.Enabled = (ppCmbxChangeBarType.SelectedValue != null &&
|
||||
// ppCmbxChangeBarType.SelectedValue.Equals(ProcedureConfig.PrintChangeBar.WithUserSpecified)) ||
|
||||
// (ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(DocVersionConfig.PrintChangeBar.WithUserSpecified));
|
||||
|
||||
ppGpbxUserSpecCB.Enabled = (ppCmbxChangeBarType.SelectedValue != null &&
|
||||
ppCmbxChangeBarType.SelectedValue.Equals(PrintChangeBar.WithUserSpecified)) ||
|
||||
(ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(PrintChangeBar.WithUserSpecified));
|
||||
@@ -295,6 +353,7 @@ namespace VEPROMS
|
||||
PrintChangeBar pcb = (PrintChangeBar)Enum.Parse(typeof(PrintChangeBar), _DefaultChgBarType);
|
||||
ProcessCmbxSelectionEnumChanged(ppCmbxChangeBarType, pcb, ppBtnDefaultChgBar, ppLblChangeBarTypeDefault);
|
||||
setEnabledUserSpecifiedChgBarCombos(pcb);
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,9 +369,12 @@ namespace VEPROMS
|
||||
// Get the parent setting
|
||||
PrintChangeBar pcb = (PrintChangeBar)Enum.Parse(typeof(PrintChangeBar), _DefaultChgBarType);
|
||||
// Compare parent setting with current setting
|
||||
//_Initializing = true;
|
||||
if (pcb != _ProcedureConfig.Print_ChangeBar)
|
||||
_ProcedureConfig.Print_ChangeBar = pcb; // this will force a database update (write)
|
||||
ppCmbxChangeBarType.SelectedIndex = -1; //reset to the default Change Bar setting
|
||||
//_Initializing = false;
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -326,6 +388,7 @@ namespace VEPROMS
|
||||
{
|
||||
PrintChangeBarLoc cbl = (PrintChangeBarLoc)Enum.Parse(typeof(PrintChangeBarLoc), _DefaultChgBarLoc);
|
||||
ProcessCmbxSelectionEnumChanged(ppCmbxChgBarPos, cbl, ppBtnDefaultCbPos, ppLblChgBarPosDefault);
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,6 +407,7 @@ namespace VEPROMS
|
||||
if (cbl != _ProcedureConfig.Print_ChangeBarLoc)
|
||||
_ProcedureConfig.Print_ChangeBarLoc = cbl; // this will force a database update (write)
|
||||
ppCmbxChgBarPos.SelectedIndex = -1; //reset to the default Change Bar Position setting
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -358,6 +422,7 @@ namespace VEPROMS
|
||||
PrintChangeBarText cbt = (PrintChangeBarText)Enum.Parse(typeof(PrintChangeBarText), _DefaultChgBarText);
|
||||
ProcessCmbxSelectionEnumChanged(ppCmbxChgBarTxtType, cbt, ppBtnDefCbTxtTyp, ppLblChgBarTxtTypeDefault);
|
||||
setEnabledUserSpecifiedChgBarText();
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,6 +441,7 @@ namespace VEPROMS
|
||||
if (cbt != _ProcedureConfig.Print_ChangeBarText)
|
||||
_ProcedureConfig.Print_ChangeBarText = cbt; // this will force a database update (write)
|
||||
ppCmbxChgBarTxtType.SelectedIndex = -1; //reset to the default Change Bar Text Type setting
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -384,6 +450,13 @@ namespace VEPROMS
|
||||
/// </summary>
|
||||
private void setEnabledUserSpecifiedChgBarText()
|
||||
{
|
||||
//ppGpbxUserSpecTxt.Enabled =
|
||||
//ppTxbxChangeBarUserMsgOne.Enabled =
|
||||
//ppTxbxChgBarUserMsgTwo.Enabled =
|
||||
//ppBtnDefCbTxt1.Enabled =
|
||||
//ppBtnDefCbTxt2.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null &&
|
||||
//ppCmbxChgBarTxtType.SelectedValue.Equals(ProcedureConfig.PrintChangeBarText.UserDef));
|
||||
|
||||
// This string is used to check against our default setting to see if User Defined Changebar Text is active
|
||||
string decUserDef = PrintChangeBarText.UserDef.ToString();
|
||||
|
||||
@@ -402,7 +475,43 @@ namespace VEPROMS
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnOutputStngs_Click(object sender, EventArgs e) => ProcessButtonClick(tiOutputStngs, btnOutputStngs);
|
||||
private void btnOutputStngs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiOutputStngs, btnOutputStngs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection in Pagination combo box changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
//private void ppCmbxPagination_SelectedValueChanged(object sender, EventArgs e)
|
||||
//{
|
||||
// if (!_Initializing)
|
||||
// {
|
||||
// PrintPagination pgtn = (PrintPagination)Enum.Parse(typeof(PrintPagination), _DefaultPagination);
|
||||
// ProcessCmbxSelectionEnumChanged(ppCmbxPagination, pgtn, ppBtnDefPagination, ppLblPaginationDefault);
|
||||
// //tcpOutputSettings.Focus();
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Reset to the parent setting.
|
||||
/// Find the parent setting and assign it to _ProcedureConfig.Print_Pagination.
|
||||
/// This will force the database to be updated.
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
//private void ppBtnDefPagination_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// // Get the parent setting
|
||||
// PrintPagination pgtn = (PrintPagination)Enum.Parse(typeof(PrintPagination), _DefaultPagination);
|
||||
// // Compare parent setting with current setting
|
||||
// if (pgtn != _ProcedureConfig.Print_Pagination)
|
||||
// _ProcedureConfig.Print_Pagination = pgtn; // this will force a database update (write)
|
||||
// ppCmbxPagination.SelectedIndex = -1; //reset to the default Pagination setting
|
||||
// //tcpOutputSettings.Focus();
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Selection in Watermark combo box changed.
|
||||
@@ -415,6 +524,7 @@ namespace VEPROMS
|
||||
{
|
||||
PrintWatermark wtr = (PrintWatermark)Enum.Parse(typeof(PrintWatermark), _DefaultWatermark);
|
||||
ProcessCmbxSelectionEnumChanged(ppCmbxWatermark, wtr, ppBtnDefWatermark, ppLblWatermarkDefault);
|
||||
//tcpOutputSettings.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -437,6 +547,19 @@ namespace VEPROMS
|
||||
|
||||
#endregion
|
||||
|
||||
#region View Settings tab
|
||||
|
||||
///// <summary>
|
||||
///// This is the View Settings button used on the button interface design
|
||||
///// </summary>
|
||||
///// <param name="sender">object</param>
|
||||
///// <param name="e">EventArgs</param>
|
||||
//private void btnVwStngs_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// ProcessButtonClick(tiViewStngs, btnVwStngs);
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region Generic functions used on this property page
|
||||
|
||||
/// <summary>
|
||||
@@ -447,6 +570,7 @@ namespace VEPROMS
|
||||
ppLblDefSettingsInfo.Visible = ppCbShwDefSettings.Checked;
|
||||
|
||||
ppLblWatermarkDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefWatermark.Visible;
|
||||
//ppLblPaginationDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefPagination.Visible;
|
||||
ppLblStpEditorColsDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefEdCols.Visible;
|
||||
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
|
||||
ppLblChangeBarTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultChgBar.Visible;
|
||||
@@ -479,6 +603,7 @@ namespace VEPROMS
|
||||
btnGeneral.Checked = false;
|
||||
btnFmtStngs.Checked = false;
|
||||
btnOutputStngs.Checked = false;
|
||||
//btnVwStngs.Checked = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -491,6 +616,7 @@ namespace VEPROMS
|
||||
private void tabpage_Enter(object sender, EventArgs e)
|
||||
{
|
||||
// Show or hide the labels containing the default values
|
||||
//if (!_Initializing)
|
||||
defaultSettingsVisiblity();
|
||||
}
|
||||
|
||||
@@ -532,11 +658,36 @@ namespace VEPROMS
|
||||
button.Visible = (cmbx.SelectedValue != null);
|
||||
deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible;
|
||||
}
|
||||
// Commented out as part of code change C2017-004 - select default format on dropdown
|
||||
///// <summary>
|
||||
///// Process a change in the combo box selection
|
||||
///// </summary>
|
||||
///// <param name="cmbx">Combo Box Name</param>
|
||||
///// <param name="defstr">string containing default text</param>
|
||||
///// <param name="button">button to reset to default value</param>
|
||||
///// <param name="deflabel">label containing the default</param>
|
||||
//private void ProcessCmbxSelectedValueChange(ComboBoxEx cmbx, string defstr, ButtonX button, Label deflabel)
|
||||
//{
|
||||
// if ((cmbx.SelectedIndex != -1) && defstr != null && defstr.Equals(cmbx.SelectedValue))
|
||||
// {
|
||||
// button.Visible = true;
|
||||
// button.Focus();
|
||||
// button.PerformClick();
|
||||
// }
|
||||
// button.Visible = cmbx.SelectedValue != null;
|
||||
// deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible;
|
||||
//}
|
||||
#endregion
|
||||
|
||||
private void ppProcTitleStpRTB_Enter(object sender, EventArgs e) => _MyStepTabRibbon.MyStepRTB = ppProcTitleStpRTB;
|
||||
private void ppProcTitleStpRTB_Enter(object sender, EventArgs e)
|
||||
{
|
||||
_MyStepTabRibbon.MyStepRTB = ppProcTitleStpRTB;
|
||||
}
|
||||
|
||||
private void ppProcNumStpRTB_Enter(object sender, EventArgs e) => _MyStepTabRibbon.MyStepRTB = ppProcNumStpRTB;
|
||||
private void ppProcNumStpRTB_Enter(object sender, EventArgs e)
|
||||
{
|
||||
_MyStepTabRibbon.MyStepRTB = ppProcNumStpRTB;
|
||||
}
|
||||
|
||||
private void ppBtnDefCbTxt1_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -547,7 +698,9 @@ namespace VEPROMS
|
||||
_ProcedureConfig.Print_UserCBMess1 = _DefaultChgBarUsrMsg1;
|
||||
ppLblChgBarUserMsgOneDefault.Visible = false;
|
||||
ppBtnDefCbTxt1.Visible = false;
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void ppBtnDefCbTxt2_Click(object sender, EventArgs e)
|
||||
@@ -559,6 +712,7 @@ namespace VEPROMS
|
||||
_ProcedureConfig.Print_UserCBMess2 = _DefaultChgBarUsrMsg2;
|
||||
ppLblChgBarUserMsgTwoDefault.Visible = false;
|
||||
ppBtnDefCbTxt2.Visible = false;
|
||||
//tcpFormatSettings.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -569,6 +723,7 @@ namespace VEPROMS
|
||||
if (fc != _ProcedureConfig.Format_Columns)
|
||||
_ProcedureConfig.Format_Columns = fc; // this will force a database update (write)
|
||||
ppCmbxStpEditorCols.SelectedIndex = -1; //reset to the default
|
||||
//tcpGeneral.Focus();
|
||||
}
|
||||
|
||||
private void ppBtnDefWatermark_Click_1(object sender, EventArgs e)
|
||||
@@ -579,23 +734,30 @@ namespace VEPROMS
|
||||
if (wtr != _ProcedureConfig.Print_Watermark)
|
||||
_ProcedureConfig.Print_Watermark = wtr; // this will force a database update (write)
|
||||
ppCmbxWatermark.SelectedIndex = -1;
|
||||
//tcpOutputSettings.Focus();
|
||||
}
|
||||
|
||||
|
||||
private void ppTxbxChangeBarUserMsgOne_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ppBtnDefCbTxt1.Visible = (ppTxbxChangeBarUserMsgOne.Text != null) && !ppTxbxChangeBarUserMsgOne.Text.Equals(_DefaultChgBarUsrMsg1);
|
||||
ppBtnDefCbTxt1.Visible = ((ppTxbxChangeBarUserMsgOne.Text != null) && !ppTxbxChangeBarUserMsgOne.Text.Equals(_DefaultChgBarUsrMsg1));
|
||||
ppLblChgBarUserMsgOneDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt1.Visible;
|
||||
//tcpOutputSettings.Focus();
|
||||
}
|
||||
|
||||
private void ppTxbxChgBarUserMsgTwo_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
ppBtnDefCbTxt2.Visible = ((ppTxbxChgBarUserMsgTwo.Text != null) && !ppTxbxChgBarUserMsgTwo.Text.Equals(_DefaultChgBarUsrMsg2));
|
||||
ppLblChgBarUserMsgTwoDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt2.Visible;
|
||||
//tcpOutputSettings.Focus();
|
||||
}
|
||||
|
||||
|
||||
private void frmProcedureProperties_Shown(object sender, EventArgs e) => ppProcNumStpRTB.Focus();
|
||||
private void frmProcedureProperties_Shown(object sender, EventArgs e)
|
||||
{
|
||||
ppProcNumStpRTB.Focus();
|
||||
|
||||
}
|
||||
|
||||
private void ppCmbxFormat_DropDown(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
@@ -6,7 +11,7 @@ namespace VEPROMS
|
||||
{
|
||||
public partial class frmPropGrid : DevComponents.DotNetBar.Office2007Form
|
||||
{
|
||||
private readonly object _PGobject;
|
||||
private object _PGobject;
|
||||
|
||||
public frmPropGrid(object pgobject)
|
||||
{
|
||||
@@ -18,23 +23,24 @@ namespace VEPROMS
|
||||
{
|
||||
InitializeComponent();
|
||||
_PGobject = pgobject;
|
||||
Text = title;
|
||||
this.Text = title;
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.OK;
|
||||
if (_PGobject is DocVersionConfig dvcfg && dvcfg.IsDirty)
|
||||
{
|
||||
dvcfg.MyDocVersion.Save();
|
||||
}
|
||||
Close();
|
||||
DocVersionConfig dvcfg = this._PGobject as DocVersionConfig;
|
||||
if (dvcfg != null && dvcfg.IsDirty)
|
||||
{
|
||||
dvcfg.MyDocVersion.Save();
|
||||
}
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void frmPropGrid_Load(object sender, EventArgs e)
|
||||
@@ -45,23 +51,39 @@ namespace VEPROMS
|
||||
|
||||
private void pg_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
|
||||
{
|
||||
if (_PGobject is DocVersionConfig dvcfg)
|
||||
dvcfg.IsDirty = true;
|
||||
// check if folder config & if so, check for name change
|
||||
if (_PGobject is FolderConfig tstfoldercfg)
|
||||
{
|
||||
if ((string)e.OldValue != tstfoldercfg.Name)
|
||||
{
|
||||
bool isunique = tstfoldercfg.CheckUniqueName(tstfoldercfg.Name);
|
||||
if (!isunique)
|
||||
{
|
||||
MessageBox.Show(string.Format("The Name '{0}' that was entered is not a unique folder name", tstfoldercfg.Name));
|
||||
tstfoldercfg.Name = (string)e.OldValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
Refresh();
|
||||
DocVersionConfig dvcfg = this._PGobject as DocVersionConfig;
|
||||
if (dvcfg != null)
|
||||
dvcfg.IsDirty = true;
|
||||
// check if folder config & if so, check for name change
|
||||
FolderConfig tstfoldercfg = this._PGobject as FolderConfig;
|
||||
if (tstfoldercfg != null)
|
||||
{
|
||||
if ((string)e.OldValue != tstfoldercfg.Name)
|
||||
{
|
||||
bool isunique = tstfoldercfg.CheckUniqueName(tstfoldercfg.Name);
|
||||
if (!isunique)
|
||||
{
|
||||
MessageBox.Show(string.Format("The Name '{0}' that was entered is not a unique folder name", tstfoldercfg.Name));
|
||||
tstfoldercfg.Name = (string)e.OldValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.Refresh();
|
||||
|
||||
}
|
||||
}
|
||||
//public partial class SystemConfig
|
||||
//{
|
||||
// FolderConfig _FolderConfig;
|
||||
// public SystemConfig(FolderConfig folderConfig)
|
||||
// {
|
||||
// _FolderConfig = folderConfig;
|
||||
// //_FolderConfig.Default_SPPrefix;
|
||||
// }
|
||||
// public string Default_SPPrefix
|
||||
// {
|
||||
// get { return _FolderConfig.Default_SPPrefix; }
|
||||
// set { _FolderConfig.Default_SPPrefix = value; }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using VEPROMS.CSLA.Library;
|
||||
@@ -12,8 +15,13 @@ namespace VEPROMS
|
||||
{
|
||||
public partial class frmRODbProperties : Form
|
||||
{
|
||||
public ProgressBarItem ProgressBar { get; set; } = null;
|
||||
private void DoProgressBarRefresh(int value, int max, string text)
|
||||
private ProgressBarItem _ProgressBar = null;
|
||||
public ProgressBarItem ProgressBar
|
||||
{
|
||||
get { return _ProgressBar; }
|
||||
set { _ProgressBar = value; }
|
||||
}
|
||||
private void DoProgressBarRefresh(int value, int max, string text)
|
||||
{
|
||||
if (ProgressBar == null) return;
|
||||
ProgressBar.Value = value;
|
||||
@@ -21,30 +29,54 @@ namespace VEPROMS
|
||||
ProgressBar.Text = text;
|
||||
Application.DoEvents();
|
||||
}
|
||||
private string InitialProgressBarMessage
|
||||
{
|
||||
set
|
||||
{
|
||||
if (ProgressBar == null) return;
|
||||
ProgressBar.Value = 100;
|
||||
ProgressBar.Maximum = 100;
|
||||
ProgressBar.Text = value;
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
private string FinalProgressBarMessage
|
||||
{
|
||||
set
|
||||
{
|
||||
if (ProgressBar == null) return;
|
||||
ProgressBar.Value = 100;
|
||||
ProgressBar.Maximum = 100;
|
||||
ProgressBar.Text = value;
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
private Point _ParentLocation;
|
||||
public Point ParentLocation
|
||||
{
|
||||
get { return _ParentLocation; }
|
||||
set { _ParentLocation = value; }
|
||||
}
|
||||
private readonly RODbInfo _roDbInfo;
|
||||
private readonly string _origROName;
|
||||
private readonly string _origFolderPath;
|
||||
private readonly string _origSQLConnect = null;
|
||||
private readonly DocVersion _docVersion;
|
||||
private RODbInfo _roDbInfo;
|
||||
private string _origROName;
|
||||
private string _origFolderPath;
|
||||
private string _origSQLConnect = null;
|
||||
private DocVersion _docVersion;
|
||||
public frmRODbProperties(DocVersion docVersion, RODbInfo roDbInfo)
|
||||
{
|
||||
_roDbInfo = roDbInfo;
|
||||
_docVersion = docVersion;
|
||||
InitializeComponent();
|
||||
_origROName = _roDbInfo?.ROName;
|
||||
_origFolderPath = _roDbInfo?.FolderPath;
|
||||
_origROName = (_roDbInfo == null) ? null : _roDbInfo.ROName;
|
||||
_origFolderPath = (_roDbInfo == null) ? null : _roDbInfo.FolderPath;
|
||||
_origSQLConnect = (_roDbInfo == null) ? null : (_roDbInfo.DBConnectionString == null || _roDbInfo.DBConnectionString == "" || _roDbInfo.DBConnectionString == "cstring") ? null : _roDbInfo.DBConnectionString;
|
||||
// Disable the OK button when initialized. Enable it if the user makes changes
|
||||
ppBtnTestSQL.Visible = ppBtnTestSQL.Enabled = ppTxtSQL.Visible = ppTxtSQL.Enabled = ppLblSQL.Visible = CanMigrateRoAccessToSql();
|
||||
ppBtnTestSQL.Visible = ppBtnTestSQL.Enabled = CanMigrateRoAccessToSql(roDbInfo);
|
||||
ppTxtSQL.Visible = ppTxtSQL.Enabled = CanMigrateRoAccessToSql(roDbInfo);
|
||||
ppLblSQL.Visible = CanMigrateRoAccessToSql(roDbInfo);
|
||||
ppBtnOk.Enabled = false;
|
||||
}
|
||||
private bool CanMigrateRoAccessToSql()
|
||||
private bool CanMigrateRoAccessToSql(RODbInfo rODbi)
|
||||
{
|
||||
// C2017-003: This method is used to determine whether the sql server version can be used & if there is data.
|
||||
// A command line argument 'RoInSql'. For now, this argument must be used to allow code to run for ro->sql. Later
|
||||
@@ -60,12 +92,10 @@ namespace VEPROMS
|
||||
}
|
||||
private void ppBtnFldrDlg_Click(object sender, EventArgs e)
|
||||
{
|
||||
FolderBrowserDialog dlgROFolder = new FolderBrowserDialog
|
||||
{
|
||||
// Initialize the starting location in the Browser window
|
||||
SelectedPath = ppTxtPath.Text
|
||||
};
|
||||
if (dlgROFolder.ShowDialog() == DialogResult.OK)
|
||||
FolderBrowserDialog dlgROFolder = new FolderBrowserDialog();
|
||||
// Initialize the starting location in the Browser window
|
||||
dlgROFolder.SelectedPath = ppTxtPath.Text;
|
||||
if (dlgROFolder.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
ppTxtPath.Text = dlgROFolder.SelectedPath;
|
||||
}
|
||||
@@ -111,7 +141,7 @@ namespace VEPROMS
|
||||
catch (SqlException) { }
|
||||
}
|
||||
}
|
||||
catch (Exception) { }
|
||||
catch (Exception ex) {}
|
||||
if (canconnect)
|
||||
roDb.DBConnectionString = (ppTxtSQL.Text == null || ppTxtSQL.Text == "") ? "cstring" : ppTxtSQL.Text;
|
||||
else
|
||||
@@ -198,7 +228,7 @@ namespace VEPROMS
|
||||
string rofstPath = ppTxtPath.Text + @"\ro.fst";
|
||||
if (!File.Exists(rofstPath))
|
||||
{
|
||||
MessageBox.Show($"No existing ro.fst in path {ppTxtPath.Text}. Check for invalid path");
|
||||
MessageBox.Show("No existing ro.fst in path " + ppTxtPath.Text + ". Check for invalid path");
|
||||
return;
|
||||
}
|
||||
string connectstr = ppTxtSQL.Text != null && ppTxtSQL.Text != "" ? ppTxtExt.Text : "cstring";
|
||||
@@ -212,8 +242,8 @@ namespace VEPROMS
|
||||
private void frmRODbProperties_Load(object sender, EventArgs e)
|
||||
{
|
||||
Location = ParentLocation;
|
||||
ppRTxtName.Text = _roDbInfo?.ROName;
|
||||
ppTxtPath.Text = _roDbInfo?.FolderPath;
|
||||
ppRTxtName.Text = (_roDbInfo == null) ? null : _roDbInfo.ROName;
|
||||
ppTxtPath.Text = (_roDbInfo == null) ? null : _roDbInfo.FolderPath;
|
||||
ppTxtSQL.Text = (_roDbInfo == null) ? null : (_roDbInfo.DBConnectionString == "cstring") ? null : _roDbInfo.DBConnectionString;
|
||||
RODbConfig cfg = (_roDbInfo == null) ? new RODbConfig() : new RODbConfig(_roDbInfo);
|
||||
// Note that the Graphic Extension data is shown in a non-editable text box here because
|
||||
@@ -221,17 +251,15 @@ namespace VEPROMS
|
||||
// the file system. Otherwise it is derived from the top node - and changed from folder
|
||||
// properties on the top node. And lastly, it is the code default.
|
||||
ppTxtExt.Text = cfg.GetDefaultGraphicExtension();
|
||||
ppLblGraphicFileExtLoc.Text = cfg?.GetDefaultGraphicExtensionLocation();
|
||||
ppLblGraphicFileExtLoc.Text = (cfg == null) ? null : cfg.GetDefaultGraphicExtensionLocation();
|
||||
ppBtnOk.Enabled = false;
|
||||
if (_roDbInfo == null)
|
||||
{
|
||||
string newFolderPath = null;
|
||||
FolderBrowserDialog dlgROFolder = new FolderBrowserDialog
|
||||
{
|
||||
RootFolder = Environment.SpecialFolder.MyComputer,
|
||||
SelectedPath = ppTxtPath.Text
|
||||
};
|
||||
if (dlgROFolder.ShowDialog() == DialogResult.OK)
|
||||
FolderBrowserDialog dlgROFolder = new FolderBrowserDialog();
|
||||
dlgROFolder.RootFolder = Environment.SpecialFolder.MyComputer;
|
||||
dlgROFolder.SelectedPath = ppTxtPath.Text;
|
||||
if (dlgROFolder.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
newFolderPath = dlgROFolder.SelectedPath;
|
||||
RODbInfoList allRODBs = RODbInfoList.Get();
|
||||
@@ -247,6 +275,8 @@ namespace VEPROMS
|
||||
}
|
||||
ppTxtPath.Text = newFolderPath;
|
||||
}
|
||||
// Initialize the enabled status for the OK button to false.
|
||||
//ppBtnOk.Enabled = false;
|
||||
ppTxtPath.TextChanged += ppTxtPath_TextChanged;
|
||||
}
|
||||
void ppTxtPath_TextChanged(object sender, EventArgs e)
|
||||
@@ -283,7 +313,7 @@ namespace VEPROMS
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show($"Connection failed: {ex}");
|
||||
MessageBox.Show("Connection failed: " + ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
@@ -10,16 +12,14 @@ namespace VEPROMS
|
||||
{
|
||||
public partial class frmSI : Form
|
||||
{
|
||||
private readonly StepTabRibbon _MyStepTabRibbon;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private Dictionary<string, StepRTB> _DicStepRtb;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private Dictionary<string, CheckBox> _DicCheckBox;
|
||||
private readonly bool DoFolder = true;
|
||||
private readonly SI SIDialogDef = null;
|
||||
private readonly string OrigConfig = null;
|
||||
private readonly FolderInfo MyFolderInfo = null;
|
||||
private readonly DocVersionInfo MyDocVersionInfo = null;
|
||||
private StepTabRibbon _MyStepTabRibbon;
|
||||
private Dictionary<string, StepRTB> _DicStepRtb;
|
||||
private Dictionary<string, CheckBox> _DicCheckBox;
|
||||
private bool DoFolder = true;
|
||||
private SI SIDialogDef = null;
|
||||
private string OrigConfig = null;
|
||||
private FolderInfo MyFolderInfo = null;
|
||||
private DocVersionInfo MyDocVersionInfo = null;
|
||||
public frmSI(SI siDialogDef, string config, bool doFolder, FolderInfo fi, DocVersionInfo dvi)
|
||||
{
|
||||
DoFolder = doFolder;
|
||||
@@ -36,23 +36,22 @@ namespace VEPROMS
|
||||
|
||||
private void InitializeSpecificControls()
|
||||
{
|
||||
Text = SIDialogDef.Caption;
|
||||
Location = new Point((int)SIDialogDef.x * 2, (int)SIDialogDef.y * 2);
|
||||
this.Text = SIDialogDef.Caption;
|
||||
this.Location = new Point((int)SIDialogDef.x * 2, (int)SIDialogDef.y * 2);
|
||||
int maxx = 0;
|
||||
int maxy = 0;
|
||||
int xB4Scroll = 900;
|
||||
int yB4Scroll = 630;
|
||||
panelSI.AutoScroll = false;
|
||||
this.panelSI.AutoScroll = false;
|
||||
foreach (SILabel lbl in SIDialogDef.LabelList)
|
||||
{
|
||||
Label wlbl = new Label
|
||||
{
|
||||
Text = lbl.text,
|
||||
Location = new Point((int)lbl.x * 2, (int)lbl.y * 2),
|
||||
AutoSize = true,
|
||||
Visible = true
|
||||
};
|
||||
panelSI.Controls.Add(wlbl);
|
||||
Label wlbl = new Label();
|
||||
wlbl.Text = lbl.text;
|
||||
wlbl.Location = new Point((int)lbl.x * 2, (int)lbl.y * 2);
|
||||
wlbl.AutoSize = true;
|
||||
//wlbl.Size = new Size((int)lbl.width * 2, (int)lbl.height * 2);
|
||||
wlbl.Visible = true;
|
||||
this.panelSI.Controls.Add(wlbl);
|
||||
maxx = ((int)lbl.x * 2 + (int)lbl.width * 2) > maxx ? ((int)lbl.x * 2 + (int)lbl.width * 2) : maxx;
|
||||
maxy = ((int)lbl.y * 2 + (int)lbl.height * 2) > maxy ? ((int)lbl.y * 2 + (int)lbl.height * 2) : maxy;
|
||||
}
|
||||
@@ -71,7 +70,7 @@ namespace VEPROMS
|
||||
// (Removed the frmSI specific contextmenustrip1)
|
||||
tb.FieldToEdit = E_FieldToEdit.PSI;
|
||||
tb.BorderStyle = BorderStyle.FixedSingle;
|
||||
tb.Enter += new System.EventHandler(FieldStepRTB_Enter);
|
||||
tb.Enter += new System.EventHandler(this.FieldStepRTB_Enter);
|
||||
// see if config has data for this field, i.e. search for the 'name'
|
||||
// B2019-133 continuation of B2018-057 Replace non-breaking hyphen with hyphen.
|
||||
string val = (DoFolder ? folderConfig.GetValue("SI", fld.name) : dvConfig.GetValue("SI", fld.name)).Replace("\\u8209?", "-");
|
||||
@@ -79,12 +78,12 @@ namespace VEPROMS
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 Arial;}");
|
||||
sb.Append(@"{\f1\fnil\fcharset0 Arial;}}{\colortbl ;\red255\green0\blue0;}"); // C2017-036 Microsoft removed Arial Unicode MS with Word16
|
||||
sb.Append(@"\viewkind4\uc1\pard\sl-240\slmult0\fs" + (int)(Font.SizeInPoints*2) + " " + dt.StartText + @"}");
|
||||
sb.Append(@"\viewkind4\uc1\pard\sl-240\slmult0\fs" + (int)(this.Font.SizeInPoints*2) + " " + dt.StartText + @"}");
|
||||
tb.Rtf = sb.ToString();
|
||||
tb.Location = new Point((int)fld.x * 2, (int)fld.y * 2);
|
||||
tb.Size = new Size((int)fld.width * 2, (int)fld.height * 2);
|
||||
tb.Visible = true;
|
||||
panelSI.Controls.Add(tb);
|
||||
this.panelSI.Controls.Add(tb);
|
||||
maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx;
|
||||
maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy;
|
||||
}
|
||||
@@ -97,8 +96,8 @@ namespace VEPROMS
|
||||
cb.Visible = true;
|
||||
cb.Width = (int)fld.width * 2;
|
||||
string val = DoFolder ? folderConfig.GetValue("SI", fld.name) : dvConfig.GetValue("SI", fld.name);
|
||||
cb.Checked = val !=null && val!="" && val.ToUpper()[0] == 'Y';
|
||||
panelSI.Controls.Add(cb);
|
||||
cb.Checked = val!=null && val!="" && val.ToUpper()[0] == 'Y' ? true : false;
|
||||
this.panelSI.Controls.Add(cb);
|
||||
maxx = ((int)fld.x * 2 + (int)fld.width * 2) > maxx ? ((int)fld.x * 2 + (int)fld.width * 2) : maxx;
|
||||
maxy = ((int)fld.y * 2 + (int)fld.height * 2) > maxy ? ((int)fld.y * 2 + (int)fld.height * 2) : maxy;
|
||||
}
|
||||
@@ -106,19 +105,19 @@ namespace VEPROMS
|
||||
if (maxx > xB4Scroll)
|
||||
{
|
||||
maxx = xB4Scroll;
|
||||
panelSI.Width = xB4Scroll;
|
||||
panelSI.AutoScroll = true;
|
||||
this.panelSI.Width = xB4Scroll;
|
||||
this.panelSI.AutoScroll = true;
|
||||
}
|
||||
else
|
||||
panelSI.Width = maxx + 50;
|
||||
this.panelSI.Width = maxx + 50;
|
||||
if (maxy > yB4Scroll)
|
||||
{
|
||||
maxy = yB4Scroll;
|
||||
panelSI.Height = yB4Scroll;
|
||||
panelSI.AutoScroll = true;
|
||||
this.panelSI.Height = yB4Scroll;
|
||||
this.panelSI.AutoScroll = true;
|
||||
}
|
||||
else
|
||||
panelSI.Height = maxy + 50;
|
||||
this.panelSI.Height = maxy + 50;
|
||||
if (SIDialogDef.ButtonsOnBottom == null || SIDialogDef.ButtonsOnBottom.ToUpper() == "NO")
|
||||
{
|
||||
btnOk.Location = new Point(maxx+70, 30);
|
||||
@@ -190,20 +189,29 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// B2017-024 - added a clip board context menu
|
||||
private void fwdCMCbCut_Click(object sender, EventArgs e) => SendKeys.Send("^x"); // <cltr><x>
|
||||
// B2017-024 - added a clip board context menu
|
||||
private void fwdCMCbCut_Click(object sender, EventArgs e)
|
||||
{
|
||||
SendKeys.Send("^x"); // <cltr><x>
|
||||
}
|
||||
|
||||
private void fwdCMCbCopy_Click(object sender, EventArgs e) => SendKeys.Send("^c"); // <cltr><c>
|
||||
private void fwdCMCbCopy_Click(object sender, EventArgs e)
|
||||
{
|
||||
SendKeys.Send("^c"); // <cltr><c>
|
||||
}
|
||||
|
||||
private void fwdCMCbPaste_Click(object sender, EventArgs e) => SendKeys.Send("^v"); // <cltr><v>
|
||||
}
|
||||
private void fwdCMCbPaste_Click(object sender, EventArgs e)
|
||||
{
|
||||
SendKeys.Send("^v"); // <cltr><v>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using VEPROMS.Properties;
|
||||
@@ -8,7 +12,6 @@ using DevComponents.DotNetBar.Controls;
|
||||
using Volian.Controls.Library;
|
||||
using DescriptiveEnum;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
@@ -17,10 +20,11 @@ namespace VEPROMS
|
||||
private string _DefaultFormatName = null;
|
||||
private string _DefaultNumColumns = null;
|
||||
private string _DefaultPaginationStyle = null;
|
||||
private string _DefaultPrintSize = null;
|
||||
private bool _Initializing;
|
||||
private readonly SectionConfig _SectionConfig;
|
||||
private Document _DocumentToDelete = null;
|
||||
private readonly StepTabRibbon _MyStepTabRibbon;
|
||||
private SectionConfig _SectionConfig;
|
||||
private Document _DocumentToDelete = null;
|
||||
private StepTabRibbon _MyStepTabRibbon;
|
||||
private bool _isStepSection = true;
|
||||
private bool _hasSectionCheckoffDefault = false;
|
||||
private bool _isDefaultStepSection = false;
|
||||
@@ -31,30 +35,36 @@ namespace VEPROMS
|
||||
InitializeComponent();
|
||||
btnGeneral.PerformClick(); // always start with General tab or button
|
||||
ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID);
|
||||
//if (sectionConfig.Number.Length > 0)
|
||||
// this.Text = string.Format("{0} {1} Properties", sectionConfig.Number, sectionConfig.Title);
|
||||
//else
|
||||
// this.Text = string.Format("{0} Properties", sectionConfig.Title);
|
||||
if (sectionConfig.Number.Length > 0)
|
||||
Text = $"{ii.DisplayNumber} {ii.DisplayText} Properties";
|
||||
this.Text = string.Format("{0} {1} Properties", ii.DisplayNumber, ii.DisplayText);
|
||||
else
|
||||
Text = $"{ii.DisplayText} Properties";
|
||||
this.Text = string.Format("{0} Properties", ii.DisplayText);
|
||||
ppSectTitleStpRTB.Font = ppSectTitleStpRTB.FormatFont = new System.Drawing.Font("Microsoft Sans Serif", 10F);
|
||||
ppSectTitleStpRTB.FieldToEdit = E_FieldToEdit.Text;
|
||||
ppSectTitleStpRTB.BorderStyle = BorderStyle.Fixed3D;
|
||||
ppSectTitleStpRTB.MyItemInfo = ii;
|
||||
ppSectTitleStpRTB.RefreshDisplay(true);
|
||||
ppSectNumberStpRTB.Font = ppSectNumberStpRTB.FormatFont = new System.Drawing.Font("Microsoft Sans Serif", 10F);
|
||||
ppSectNumberStpRTB.Font = this.ppSectNumberStpRTB.FormatFont = new System.Drawing.Font("Microsoft Sans Serif", 10F);
|
||||
ppSectNumberStpRTB.FieldToEdit = E_FieldToEdit.Number;
|
||||
ppSectNumberStpRTB.BorderStyle = BorderStyle.Fixed3D;
|
||||
ppSectNumberStpRTB.MyItemInfo = ii;
|
||||
ppSectNumberStpRTB.RefreshDisplay(true);
|
||||
_MyStepTabRibbon = new StepTabRibbon
|
||||
{
|
||||
Name = "displayTabRibbon1",
|
||||
Visible = false
|
||||
};
|
||||
_MyStepTabRibbon = new StepTabRibbon();
|
||||
//_MyStepTabRibbon.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
//_MyStepTabRibbon.Location = new System.Drawing.Point(0, 0);
|
||||
_MyStepTabRibbon.Name = "displayTabRibbon1";
|
||||
_MyStepTabRibbon.Visible = false;
|
||||
|
||||
// B2017-272 disable/enable the Steps and Word radio buttons based on the section types defined in the format
|
||||
// and the type of an existing section or if we are creating a new section.
|
||||
// Move the check of creating a new section into CheckAvailableSectionTypes()
|
||||
CheckAvaibleSectionTypes();
|
||||
//// if creating a new section, enable the StepSect and WordSect radio buttons
|
||||
//rbStepSect.Enabled = rbWordSect.Enabled = !(ii.HasWordContent || ii.HasStepContent);
|
||||
|
||||
// if this is an auto table of contents (mydocstyle == null if new section, so must check for that first)
|
||||
if (ii.IsAutoTOCSection)
|
||||
@@ -171,14 +181,15 @@ namespace VEPROMS
|
||||
{
|
||||
// find first section in list that has originalsteps (flags a default section)
|
||||
int defsctId = 0;
|
||||
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections.OfType<SectionInfo>())
|
||||
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections)
|
||||
{
|
||||
if (si.ItemID != _SectionConfig.MySection.ItemID && si.MyConfig is SectionConfig sc && sc.Section_OriginalSteps == "Y")
|
||||
{
|
||||
defsctId = si.ItemID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
SectionConfig sc = si.MyConfig as SectionConfig;
|
||||
if (si.ItemID != _SectionConfig.MySection.ItemID && sc != null && sc.Section_OriginalSteps == "Y")
|
||||
{
|
||||
defsctId = si.ItemID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (defsctId != 0)
|
||||
{
|
||||
// also need to set the procedure's config sectionstart to the selected section
|
||||
@@ -198,18 +209,19 @@ namespace VEPROMS
|
||||
// this property set - it is used when printing page numbers with 'WithSteps' numbering sequence.
|
||||
else if (!_isDefaultStepSection && ppCbDefaultStepSection.Checked)
|
||||
{
|
||||
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections.OfType<SectionInfo>())
|
||||
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections)
|
||||
{
|
||||
if (si.ItemID != _SectionConfig.MySection.ItemID && si.MyConfig is SectionConfig sc && sc.Section_OriginalSteps == "Y")
|
||||
{
|
||||
using (Section ssav = si.Get())
|
||||
{
|
||||
ssav.SectionConfig.Section_OriginalSteps = "N";
|
||||
ssav.Save();
|
||||
ItemInfo.Refresh(ssav);
|
||||
}
|
||||
}
|
||||
}
|
||||
SectionConfig sc = si.MyConfig as SectionConfig;
|
||||
if (si.ItemID != _SectionConfig.MySection.ItemID && sc != null && sc.Section_OriginalSteps == "Y")
|
||||
{
|
||||
using (Section ssav = si.Get())
|
||||
{
|
||||
ssav.SectionConfig.Section_OriginalSteps = "N";
|
||||
ssav.Save();
|
||||
ItemInfo.Refresh(ssav);
|
||||
}
|
||||
}
|
||||
}
|
||||
// also need to set the procedure's config sectionstart to the selected section
|
||||
// if it is not set:
|
||||
using (Procedure p = Procedure.Get(_SectionConfig.MySection.MySectionInfo.MyProcedure.ItemID))
|
||||
@@ -241,8 +253,8 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
}
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
public void SaveText(StepRTB myStepRTB)
|
||||
{
|
||||
@@ -257,7 +269,7 @@ namespace VEPROMS
|
||||
myStepRTB.ClearUndo();
|
||||
}
|
||||
}
|
||||
|
||||
//private static void FinishSectionSave(Section section)
|
||||
private void FinishSectionSave(Section section)
|
||||
{
|
||||
ItemInfo sectinfo = ItemInfo.Get(section.ItemID);
|
||||
@@ -293,7 +305,7 @@ namespace VEPROMS
|
||||
_DocumentToDelete = null;
|
||||
sectionConfigBindingSource.CancelEdit();
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -308,6 +320,12 @@ namespace VEPROMS
|
||||
// Get the default format name
|
||||
_DefaultFormatName = _SectionConfig.DefaultFormatSelection;
|
||||
SetupDefault(_DefaultFormatName, ppLblFormatDefault, ppCmbxFormat);
|
||||
//if (_DefaultFormatName != null && !(_DefaultFormatName.Equals("")))
|
||||
//{
|
||||
// string defName = string.Format("{0}", _DefaultFormatName);
|
||||
// ppLblFormatDefault.Text = defName;
|
||||
// ppCmbxFormat.WatermarkText = defName;
|
||||
//}
|
||||
SectionConfig.SectionColumnMode sc = _SectionConfig.Section_ColumnMode;
|
||||
_DefaultNumColumns = sc.ToString();
|
||||
SetupDefault(EnumDescConverter.GetEnumDescription(sc), ppLblDefaultNumColumns, ppCmbxNumColumns);
|
||||
@@ -315,6 +333,8 @@ namespace VEPROMS
|
||||
//Console.WriteLine("{0}, {1}, default pagination", _SectionConfig.MySection.DisplayNumber, sp);
|
||||
_DefaultPaginationStyle = sp.ToString();
|
||||
SetupDefault(EnumDescConverter.GetEnumDescription(sp), ppLblDefPaginationStyle, ppCmbxSectPagination);
|
||||
//_DefaultPrintSize = _SectionConfig.Section_AttachmentPrintSize.ToString();
|
||||
//SetupDefault(EnumDescConverter.GetEnumDescription(_SectionConfig.Section_AttachmentPrintSize), ppLblDefaultPrintSize, ppCmbxAccPgPrintSize);
|
||||
|
||||
_SectionConfig.ParentLookup = false;
|
||||
}
|
||||
@@ -329,7 +349,7 @@ namespace VEPROMS
|
||||
{
|
||||
if (defaultText != null && !(defaultText.Equals("")))
|
||||
{
|
||||
string deftext = $"{defaultText}";
|
||||
string deftext = string.Format("{0}", defaultText);
|
||||
lbl.Text = deftext;
|
||||
cmbo.WatermarkText = deftext;
|
||||
}
|
||||
@@ -345,7 +365,7 @@ namespace VEPROMS
|
||||
ppCmbxFormat.DisplayMember = "FullName";
|
||||
ppCmbxFormat.ValueMember = "FullName";
|
||||
ppCmbxFormat.DataSource = FormatUtility.GetFilteredFormatList(FormatInfoList.SortedFormatInfoList);
|
||||
if (_SectionConfig.MySection.MySectionInfo.ActiveFormat != null) _cmbxformatOriginal = (int)_SectionConfig.MySection.MySectionInfo.ActiveFormat.FormatID;
|
||||
if (_SectionConfig.MySection.MySectionInfo.ActiveFormat != null) _cmbxformatOriginal = (int)_SectionConfig.MySection.MySectionInfo.ActiveFormat.FormatID;
|
||||
if (_SectionConfig.FormatSelection != null)
|
||||
ppCmbxFormat.SelectedValue = _SectionConfig.FormatSelection;
|
||||
else
|
||||
@@ -353,7 +373,7 @@ namespace VEPROMS
|
||||
// Get the saved settings for this user
|
||||
//
|
||||
// Get setting telling us whether to display the default values on this property page
|
||||
ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultSectionProp"] != null) && Settings.Default.ShowDefaultSectionProp;
|
||||
ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultSectionProp"] != null) ? Settings.Default.ShowDefaultSectionProp : false;
|
||||
|
||||
// Get the User's property page style "PropPageStyle" (this is a system wide user setting)
|
||||
// 1 - Button Dialog (default)
|
||||
@@ -362,7 +382,7 @@ namespace VEPROMS
|
||||
{
|
||||
tcSectionProp.TabsVisible = true;
|
||||
panSectBtns.Visible = false;
|
||||
Width -= panSectBtns.Width;
|
||||
this.Width -= panSectBtns.Width;
|
||||
}
|
||||
|
||||
// Get the default values for the property page information
|
||||
@@ -399,10 +419,24 @@ namespace VEPROMS
|
||||
ppBtnDefaultNumColumns.Visible = false;
|
||||
ppCmbxNumColumns.SelectedValueChanged += new EventHandler(ppCmbxNumColumns_SelectedValueChanged);
|
||||
|
||||
//ppCmbxAccPgPrintSize.DataSource = EnumDetail<SectionConfig.AttPrintSize>.Details();
|
||||
//ppCmbxAccPgPrintSize.DisplayMember = "Description";
|
||||
//ppCmbxAccPgPrintSize.ValueMember = "Evalue";
|
||||
//ppCmbxAccPgPrintSize.SelectedIndex = -1;
|
||||
|
||||
if (!_isStepSection)
|
||||
ppCmbxLibDocFill();
|
||||
|
||||
// check type of section from document styles to determine if the stepsection checkbox should
|
||||
// be checked.
|
||||
//int secindx = (int)_SectionConfig.SectionType;
|
||||
//// find the index for the document style to determine whether this is a step or word section.
|
||||
PlantFormat pf = _SectionConfig.MyFormat != null ? _SectionConfig.MyFormat.PlantFormat : _SectionConfig.MyDefaultFormat.PlantFormat;
|
||||
//for (int i = 0; i < pf.DocStyles.DocStyleList.Count; i++)
|
||||
//{
|
||||
// if (pf.DocStyles.DocStyleList[i].Index == secindx)
|
||||
// rbStepSect.Checked = pf.DocStyles.DocStyleList[i].IsStepSection; _SectionConfig.MySection.
|
||||
//}
|
||||
|
||||
// set the StepSect radio button based on _isStepSection to ensure the proper section types are available
|
||||
rbStepSect.Checked = _isStepSection;
|
||||
@@ -421,6 +455,7 @@ namespace VEPROMS
|
||||
// show the automatic indent checkbox.
|
||||
ppCbEditableData.Enabled = _SectionConfig.MySection.MySectionInfo.Sections != null && _SectionConfig.MySection.MySectionInfo.Sections.Count > 0;
|
||||
ppCbEditableData.Visible = _isStepSection; // only display if we are on a step editor section
|
||||
//ppCbAutoIndent.Enabled = _SectionConfig.MySection.MySectionInfo.Sections != null && _SectionConfig.MySection.MySectionInfo.Sections.Count > 0;
|
||||
ppCbAutoIndent.Enabled = pf.FormatData.SectData.UseMetaSections;
|
||||
ppCbAutoIndent.Visible = _isStepSection; // only display if we are on a step editor section
|
||||
|
||||
@@ -458,6 +493,8 @@ namespace VEPROMS
|
||||
ppCbPlaceKeeper.Enabled = _isStepSection;
|
||||
if (!_isStepSection && (_SectionConfig.MySection.MySectionInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.Placekeeper) == E_DocStructStyle.Placekeeper)
|
||||
{
|
||||
//ppCbPlaceKeeper.Text = "Auto Generate Placekeeper";
|
||||
//ppCbPlaceKeeper.Enabled = true;
|
||||
ppCbPlaceKeeper.Enabled = false;
|
||||
}
|
||||
if (ppCbPlaceKeeper.Enabled) ppCbPlaceKeeper.Checked = _SectionConfig.Section_Placekeeper == "Y";
|
||||
@@ -569,7 +606,7 @@ namespace VEPROMS
|
||||
ppBtnConvertToDocX.Visible = false; // Don't allow save as DOCX for libraries documents
|
||||
ppBtnCvrtToLibDoc.Text = "Convert this Section To A Non-Library Document";
|
||||
lblLibraryDocument.Text = "Library Document";
|
||||
superTooltip1.SetSuperTooltip(ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document",
|
||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document",
|
||||
null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||
}
|
||||
else
|
||||
@@ -579,17 +616,17 @@ namespace VEPROMS
|
||||
{
|
||||
ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID);
|
||||
if (!ii.IsAutoTOCSection) // Only show the Convert To DocX button for non-Auto Table Of Contents Section
|
||||
ppBtnConvertToDocX.Visible = true; // Only allow save as DocX for normal word sections when the existing text is RTF.
|
||||
this.ppBtnConvertToDocX.Visible = true; // Only allow save as DocX for normal word sections when the existing text is RTF.
|
||||
}
|
||||
else
|
||||
ppBtnConvertToDocX.Visible = false;
|
||||
this.ppBtnConvertToDocX.Visible = false;
|
||||
if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null)
|
||||
ppBtnCvrtToLibDoc.Visible = false;
|
||||
else
|
||||
{
|
||||
ppBtnCvrtToLibDoc.Text = "Convert this to a Library Document";
|
||||
lblLibraryDocument.Text = "Select Library Document";
|
||||
superTooltip1.SetSuperTooltip(ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
||||
"o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||
}
|
||||
}
|
||||
@@ -657,11 +694,12 @@ namespace VEPROMS
|
||||
int oldSelIndx = -1;
|
||||
if (!myInit)
|
||||
{
|
||||
opf = _SectionConfig.MyFormat != null ? _SectionConfig.MyFormat.PlantFormat : _SectionConfig.MyDefaultFormat.PlantFormat;
|
||||
DocStyleList oldDocStyles = null;
|
||||
opf = _SectionConfig.MyFormat != null ? _SectionConfig.MyFormat.PlantFormat : _SectionConfig.MyDefaultFormat.PlantFormat;
|
||||
if (pf != opf)
|
||||
{
|
||||
DocStyleList oldDocStyles = new DocStyleList(null);
|
||||
foreach (DocStyle ds in opf.DocStyles.DocStyleListActive)
|
||||
oldDocStyles = new DocStyleList(null);
|
||||
foreach (DocStyle ds in opf.DocStyles.DocStyleListActive)
|
||||
{
|
||||
if (_isStepSection && ds.IsStepSection)
|
||||
oldDocStyles.Add(ds); // find only step section types
|
||||
@@ -748,8 +786,7 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
private List<CheckOff> SectionPropertyCheckOffList = null;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private Dictionary<int, int> _CheckOffIndex = new Dictionary<int, int>(); // C2020-003 translate the sorted index number to the actual checkoff index
|
||||
private Dictionary<int, int> _CheckOffIndex = new Dictionary<int, int>(); // C2020-003 translate the sorted index number to the actual checkoff index
|
||||
private void SetupCheckoffsDropdowns()
|
||||
{
|
||||
if (!_isStepSection) return; // not needed for accessory pages (word attachments)
|
||||
@@ -757,7 +794,7 @@ namespace VEPROMS
|
||||
_Initializing = true;
|
||||
PlantFormat pf = _SectionConfig.MyFormat!=null?_SectionConfig.MyFormat.PlantFormat:_SectionConfig.MyDefaultFormat.PlantFormat;
|
||||
CheckOffList chkoffList = pf.FormatData.ProcData.CheckOffData.CheckOffList;
|
||||
chkoffList?.Sort(CompareCheckoffUsingOrderBy); // C2020-003 sort the checkoff list via the Index and/or OrderBy elements
|
||||
if (chkoffList != null) chkoffList.Sort(CompareCheckoffUsingOrderBy); // C2020-003 sort the checkoff list via the Index and/or OrderBy elements
|
||||
CheckOffHeaderList chkoffHeaderList = pf.FormatData.ProcData.CheckOffData.CheckOffHeaderList;
|
||||
int maxindx = pf.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndexNoInherit;
|
||||
// B2019-013: was crashing on indexer of checkofflist. If there were UCF checkoffs but none in original format, the indexer
|
||||
@@ -778,9 +815,10 @@ namespace VEPROMS
|
||||
if (chkoffList != null && maxindx > 0 &&
|
||||
(pf.FormatData.ProcData.CheckOffData.Menu == "Signoff") || _hasSectionCheckoffDefault)
|
||||
{
|
||||
SectionPropertyCheckOffList?.Clear();
|
||||
if (SectionPropertyCheckOffList!=null)SectionPropertyCheckOffList.Clear();
|
||||
SectionPropertyCheckOffList = new List<CheckOff>();
|
||||
// Don't put up the first item in the chkoffList, it is '{Section Default}'.
|
||||
//for (int i = 1; i < chkoffList.Count; i++)
|
||||
int idxcnt = 0;
|
||||
int translatedCfgIdx = 0;
|
||||
_CheckOffIndex.Clear();
|
||||
@@ -844,7 +882,7 @@ namespace VEPROMS
|
||||
{
|
||||
string suffix = "format ";
|
||||
if (_DefaultFormatName.ToUpper().Contains("FORMAT")) suffix = "";
|
||||
MessageBox.Show($"{_DefaultFormatName}\n\n{suffix}does not support {(isWordSection ? "MS Word" : "Step")} section type", "Incompatible Format", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
MessageBox.Show(string.Format("{0}\n\n{1}does not support {2} section type", _DefaultFormatName, suffix, isWordSection ? "MS Word" : "Step"), "Incompatible Format", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -880,6 +918,7 @@ namespace VEPROMS
|
||||
// determine if the default button and the default description text should visable
|
||||
ppBtnDefaultFmt.Visible = !(ppCmbxFormat.SelectedValue == null || ppCmbxFormat.SelectedIndex == -1);
|
||||
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
|
||||
//if (!didDefault) SetupPpCmbxSectionType();
|
||||
SetupPpCmbxSectionType();
|
||||
// B2017-272 disable/enable the Steps and Word radio buttons based on the section types defined in the format
|
||||
// and the type of an existing section or if we are creating a new section.
|
||||
@@ -901,7 +940,7 @@ namespace VEPROMS
|
||||
return true; // valid format
|
||||
string suffix = "format ";
|
||||
if (ppCmbxFormat.SelectedValue.ToString().ToUpper().Contains("FORMAT")) suffix = "";
|
||||
MessageBox.Show($"{ppCmbxFormat.SelectedValue}\n\n{suffix}does not support {(isWordSection ? "MS Word" : "Step")} section type", "Incompatible Format", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
MessageBox.Show(string.Format("{0}\n\n{1}does not support {2} section type", ppCmbxFormat.SelectedValue, suffix, isWordSection ? "MS Word" : "Step"), "Incompatible Format", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -912,17 +951,20 @@ namespace VEPROMS
|
||||
_SectionConfig.SectionType = (int)(ppCmbxStyleSectionType.SelectedValue);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Library Document tab
|
||||
#region Library Document tab
|
||||
|
||||
/// <summary>
|
||||
/// This is the Library Document button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnLibDocs_Click(object sender, EventArgs e) => ProcessButtonClick(tiLibDoc, btnLibDocs);
|
||||
private void ppBtnCvrtToLibDoc_Click(object sender, EventArgs e)
|
||||
/// <summary>
|
||||
/// This is the Library Document button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnLibDocs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiLibDoc, btnLibDocs);
|
||||
}
|
||||
private void ppBtnCvrtToLibDoc_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Double Check that this is not a step section, if so just return.
|
||||
if (_isStepSection) return;
|
||||
@@ -953,7 +995,7 @@ namespace VEPROMS
|
||||
ppCmbxLibDoc.Items.Clear();
|
||||
ppCmbxLibDoc.WatermarkEnabled = true;
|
||||
ppBtnCvrtToLibDoc.Text = "Convert this to a Library Document";
|
||||
superTooltip1.SetSuperTooltip(ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Library Document button", "", "This button will convert the current section to a library document, allowing it t" +
|
||||
"o be shared with other procedures.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||
return;
|
||||
}
|
||||
@@ -996,7 +1038,7 @@ namespace VEPROMS
|
||||
}
|
||||
ppBtnCvrtToLibDoc.Text = "Convert this Section To A Non-Library Document";
|
||||
lblLibraryDocument.Text = "Library Document";
|
||||
superTooltip1.SetSuperTooltip(ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document",
|
||||
superTooltip1.SetSuperTooltip(this.ppBtnCvrtToLibDoc, new DevComponents.DotNetBar.SuperTooltipInfo("Convert To Non-Library Document", "", "This button will convert the current section from a library document to a non-library document",
|
||||
null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 76)));
|
||||
}
|
||||
|
||||
@@ -1028,6 +1070,11 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
}
|
||||
//else if (_SectionConfig.MySection.MyContent.MyEntry.MyDocument == null)
|
||||
//{
|
||||
// // was creating a new document & selected to connect it to a libdoc
|
||||
// _DocumentToDelete = _SectionConfig.MySection.MyContent.MyEntry.MyDocument;
|
||||
//}
|
||||
else
|
||||
{
|
||||
// it already is a library document, just change usages...
|
||||
@@ -1039,30 +1086,34 @@ namespace VEPROMS
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"Index Out Of Range Index = {ppCmbxLibDoc.SelectedIndex}, Count = {LibDocList.Count}");
|
||||
throw new Exception(string.Format("Index Out Of Range Index = {0}, Count = {1}", ppCmbxLibDoc.SelectedIndex, LibDocList.Count));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region View Settings tab
|
||||
#region View Settings tab
|
||||
|
||||
/// <summary>
|
||||
/// This is the View Settings button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnAutomation_Click(object sender, EventArgs e) => ProcessButtonClick(tiAutomation, btnAutomation);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Generic functions used on this property page
|
||||
|
||||
/// <summary>
|
||||
/// Determines what labels (showing default values) are visable on the property pages
|
||||
/// </summary>
|
||||
private void defaultSettingsVisiblity()
|
||||
/// <summary>
|
||||
/// This is the View Settings button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnAutomation_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiAutomation, btnAutomation);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Generic functions used on this property page
|
||||
|
||||
/// <summary>
|
||||
/// Determines what labels (showing default values) are visable on the property pages
|
||||
/// </summary>
|
||||
private void defaultSettingsVisiblity()
|
||||
{
|
||||
//ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID);
|
||||
ppLblDefSettingsInfo.Visible = ppCbShwDefSettings.Checked;
|
||||
ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible;
|
||||
ppLblDefaultNumColumns.Visible = _isStepSection && ppCbShwDefSettings.Checked && ppBtnDefaultNumColumns.Visible;
|
||||
@@ -1109,7 +1160,26 @@ namespace VEPROMS
|
||||
private void tabpage_Enter(object sender, EventArgs e)
|
||||
{
|
||||
// Show or hide the labels containing the default values
|
||||
defaultSettingsVisiblity();
|
||||
//if (!_Initializing) // jsj 1-23-2017 was not showing default check upon property page entry
|
||||
defaultSettingsVisiblity();
|
||||
}
|
||||
/// <summary>
|
||||
/// Process a change in the combo box selection
|
||||
/// </summary>
|
||||
/// <param name="cmbx">Combo Box Name</param>
|
||||
/// <param name="defstr">string containing default text</param>
|
||||
/// <param name="button">button to reset to default value</param>
|
||||
/// <param name="deflabel">label containing the default</param>
|
||||
private void ProcessCmbxSelectedValueChange(ComboBoxEx cmbx, string defstr, ButtonX button, Label deflabel)
|
||||
{
|
||||
if ((cmbx.SelectedIndex != -1) && defstr != null && defstr.Equals(cmbx.SelectedValue))
|
||||
{
|
||||
button.Visible = true;
|
||||
button.Focus();
|
||||
button.PerformClick();
|
||||
}
|
||||
button.Visible = (cmbx.SelectedValue != null);
|
||||
deflabel.Visible = (ppCbShwDefSettings.Checked) && button.Visible;
|
||||
}
|
||||
/// <summary>
|
||||
/// Process a change in the enum combo box selection
|
||||
@@ -1131,21 +1201,30 @@ namespace VEPROMS
|
||||
cmbx.SelectedIndex = -1; // This will hide the Default button
|
||||
_Initializing = sav_Initializing;
|
||||
}
|
||||
//button.Visible = ((!_FolderConfig.Name.Equals("VEPROMS")) && (cmbx.SelectedValue != null));
|
||||
button.Visible = ((cmbx.SelectedValue != null) && (cmbx.SelectedIndex >= 0));
|
||||
deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
private void ppSectNumberStpRTB_Enter(object sender, EventArgs e) => _MyStepTabRibbon.MyStepRTB = ppSectNumberStpRTB;
|
||||
private void ppSectNumberStpRTB_Enter(object sender, EventArgs e)
|
||||
{
|
||||
_MyStepTabRibbon.MyStepRTB = ppSectNumberStpRTB;
|
||||
}
|
||||
|
||||
private void ppSectTitleStpRTB_Enter(object sender, EventArgs e) => _MyStepTabRibbon.MyStepRTB = ppSectTitleStpRTB;
|
||||
private void ppSectTitleStpRTB_Enter(object sender, EventArgs e)
|
||||
{
|
||||
_MyStepTabRibbon.MyStepRTB = ppSectTitleStpRTB;
|
||||
}
|
||||
|
||||
private void ShowAvailableOptionsForSectionType()
|
||||
private void ShowAvailableOptionsForSectionType()
|
||||
{
|
||||
lblColumns.Visible = _isStepSection;
|
||||
ppCmbxNumColumns.Visible = _isStepSection;
|
||||
lblPagination.Visible = _isStepSection;
|
||||
ppCmbxSectPagination.Visible = _isStepSection;
|
||||
//lblPrintSize.Visible = !_isStepSection;
|
||||
//ppCmbxAccPgPrintSize.Visible = !_isStepSection;
|
||||
ppGpbxSignoffCheckoff.Visible = _isStepSection;
|
||||
cbKeepWordDocMargins.Visible = !_isStepSection;
|
||||
ppCbDefaultStepSection.Visible = _isStepSection;
|
||||
@@ -1178,6 +1257,12 @@ namespace VEPROMS
|
||||
tcpFormat.Focus();
|
||||
}
|
||||
|
||||
//private void ppCmbxAccPgPrintSize_SelectedValueChanged(object sender, EventArgs e)
|
||||
//{
|
||||
// SectionConfig.AttPrintSize attsize = (SectionConfig.AttPrintSize)Enum.Parse(typeof(SectionConfig.AttPrintSize), _DefaultPrintSize);
|
||||
// ProcessCmbxSelectionEnumChanged(ppCmbxAccPgPrintSize, attsize, ppBtnDefaultPrintSize, ppLblDefaultPrintSize);
|
||||
//}
|
||||
|
||||
private void ppBtnDefaultPaginationStyle_Click(object sender, EventArgs e)
|
||||
{
|
||||
// Get the parent setting
|
||||
@@ -1200,9 +1285,12 @@ namespace VEPROMS
|
||||
tcpFormat.Focus();
|
||||
}
|
||||
|
||||
private void frmSectionProperties_Shown(object sender, EventArgs e) => ppSectNumberStpRTB.Focus();
|
||||
private void frmSectionProperties_Shown(object sender, EventArgs e)
|
||||
{
|
||||
ppSectNumberStpRTB.Focus();
|
||||
}
|
||||
|
||||
private void ppCbEditableData_CheckedChanged(object sender, EventArgs e)
|
||||
private void ppCbEditableData_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
bool isEditable = ppCbEditableData.Checked;
|
||||
if (!_Initializing)
|
||||
@@ -1265,7 +1353,7 @@ namespace VEPROMS
|
||||
int cntDefaultSect = 0;
|
||||
string defSectDesc = "";
|
||||
string curSectDesc = "";
|
||||
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections.OfType<SectionInfo>())
|
||||
foreach (SectionInfo si in _SectionConfig.MySection.MySectionInfo.MyProcedure.Sections)
|
||||
{
|
||||
SectionConfig sc = si.MyConfig as SectionConfig;
|
||||
if (sc != null && sc.Section_OriginalSteps == "Y")
|
||||
@@ -1317,6 +1405,10 @@ namespace VEPROMS
|
||||
ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID);
|
||||
DocumentInfo doclibinfo = ii.MyContent.MyEntry.MyDocument;
|
||||
DSOFile myfile = new DSOFile(doclibinfo);
|
||||
// When trying to fix this , the update of the document waas causing a CSLA crash so I switched
|
||||
// to make document
|
||||
//using (Document myDoc = doclibinfo.Get())
|
||||
//{
|
||||
// Open MSWord App
|
||||
LBWordLibrary.LBApplicationClass ap = new LBWordLibrary.LBApplicationClass();
|
||||
LBWordLibrary.LBDocumentClass doc = ap.Documents.Open(myfile.FullName);
|
||||
@@ -1328,13 +1420,17 @@ namespace VEPROMS
|
||||
FileStream fs = File.Open(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);// B2016-053
|
||||
long len = fs.Length;
|
||||
byte[] ByteArray = new byte[len];
|
||||
_ = fs.Read(ByteArray, 0, (int)len);
|
||||
int nBytesRead = fs.Read(ByteArray, 0, (int)len);
|
||||
fs.Close();
|
||||
Document myDoc = Document.MakeDocument(null, ByteArray, doclibinfo.DocAscii, doclibinfo.Config, ".DOCX");
|
||||
_SectionConfig.MySection.MyContent.MyEntry.MyDocument = myDoc;
|
||||
_SectionConfig.MySection.MyContent.MyEntry.Save();
|
||||
//myDoc.DocContent = ByteArray;
|
||||
//myDoc.FileExtension = ".DOCX";
|
||||
//myDoc.Save();
|
||||
fi.Delete();// Cleanup afterwards
|
||||
ppBtnConvertToDocX.Visible = false; // Hide the button after the execution is complete.
|
||||
//}
|
||||
}
|
||||
|
||||
private void ppCmbxFormat_DropDown(object sender, EventArgs e)
|
||||
@@ -1364,11 +1460,14 @@ namespace VEPROMS
|
||||
_SectionConfig.Section_IsFoldout = (cbIsFoldoutSection.Checked) ? "Y" : "N";
|
||||
}
|
||||
|
||||
// B2019-165 check box added to Automation tab to prevent a duplex foldout from
|
||||
// being printed on the back of the last page of the Word document that does not include duplex foldouts
|
||||
private void ppCbNoDuplexFoldout_CheckedChanged(object sender, EventArgs e) => _SectionConfig.Section_DontIncludeDuplexFoldout = ppCbNoDuplexFoldout.Checked;
|
||||
// C2029-025 Show or hide replace words. Can highlight replace words in editor.
|
||||
private void ppCbShowRplWords_CheckedChanged(object sender, EventArgs e)
|
||||
// B2019-165 check box added to Automation tab to prevent a duplex foldout from
|
||||
// being printed on the back of the last page of the Word document that does not include duplex foldouts
|
||||
private void ppCbNoDuplexFoldout_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
_SectionConfig.Section_DontIncludeDuplexFoldout = ppCbNoDuplexFoldout.Checked;
|
||||
}
|
||||
// C2029-025 Show or hide replace words. Can highlight replace words in editor.
|
||||
private void ppCbShowRplWords_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_Initializing)
|
||||
{
|
||||
@@ -1376,5 +1475,15 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
//private void ppBtnDefaultPrintSize_Click(object sender, EventArgs e)
|
||||
//{
|
||||
// // Get the parent setting
|
||||
// SectionConfig.AttPrintSize attsize = (SectionConfig.AttPrintSize)Enum.Parse(typeof(SectionConfig.AttPrintSize), _DefaultPrintSize);
|
||||
// // Compare parent setting with current setting
|
||||
// if (attsize != _SectionConfig.Section_AttachmentPrintSize)
|
||||
// _SectionConfig.Section_AttachmentPrintSize = attsize; // this will force a database update (write)
|
||||
// ppCmbxAccPgPrintSize.SelectedIndex = -1;//reset to the default Accessory page Print Size setting
|
||||
// tcpFormat.Focus();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevComponents;
|
||||
using DevComponents.DotNetBar.Rendering;
|
||||
using DevComponents.DotNetBar;
|
||||
using VEPROMS.Properties;
|
||||
using Volian.Base.Library;
|
||||
using DescriptiveEnum;
|
||||
using VEPROMS.CSLA.Library;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
public partial class frmSysOptions : DevComponents.DotNetBar.Office2007Form
|
||||
{
|
||||
readonly bool _initializing;
|
||||
bool _initializing;
|
||||
private bool _CanChangeSeparateWindowsSetting = true;
|
||||
|
||||
public bool CanChangeSeparateWindowsSetting { get; set; } = true;
|
||||
public bool CanChangeSeparateWindowsSetting
|
||||
{
|
||||
get { return _CanChangeSeparateWindowsSetting; }
|
||||
set { _CanChangeSeparateWindowsSetting = value; }
|
||||
}
|
||||
|
||||
private UserSettings _usersettings;
|
||||
private UserSettings _usersettings;
|
||||
|
||||
public frmSysOptions()
|
||||
{
|
||||
@@ -149,8 +160,8 @@ namespace VEPROMS
|
||||
//C2025-013 - Allow not continuously generate message that opening Summaries in MS Word
|
||||
_usersettings.SetUserSetting_MSWord_Summary_Prompt(cbMSWordPrompt.Checked);
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
Close();
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private int ss_propPageStyle;
|
||||
@@ -186,7 +197,7 @@ namespace VEPROMS
|
||||
private void RestoreStartingSettings() // used with the cancel button
|
||||
{
|
||||
Settings.Default.PropPageStyle = ss_propPageStyle;
|
||||
Settings.Default.SystemColor = ss_SystemColor;
|
||||
Settings.Default.SystemColor = ss_SystemColor;
|
||||
Settings.Default.TransitionRangeColor = ss_TransRangeColor;
|
||||
Settings.Default.AutoPopUpAnnotations = ss_PopUPAnnotations;
|
||||
Settings.Default.StepTypeToolTip = ss_StepTypeToolTip;
|
||||
@@ -244,30 +255,52 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
private void cbAnnotationPopup_CheckedChanged(object sender, EventArgs e) => Settings.Default.AutoPopUpAnnotations = cbAnnotationPopup.Checked;
|
||||
private void cbAnnotationPopup_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Settings.Default.AutoPopUpAnnotations = cbAnnotationPopup.Checked;
|
||||
}
|
||||
|
||||
private void frmSysOptions_Load(object sender, EventArgs e)
|
||||
private void frmSysOptions_Load(object sender, EventArgs e)
|
||||
{
|
||||
ClearAllCheckedButtons();
|
||||
tcSysOpts.SelectedTab = tiIntrFaceStngs;
|
||||
btnIntrFaceStngs.Checked = true;
|
||||
gpSeparateWindows.Enabled = CanChangeSeparateWindowsSetting; //Separate Windows only if one or less procedure sets open
|
||||
}
|
||||
gpSeparateWindows.Enabled = CanChangeSeparateWindowsSetting; //Separate Windows only if one or less procedure sets open
|
||||
}
|
||||
private void cbStepTypeToolTip_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Settings.Default.StepTypeToolTip = cbStepTypeToolTip.Checked;
|
||||
VlnSettings.StepTypeToolTip = cbStepTypeToolTip.Checked;
|
||||
}
|
||||
private void cbTVExpand_CheckedChanged(object sender, EventArgs e) => Settings.Default.SaveTreeviewExpanded = cbTVExpand.Checked;
|
||||
private void cbSeparateWindows_CheckedChanged(object sender, EventArgs e) => Settings.Default.SeparateWindows = cbSeparateWindows.Checked;
|
||||
private void txbxVisioPath_Leave(object sender, EventArgs e) => Settings.Default.VisioPath = txbxVisioPath.Text;
|
||||
private void cbTVExpand_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Settings.Default.SaveTreeviewExpanded = cbTVExpand.Checked;
|
||||
}
|
||||
private void cbSeparateWindows_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Settings.Default.SeparateWindows = cbSeparateWindows.Checked;
|
||||
}
|
||||
private void txbxVisioPath_Leave(object sender, EventArgs e)
|
||||
{
|
||||
Settings.Default.VisioPath = txbxVisioPath.Text;
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, EventArgs e) => RestoreStartingSettings();
|
||||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
RestoreStartingSettings();
|
||||
}
|
||||
|
||||
private void txbxVisioPath_Leave_1(object sender, EventArgs e) => Settings.Default.VisioPath = txbxVisioPath.Text;
|
||||
private void txbxVisioPath_Leave_1(object sender, EventArgs e)
|
||||
{
|
||||
Settings.Default.VisioPath = txbxVisioPath.Text;
|
||||
}
|
||||
|
||||
private void cbOTRemember_CheckedChanged(object sender, EventArgs e) => cbOTAutoOpen.Enabled = cbOTAutoOpen.Visible = cbShwRplWrdsColor.Checked;
|
||||
private void cbShwRplWrdsColor_CheckedChanged(object sender, EventArgs e)
|
||||
|
||||
private void cbOTRemember_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
cbOTAutoOpen.Enabled = cbOTAutoOpen.Visible = cbShwRplWrdsColor.Checked;
|
||||
}
|
||||
private void cbShwRplWrdsColor_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Settings.Default.cbShwRplWrdsColor = cbShwRplWrdsColor.Checked;
|
||||
VlnSettings.cbShwRplWrdsColor = cbShwRplWrdsColor.Checked;
|
||||
@@ -275,7 +308,10 @@ namespace VEPROMS
|
||||
Properties.Settings.Default.Save(); // save settings
|
||||
}
|
||||
|
||||
private void cbShwAnnoFilter_Click(object sender, EventArgs e) => frmVEPROMS.tv_SelectAnnotations();
|
||||
private void cbShwAnnoFilter_Click(object sender, EventArgs e)
|
||||
{
|
||||
frmVEPROMS.tv_SelectAnnotations();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using VEPROMS.CSLA.Library;
|
||||
@@ -25,36 +28,45 @@ namespace VEPROMS
|
||||
private List<MiniConfig> _Apples;
|
||||
private List<MiniConfig> _DeletedApples;
|
||||
private List<EnhancedMiniConfig> _Enhanced;
|
||||
private readonly DocVersionConfig _DocVersionConfig;
|
||||
private readonly string _OrgPDFPath; // B2024-030 used to save last PDF path
|
||||
private DocVersionConfig _DocVersionConfig;
|
||||
private string _OrgPDFPath; // B2024-030 used to save last PDF path
|
||||
|
||||
// Default values
|
||||
private string _DefaultFormatName = null;
|
||||
private string _DefaultROPrefix = null;
|
||||
private string _DefaultImagePrefix = null;
|
||||
private string _DefaultWatermark = null;
|
||||
private string _DefaultChgBarType = null;
|
||||
private string _DefaultChgBarLoc = null;
|
||||
private string _DefaultChgBarText = null;
|
||||
private string _DefaultChgBarUsrMsg1 = null;
|
||||
private string _DefaultChgBarUsrMsg2 = null;
|
||||
private bool _Initializing = false;
|
||||
private bool _DefaultDisableDuplex = false;
|
||||
private DisplaySearch _DisplaySearch1 = null;
|
||||
|
||||
private bool _Initializing = false;
|
||||
private System.IO.StreamWriter swROUpdate;
|
||||
private RODbInfo _CurRoDbInfo = null;
|
||||
private ProgressBarItem _ProgressBar = null;
|
||||
private RODbInfo _CurRoDbInfo = null;
|
||||
private ROFstInfo _SelectedROFst;
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||
private List<DocVersionInfo> NewEnhVersions = new List<DocVersionInfo>();
|
||||
private List<DocVersionInfo> NewEnhVersions = new List<DocVersionInfo>();
|
||||
private bool doingNew = false;
|
||||
private bool _EnhNeedToUnlink = false;
|
||||
private int _InitialIndex = -2; // added as part of code change C2017-004. this also makes it consistent with section properties
|
||||
private int? _cmbxformatOriginal = null;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
#region Properties
|
||||
|
||||
public DisplaySearch DisplaySearch1
|
||||
{
|
||||
get { return _DisplaySearch1; }
|
||||
set { _DisplaySearch1 = value; }
|
||||
}
|
||||
|
||||
public DisplaySearch DisplaySearch1 { get; set; } = null;
|
||||
|
||||
// For the initial release, we are assuming there will be only one rofst for a docversion. Changes will be needed here if more than 1.
|
||||
public ROFstInfo SelectedROFst
|
||||
// For the initial release, we are assuming there will be only one rofst for a docversion. Changes will be needed here if more than 1.
|
||||
public ROFstInfo SelectedROFst
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -69,13 +81,17 @@ namespace VEPROMS
|
||||
set { _SelectedROFst = value; }
|
||||
}
|
||||
|
||||
public ProgressBarItem ProgressBar { get; set; } = null;
|
||||
public ProgressBarItem ProgressBar
|
||||
{
|
||||
get { return _ProgressBar; }
|
||||
set { _ProgressBar = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
#region Constructors
|
||||
|
||||
public frmVersionsProperties(DocVersionConfig docVersionConfig)
|
||||
public frmVersionsProperties(DocVersionConfig docVersionConfig)
|
||||
{
|
||||
_DocVersionConfig = docVersionConfig;
|
||||
docVersionConfig.RefreshMyEnhancedDocuments();
|
||||
@@ -87,7 +103,7 @@ namespace VEPROMS
|
||||
_Initializing = false;
|
||||
|
||||
//build the caption
|
||||
Text = string.Format("{0} Properties", _DocVersionConfig.Name);
|
||||
this.Text = string.Format("{0} Properties", _DocVersionConfig.Name);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -131,11 +147,9 @@ namespace VEPROMS
|
||||
srchtxt = myGrid.GetSearchableText();
|
||||
}
|
||||
|
||||
List<string> retlist = new List<string>
|
||||
{
|
||||
srchtxt,
|
||||
xml
|
||||
};
|
||||
List<string> retlist = new List<string>();
|
||||
retlist.Add(srchtxt);
|
||||
retlist.Add(xml);
|
||||
|
||||
return retlist;
|
||||
}
|
||||
@@ -150,6 +164,7 @@ namespace VEPROMS
|
||||
|
||||
docVersionConfigBindingSource.DataSource = _DocVersionConfig;
|
||||
|
||||
//formatInfoListBindingSource.DataSource = FormatInfoList.Get();
|
||||
imageCodecInfoBindingSource.DataSource = ImageCodecInfo.GetImageDecoders();
|
||||
|
||||
ppCmbxFormat.DataSource = null;
|
||||
@@ -170,7 +185,7 @@ namespace VEPROMS
|
||||
|
||||
// Get the saved settings for this user
|
||||
// Get setting telling us whether to display the default values on this property page
|
||||
ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultVersionProp"] != null) && Settings.Default.ShowDefaultVersionProp;
|
||||
ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultVersionProp"] != null) ? Settings.Default.ShowDefaultVersionProp : false;
|
||||
|
||||
// Get the User's property page style "PropPageStyle" (this is a system wide user setting)
|
||||
// 1 - Button Dialog (default)
|
||||
@@ -179,7 +194,7 @@ namespace VEPROMS
|
||||
{
|
||||
tcVersions.TabsVisible = true;
|
||||
panVerBtns.Visible = false;
|
||||
Width -= panVerBtns.Width;
|
||||
this.Width -= panVerBtns.Width;
|
||||
}
|
||||
|
||||
// Get the default values for the property page information
|
||||
@@ -283,14 +298,12 @@ namespace VEPROMS
|
||||
}
|
||||
else
|
||||
{
|
||||
Button btnPC = new Button
|
||||
{
|
||||
Text = "Add Applicability to Working Draft",
|
||||
Width = 250,
|
||||
Location = new Point(25, 271),
|
||||
Parent = tcpGeneral
|
||||
};
|
||||
btnPC.Click += new EventHandler(btnPC_Click);
|
||||
Button btnPC = new Button();
|
||||
btnPC.Text = "Add Applicability to Working Draft";
|
||||
btnPC.Width = 250;
|
||||
btnPC.Location = new Point(25, 271);
|
||||
btnPC.Parent = tcpGeneral;
|
||||
btnPC.Click += new EventHandler(btnPC_Click);
|
||||
btnApplicability.Visible = false;
|
||||
tiApplicability.Visible = false;
|
||||
}
|
||||
@@ -381,14 +394,12 @@ namespace VEPROMS
|
||||
}
|
||||
if (validEmptyEnhancedExists)
|
||||
{
|
||||
Button btnEnh = new Button
|
||||
{
|
||||
Text = "Link to Enhanced Document(s)",
|
||||
Width = 220,
|
||||
Location = new Point(290, 271),
|
||||
Parent = tcpGeneral
|
||||
};
|
||||
btnEnh.Click += new EventHandler(btnEnh_Click);
|
||||
Button btnEnh = new Button();
|
||||
btnEnh.Text = "Link to Enhanced Document(s)";
|
||||
btnEnh.Width = 220;
|
||||
btnEnh.Location = new Point(290, 271);
|
||||
btnEnh.Parent = tcpGeneral;
|
||||
btnEnh.Click += new EventHandler(btnEnh_Click);
|
||||
}
|
||||
}
|
||||
btnEnhanced.Visible = false;
|
||||
@@ -414,7 +425,7 @@ namespace VEPROMS
|
||||
DocVersionInfo dvi = DocVersionInfo.Get(_DocVersionConfig.MyEnhancedDocuments[0].VersionID);
|
||||
DVEnhancedDocument dvedUseData = _DocVersionConfig.MyEnhancedDocuments[0];
|
||||
DocVersionConfig dvc = dvi.MyConfig as DocVersionConfig;
|
||||
EnhancedMiniConfig ecfg = new EnhancedMiniConfig(0, dvi.VersionID, dvi.SearchDVPath, dvedUseData.Name, dvedUseData.Type.ToString(), dvedUseData.PdfToken, dvedUseData.PdfX.ToString());
|
||||
EnhancedMiniConfig ecfg = new EnhancedMiniConfig(0, dvi.VersionID, "?", dvi.SearchDVPath, dvedUseData.Name, dvedUseData.Type.ToString(), dvedUseData.PdfToken, dvedUseData.PdfX.ToString());
|
||||
cbxEnhVersions.Items.Add(dvi.SearchDVPath);
|
||||
tbEnhName.Enabled = false;
|
||||
tbEnhType.Enabled = false;
|
||||
@@ -455,7 +466,7 @@ namespace VEPROMS
|
||||
{
|
||||
DocVersionInfo dvi = DocVersionInfo.Get(dved.VersionID);
|
||||
DocVersionConfig dvc = dvi.MyConfig as DocVersionConfig;
|
||||
EnhancedMiniConfig ecfg = new EnhancedMiniConfig(0, dvi.VersionID, dvi.SearchDVPath, dved.Name, dved.Type.ToString(), dved.PdfToken, dved.PdfX.ToString());
|
||||
EnhancedMiniConfig ecfg = new EnhancedMiniConfig(0, dvi.VersionID, "?", dvi.SearchDVPath, dved.Name, dved.Type.ToString(), dved.PdfToken, dved.PdfX.ToString());
|
||||
cbxEnhVersions.Items.Add(dvi.SearchDVPath);
|
||||
_Enhanced.Add(ecfg);
|
||||
}
|
||||
@@ -538,6 +549,47 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
private string AddSlaveNode(MiniConfig mc)
|
||||
{
|
||||
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
|
||||
xd.LoadXml(_DocVersionConfig.ToString());
|
||||
System.Xml.XmlNodeList nl = xd.SelectNodes("//Slave");
|
||||
int max = 0;
|
||||
|
||||
foreach (System.Xml.XmlNode n in nl)
|
||||
{
|
||||
max = int.Parse(n.Attributes.GetNamedItem("index").InnerText);
|
||||
}
|
||||
|
||||
max++;
|
||||
|
||||
System.Xml.XmlNode nn = xd.CreateElement("Slave");
|
||||
AddSlaveAttribute(nn, "index", max.ToString());
|
||||
AddSlaveAttribute(nn, "ID", mc.ID);
|
||||
AddSlaveAttribute(nn, "Name", mc.Name);
|
||||
AddSlaveAttribute(nn, "Number", mc.Number);
|
||||
AddSlaveAttribute(nn, "Text", mc.Text);
|
||||
AddSlaveAttribute(nn, "ProcedureNumber", mc.ProcedureNumber);
|
||||
AddSlaveAttribute(nn, "SetID", mc.SetID);
|
||||
AddSlaveAttribute(nn, "SetName", mc.SetName);
|
||||
AddSlaveAttribute(nn, "OtherID", mc.OtherID);
|
||||
AddSlaveAttribute(nn, "OtherName", mc.OtherName);
|
||||
AddSlaveAttribute(nn, "OtherNumber", mc.OtherNumber);
|
||||
AddSlaveAttribute(nn, "OtherText", mc.OtherText);
|
||||
|
||||
System.Xml.XmlNode sn = xd.SelectSingleNode("//Slaves");
|
||||
sn.AppendChild(nn);
|
||||
|
||||
return xd.OuterXml;
|
||||
}
|
||||
|
||||
private void AddSlaveAttribute(System.Xml.XmlNode nn, string name, string value)
|
||||
{
|
||||
System.Xml.XmlAttribute xa = nn.OwnerDocument.CreateAttribute(name);
|
||||
xa.InnerText = value;
|
||||
nn.Attributes.SetNamedItem(xa);
|
||||
}
|
||||
|
||||
private void btnVersionsPropOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
//B2024-030 Check the PDF Location path and prompt to create the folders if needed
|
||||
@@ -631,8 +683,8 @@ namespace VEPROMS
|
||||
{
|
||||
dved.PdfX = Convert.ToInt32(emc.PdfXOffset);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
catch (Exception ex)
|
||||
{
|
||||
dved.PdfX = 10;
|
||||
}
|
||||
}
|
||||
@@ -646,8 +698,8 @@ namespace VEPROMS
|
||||
{
|
||||
ipdfx = Convert.ToInt32(emc.PdfXOffset);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
catch (Exception ex)
|
||||
{
|
||||
ipdfx = (emc.PdfToken == null || emc.PdfToken == "") ? 0 : 10;
|
||||
}
|
||||
|
||||
@@ -657,8 +709,8 @@ namespace VEPROMS
|
||||
{
|
||||
itype = Convert.ToInt32(emc.Type);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
catch (Exception ex)
|
||||
{
|
||||
itype = 1;
|
||||
}
|
||||
|
||||
@@ -721,20 +773,20 @@ namespace VEPROMS
|
||||
|
||||
if (_EnhNeedToUnlink)
|
||||
{
|
||||
Cursor = Cursors.WaitCursor;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
_DocVersionConfig.MyDocVersion.MyDocVersionInfo.DoUnlinkEnhancedDocVersion();
|
||||
Cursor = Cursors.Default;
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
// B2019-132 update the association count for this working draft
|
||||
_DocVersionConfig.MyDocVersion.MyDocVersionInfo.RefreshDocVersionAssociations();
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnFldrPropCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
docVersionConfigBindingSource.CancelEdit();
|
||||
Close();
|
||||
this.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -780,15 +832,13 @@ namespace VEPROMS
|
||||
|
||||
// Get the ro path - there is no 'default'
|
||||
if (_DocVersionConfig.MyDocVersion.DocVersionAssociationCount < 0 && _DocVersionConfig.MyDocVersion.DocVersionAssociations.Count == 0)
|
||||
#pragma warning disable CS0642 // Possible mistaken empty statement
|
||||
;// The line above refreshes the data
|
||||
#pragma warning restore CS0642 // Possible mistaken empty statement
|
||||
;// The line above refreshes the data
|
||||
|
||||
if (_DocVersionConfig.MyDocVersion.DocVersionAssociationCount > 0)
|
||||
if (_DocVersionConfig.MyDocVersion.DocVersionAssociationCount > 0)
|
||||
{
|
||||
RODbInfo rdi = RODbInfo.GetJustRODB(SelectedROFst.RODbID);
|
||||
|
||||
tbRoDb.Text = $"{rdi.ROName} ({rdi.FolderPath})";
|
||||
tbRoDb.Text = string.Format("{0} ({1})", rdi.ROName, rdi.FolderPath);
|
||||
ppBtnRoToSql.Visible = ppBtnRoToSql.Enabled = CanMigrateRoAccessToSql(rdi); // C2017-003: make button visible if ro migration is doable
|
||||
_CurRoDbInfo = rdi;
|
||||
}
|
||||
@@ -801,7 +851,7 @@ namespace VEPROMS
|
||||
|
||||
foreach (RODbInfo rdi in RODbInfoList.Get())
|
||||
{
|
||||
int i = cmbRoDb.Items.Add($"{rdi.ROName} ({rdi.FolderPath})");
|
||||
int i = cmbRoDb.Items.Add(string.Format("{0} ({1})", rdi.ROName, rdi.FolderPath));
|
||||
|
||||
if (rdi.RODbID == myrodbid)
|
||||
{
|
||||
@@ -908,12 +958,10 @@ namespace VEPROMS
|
||||
if (tmp == null)
|
||||
{
|
||||
MessageBox.Show("Invalid ro fst directory, use the Property dialog to fix directory path to ro.fst.");
|
||||
frmRODbProperties dlgROProperties = new frmRODbProperties(_DocVersionConfig.MyDocVersion, rdi)
|
||||
{
|
||||
ProgressBar = ProgressBar
|
||||
};
|
||||
frmRODbProperties dlgROProperties = new frmRODbProperties(_DocVersionConfig.MyDocVersion, rdi);
|
||||
dlgROProperties.ProgressBar = ProgressBar;
|
||||
|
||||
if (dlgROProperties.ShowDialog() == DialogResult.OK)
|
||||
if (dlgROProperties.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
tbRoDb.Text = string.Format("{0} ({1})", SelectedROFst.MyRODb.ROName, SelectedROFst.MyRODb.FolderPath);
|
||||
// only allow update if association, and the RO update was not done and/or not completed
|
||||
@@ -927,7 +975,7 @@ namespace VEPROMS
|
||||
|
||||
cmbRoDb.Visible = ppBtnRoDbBrowse.Visible = false;
|
||||
tbRoDb.Visible = btnRoDbProperties.Visible = true;
|
||||
tbRoDb.Text = $"{tmp.MyRODb.ROName} ({tmp.MyRODb.FolderPath})";
|
||||
tbRoDb.Text = string.Format("{0} ({1})", tmp.MyRODb.ROName, tmp.MyRODb.FolderPath);
|
||||
|
||||
// C2017-003: See if the selected ro database has been converted to sql and if not, make visible a button to convert the data.
|
||||
RODbInfo rodbi = RODbInfo.GetJustRODB(tmp.MyRODb.RODbID);
|
||||
@@ -959,14 +1007,12 @@ namespace VEPROMS
|
||||
|
||||
private void ppBtnRoDbBrowse_Click(object sender, EventArgs e)
|
||||
{
|
||||
frmRODbProperties dlgROProperties = new frmRODbProperties(_DocVersionConfig.MyDocVersion, SelectedROFst?.MyRODb)
|
||||
{
|
||||
ParentLocation = Location
|
||||
};
|
||||
frmRODbProperties dlgROProperties = new frmRODbProperties(_DocVersionConfig.MyDocVersion, SelectedROFst == null ? null : SelectedROFst.MyRODb);
|
||||
dlgROProperties.ParentLocation = Location;
|
||||
|
||||
// if a user has entered a valid rodb, then this docversion will be conntected to it - change
|
||||
// to a non-editable text box and the button becomes a properties button rather than browse.
|
||||
if (dlgROProperties.ShowDialog() == DialogResult.OK)
|
||||
// if a user has entered a valid rodb, then this docversion will be conntected to it - change
|
||||
// to a non-editable text box and the button becomes a properties button rather than browse.
|
||||
if (dlgROProperties.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
cmbRoDb.Items.Clear();
|
||||
_DocVersionConfig.MyDocVersion.Reset_DocVersionAssociations();
|
||||
@@ -1029,9 +1075,12 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
|
||||
private void frmVersionsProperties_Shown(object sender, EventArgs e) => ppRTxtName.Focus();
|
||||
private void frmVersionsProperties_Shown(object sender, EventArgs e)
|
||||
{
|
||||
ppRTxtName.Focus();
|
||||
}
|
||||
|
||||
private void ppRTxtName_Leave(object sender, EventArgs e)
|
||||
private void ppRTxtName_Leave(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ppRTxtName.Text))
|
||||
{
|
||||
@@ -1040,9 +1089,12 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
private void btnApplicability_Click(object sender, EventArgs e) => ProcessButtonClick(tiApplicability, btnApplicability);
|
||||
private void btnApplicability_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiApplicability, btnApplicability);
|
||||
}
|
||||
|
||||
private void lbApplicabilities_SelectedIndexChanged(object sender, EventArgs e)
|
||||
private void lbApplicabilities_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (lbApplicabilities.SelectedIndex > -1)
|
||||
{
|
||||
@@ -1054,12 +1106,11 @@ namespace VEPROMS
|
||||
|
||||
private void btnNewApple_Click(object sender, EventArgs e)
|
||||
{
|
||||
MiniConfig cfg = new MiniConfig
|
||||
{
|
||||
Name = "New Applicability"
|
||||
};
|
||||
MiniConfig cfg = new MiniConfig();
|
||||
|
||||
if (_Apples == null)
|
||||
cfg.Name = "New Applicability";
|
||||
|
||||
if (_Apples == null)
|
||||
{
|
||||
_Apples = new List<MiniConfig>();
|
||||
}
|
||||
@@ -1096,7 +1147,7 @@ namespace VEPROMS
|
||||
if (_showApplicSearchResults)
|
||||
{
|
||||
_showApplicSearchResults = false;
|
||||
DisplaySearch1.SearchResults = null;
|
||||
_DisplaySearch1.SearchResults = null;
|
||||
}
|
||||
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
@@ -1108,9 +1159,9 @@ namespace VEPROMS
|
||||
if (MessageBox.Show(string.Format("Cannot remove an Applicability that is being use in {0} places.\n\nDo you want to view locations via Search Results?\n\nThe Search panel will open when you exit the property page.", placesUsed.Count), "Applicability In Use", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||
{
|
||||
_showApplicSearchResults = true;
|
||||
DisplaySearch1.SearchResults = placesUsed;
|
||||
DisplaySearch1.ReportTitle = string.Format("{0} Applicability", cfg.Name);
|
||||
DisplaySearch1.TypesSelected = string.Format("These Locations Specify The \"{0}\" Applicability", cfg.Name);
|
||||
_DisplaySearch1.SearchResults = placesUsed;
|
||||
_DisplaySearch1.ReportTitle = string.Format("{0} Applicability", cfg.Name);
|
||||
_DisplaySearch1.TypesSelected = string.Format("These Locations Specify The \"{0}\" Applicability", cfg.Name);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1136,7 +1187,7 @@ namespace VEPROMS
|
||||
bsApples.DataSource = null;
|
||||
bsApples.DataSource = _Apples;
|
||||
// C2018-010: When removing an applicability, info on right side still contains old content. Do refreshes and reset datasource to fix this.
|
||||
lbApplicabilities.Refresh();
|
||||
this.lbApplicabilities.Refresh();
|
||||
|
||||
if (_Apples != null && _Apples.Count > 0)
|
||||
{
|
||||
@@ -1153,9 +1204,12 @@ namespace VEPROMS
|
||||
dlgPL.ShowDialog();
|
||||
}
|
||||
|
||||
private void btnEnhanced_Click(object sender, EventArgs e) => ProcessButtonClick(tiEnhanced, btnEnhanced);
|
||||
private void btnEnhanced_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiEnhanced, btnEnhanced);
|
||||
}
|
||||
|
||||
private void lbEnhanced_SelectedIndexChanged(object sender, EventArgs e)
|
||||
private void lbEnhanced_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_Initializing && lbEnhanced.SelectedIndex > -1 && !doingNew)
|
||||
{
|
||||
@@ -1171,14 +1225,12 @@ namespace VEPROMS
|
||||
_Initializing = true;
|
||||
doingNew = true;
|
||||
|
||||
// the 'New' button is only enabled for Source documents.
|
||||
EnhancedMiniConfig cfg = new EnhancedMiniConfig
|
||||
{
|
||||
Name = "New Enhanced"
|
||||
};
|
||||
// the 'New' button is only enabled for Source documents.
|
||||
EnhancedMiniConfig cfg = new EnhancedMiniConfig();
|
||||
cfg.Name = "New Enhanced";
|
||||
|
||||
// need to have a unique number for this enhanced link, find largest and then increment by 1.
|
||||
int maxtype = -1;
|
||||
// need to have a unique number for this enhanced link, find largest and then increment by 1.
|
||||
int maxtype = -1;
|
||||
|
||||
if (_DocVersionConfig.MyEnhancedDocuments != null && _DocVersionConfig.MyEnhancedDocuments.Count > 0)
|
||||
{
|
||||
@@ -1399,36 +1451,40 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
#region (General Tab)
|
||||
#region (General Tab)
|
||||
|
||||
/// <summary>
|
||||
/// This is the General button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnGeneral_Click(object sender, EventArgs e) => ProcessButtonClick(tiGeneral, btnGeneral);
|
||||
|
||||
#endregion
|
||||
|
||||
#region (Referenced Objects)
|
||||
|
||||
/// <summary>
|
||||
/// This is the Referenced Objects button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnRefObjs_Click(object sender, EventArgs e) => ProcessButtonClick(tiRefObjs, btnRefObjs);
|
||||
|
||||
private void btnRoDbProperties_Click(object sender, EventArgs e)
|
||||
/// <summary>
|
||||
/// This is the General button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnGeneral_Click(object sender, EventArgs e)
|
||||
{
|
||||
frmRODbProperties dlgROProperties = new frmRODbProperties(_DocVersionConfig.MyDocVersion, SelectedROFst?.MyRODb)
|
||||
{
|
||||
ParentLocation = Location
|
||||
};
|
||||
ProcessButtonClick(tiGeneral, btnGeneral);
|
||||
}
|
||||
|
||||
if (dlgROProperties.ShowDialog() == DialogResult.OK)
|
||||
#endregion
|
||||
|
||||
#region (Referenced Objects)
|
||||
|
||||
/// <summary>
|
||||
/// This is the Referenced Objects button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnRefObjs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiRefObjs, btnRefObjs);
|
||||
}
|
||||
|
||||
private void btnRoDbProperties_Click(object sender, EventArgs e)
|
||||
{
|
||||
frmRODbProperties dlgROProperties = new frmRODbProperties(_DocVersionConfig.MyDocVersion, SelectedROFst == null ? null : SelectedROFst.MyRODb);
|
||||
dlgROProperties.ParentLocation = Location;
|
||||
|
||||
if (dlgROProperties.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
tbRoDb.Text = $"{SelectedROFst.MyRODb.ROName} ({SelectedROFst.MyRODb.FolderPath})";
|
||||
tbRoDb.Text = string.Format("{0} ({1})", SelectedROFst.MyRODb.ROName, SelectedROFst.MyRODb.FolderPath);
|
||||
// only allow update if association, and the RO update was not done and/or not completed
|
||||
ppBtnUpRoVals.Enabled = !_DocVersionConfig.MyDocVersion.ROfstLastCompleted || _DocVersionConfig.MyDocVersion.NewerRoFst;
|
||||
}
|
||||
@@ -1465,7 +1521,7 @@ namespace VEPROMS
|
||||
if (!File.Exists(rofstPath))
|
||||
{
|
||||
FinalProgressBarMessage = "No existing RO.FST";
|
||||
MessageBox.Show($"No existing ro.fst in path {rdi.FolderPath}. Check for invalid path", "No existing RO.FST"); //B2017-125 added title to messagebox
|
||||
MessageBox.Show("No existing ro.fst in path " + rdi.FolderPath + ". Check for invalid path", "No existing RO.FST"); //B2017-125 added title to messagebox
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1525,26 +1581,29 @@ namespace VEPROMS
|
||||
private void ContentInfo_StaticContentInfoChange(object sender, StaticContentInfoEventArgs args)
|
||||
{
|
||||
if (args.Type == "RO")
|
||||
swROUpdate.Write($"Fixed Referenced Object for {(sender as ItemInfo).ShortPath}({(sender as ItemInfo).ItemID}){Environment.NewLine}Old Text: {args.OldValue}{Environment.NewLine}New Text: {args.NewValue}{Environment.NewLine}{Environment.NewLine}");
|
||||
swROUpdate.Write(string.Format("Fixed Referenced Object for {1}({4}){0}Old Text: {2}{0}New Text: {3}{0}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue, (sender as ItemInfo).ItemID));
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region (Output Settings)
|
||||
#region (Output Settings)
|
||||
|
||||
/// <summary>
|
||||
/// This is the Output Settings button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnOutputSettings_Click(object sender, EventArgs e) => ProcessButtonClick(tiOutputSettings, btnOutputSettings);
|
||||
/// <summary>
|
||||
/// This is the Output Settings button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnOutputSettings_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiOutputSettings, btnOutputSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection in Watermark combo box changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void ppCmbxWatermark_SelectedValueChanged(object sender, EventArgs e)
|
||||
/// <summary>
|
||||
/// Selection in Watermark combo box changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void ppCmbxWatermark_SelectedValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!_Initializing)
|
||||
{
|
||||
@@ -1830,6 +1889,26 @@ namespace VEPROMS
|
||||
deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Process a change in the combo box selection
|
||||
/// </summary>
|
||||
/// <param name="cmbx">Combo Box Name</param>
|
||||
/// <param name="defstr">string containing default text</param>
|
||||
/// <param name="button">button to reset to default value</param>
|
||||
/// <param name="deflabel">label containing the default</param>
|
||||
private void ProcessCmbxSelectedValueChange(ComboBoxEx cmbx, string defstr, ButtonX button, Label deflabel)
|
||||
{
|
||||
if (cmbx.SelectedIndex > -1 && !string.IsNullOrEmpty(defstr) && defstr.Equals(cmbx.SelectedValue))
|
||||
{
|
||||
button.Visible = true;
|
||||
button.Focus();
|
||||
button.PerformClick();
|
||||
}
|
||||
|
||||
button.Visible = cmbx.SelectedValue != null;
|
||||
deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the watermark and default label
|
||||
/// </summary>
|
||||
@@ -1846,28 +1925,34 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region (MergedOutputSettings)
|
||||
#region (MergedOutputSettings)
|
||||
|
||||
private void btnMergedOutputSettngs_Click(object sender, EventArgs e) => ProcessButtonClick(tiMergedOutputSettings, btnMergedOutputSettngs);
|
||||
private void btnMergedOutputSettngs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiMergedOutputSettings, btnMergedOutputSettngs);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Library Documents
|
||||
#region Library Documents
|
||||
|
||||
/// <summary>
|
||||
/// This is the Library Documents button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnLibDocs_Click(object sender, EventArgs e) => ProcessButtonClick(tiLibDocs, btnLibDocs);
|
||||
/// <summary>
|
||||
/// This is the Library Documents button used on the button interface design
|
||||
/// </summary>
|
||||
/// <param name="sender">object</param>
|
||||
/// <param name="e">EventArgs</param>
|
||||
private void btnLibDocs_Click(object sender, EventArgs e)
|
||||
{
|
||||
ProcessButtonClick(tiLibDocs, btnLibDocs);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
private void tbRoDb_TextChanged(object sender, EventArgs e)
|
||||
private void tbRoDb_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1887,7 +1972,10 @@ namespace VEPROMS
|
||||
#region Fields
|
||||
|
||||
private static int lastindex = 0;
|
||||
private int _index;
|
||||
|
||||
private bool _isDeleted;
|
||||
private bool _isDirty;
|
||||
private int _index;
|
||||
private int _versionID;
|
||||
private string _versionPathName;
|
||||
private string _name;
|
||||
@@ -1895,17 +1983,25 @@ namespace VEPROMS
|
||||
private string _pdfToken;
|
||||
private string _pdfXOffset;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
#region Properties
|
||||
|
||||
[XmlIgnore]
|
||||
public bool IsDeleted { get; set; }
|
||||
[XmlIgnore]
|
||||
public bool IsDeleted
|
||||
{
|
||||
get { return _isDeleted; }
|
||||
set { _isDeleted = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool IsDirty { get; set; }
|
||||
[XmlIgnore]
|
||||
public bool IsDirty
|
||||
{
|
||||
get { return _isDirty; }
|
||||
set { _isDirty = value; }
|
||||
}
|
||||
|
||||
[XmlAttribute("index")]
|
||||
[XmlAttribute("index")]
|
||||
public int Index
|
||||
{
|
||||
get { return _index; }
|
||||
@@ -1967,10 +2063,10 @@ namespace VEPROMS
|
||||
_type = string.Empty;
|
||||
_pdfToken = string.Empty;
|
||||
_pdfXOffset = string.Empty;
|
||||
IsDirty = false;
|
||||
_isDirty = false;
|
||||
}
|
||||
|
||||
public EnhancedMiniConfig(int index, int versionid, string versionPathName, string name, string type, string pdftoken, string pdfxoffset)
|
||||
public EnhancedMiniConfig(int index, int versionid, string id, string versionPathName, string name, string type, string pdftoken, string pdfxoffset)
|
||||
{
|
||||
_index = index;
|
||||
_versionID = versionid;
|
||||
@@ -1979,17 +2075,20 @@ namespace VEPROMS
|
||||
_type = type;
|
||||
_pdfToken = pdftoken;
|
||||
_pdfXOffset = pdfxoffset;
|
||||
IsDirty = false;
|
||||
_isDirty = false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
#region Public Methods
|
||||
|
||||
public override string ToString() => Name;
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -2002,7 +2101,10 @@ namespace VEPROMS
|
||||
#region Fields
|
||||
|
||||
private static int lastindex = 0;
|
||||
private int _index;
|
||||
|
||||
private bool _isDeleted;
|
||||
private bool _isDirty;
|
||||
private int _index;
|
||||
private string _iD;
|
||||
private string _name;
|
||||
private string _number;
|
||||
@@ -2015,17 +2117,25 @@ namespace VEPROMS
|
||||
private string _otherNumber;
|
||||
private string _otherText;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
#region Properties
|
||||
|
||||
[XmlIgnore]
|
||||
public bool IsDeleted { get; set; }
|
||||
[XmlIgnore]
|
||||
public bool IsDeleted
|
||||
{
|
||||
get { return _isDeleted; }
|
||||
set { _isDeleted = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool IsDirty { get; set; }
|
||||
[XmlIgnore]
|
||||
public bool IsDirty
|
||||
{
|
||||
get { return _isDirty; }
|
||||
set { _isDirty = value; }
|
||||
}
|
||||
|
||||
[XmlAttribute("index")]
|
||||
[XmlAttribute("index")]
|
||||
public int Index
|
||||
{
|
||||
get { return _index; }
|
||||
@@ -2127,7 +2237,7 @@ namespace VEPROMS
|
||||
_otherName = string.Empty;
|
||||
_otherNumber = string.Empty;
|
||||
_otherText = string.Empty;
|
||||
IsDirty = false;
|
||||
_isDirty = false;
|
||||
}
|
||||
|
||||
public MiniConfig(int index, string id, string name, string number, string text, string procedurenumber, string setid, string setname, string otherid, string othername, string othernumber, string othertext)
|
||||
@@ -2144,19 +2254,25 @@ namespace VEPROMS
|
||||
_otherName = othername;
|
||||
_otherNumber = othernumber;
|
||||
_otherText = othertext;
|
||||
IsDirty = false;
|
||||
_isDirty = false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
#region Public Methods
|
||||
|
||||
public override string ToString() => Name;
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
public string MyXml => GenericSerializer<MiniConfig>.StringSerialize(this);
|
||||
public string MyXml
|
||||
{
|
||||
get { return GenericSerializer<MiniConfig>.StringSerialize(this); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1258,7 +1258,7 @@ namespace VEPROMS.CSLA.Library
|
||||
|
||||
int lastStart = sel == null ? 0 : sel.Start;
|
||||
|
||||
while (sel != null)
|
||||
while (sel != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(sel.Text))
|
||||
{
|
||||
@@ -1438,7 +1438,7 @@ namespace VEPROMS.CSLA.Library
|
||||
|
||||
lastStart = sel.Start;
|
||||
|
||||
sel = FindRO();
|
||||
sel = FindRO();
|
||||
|
||||
if (sel != null && !string.IsNullOrEmpty(sel.Text) && sel.Start == lastStart)
|
||||
{
|
||||
@@ -2124,22 +2124,22 @@ namespace VEPROMS.CSLA.Library
|
||||
bool executeResult = false;
|
||||
LBSelection sel = null;
|
||||
|
||||
while (!executeResult)
|
||||
while (!executeResult)
|
||||
{
|
||||
sel = MyApp.Selection;
|
||||
LBFind find = sel.Find;
|
||||
find.ClearFormatting();
|
||||
|
||||
// Search string format - this is MSWord wildcard format
|
||||
// If you do a search in MSWord, make sure wildcard box is checked and then press the
|
||||
// Special button to see the definitions of the various wildcards
|
||||
// [<] - Less-Than Character
|
||||
// [!<> -]@ - 1 or more characters not including Less-Than, Greater-Than, Dash or Space
|
||||
// - Dash
|
||||
// [!<>]@ - 1 or more characters not including Less-Than, Greater-Than.
|
||||
// a space be included as part of the accessory page id (Callaway, EOP Addendum 37)
|
||||
// [>] - Greater-Than Character
|
||||
find.Text = "[<][!<> -]@-[!<>]@[>]";
|
||||
// Search string format - this is MSWord wildcard format
|
||||
// If you do a search in MSWord, make sure wildcard box is checked and then press the
|
||||
// Special button to see the definitions of the various wildcards
|
||||
// [<] - Less-Than Character
|
||||
// [!<> -]@ - 1 or more characters not including Less-Than, Greater-Than, Dash or Space
|
||||
// - Dash
|
||||
// [!<>]@ - 1 or more characters not including Less-Than, Greater-Than.
|
||||
// a space be included as part of the accessory page id (Callaway, EOP Addendum 37)
|
||||
// [>] - Greater-Than Character
|
||||
find.Text = "[<][!<> -]@-[!<>]@[>]";
|
||||
find.Wrap = LBWdFindWrap.wdFindContinue;
|
||||
find.MatchCase = false;
|
||||
find.MatchWholeWord = false;
|
||||
@@ -2159,18 +2159,14 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
tryagain = false;
|
||||
executeResult = find.Execute();
|
||||
// B2022-053 if the found text does not begin with a "<" and end with a ">", then
|
||||
// move past that text and try the Word Find function again.
|
||||
// B2022-088: [JPR] Find Doc Ro button not working in Word Sections
|
||||
// B2022-098: [JPR] ROs not being resolved in Word Sections
|
||||
// B2026-070: When there is a less-then sign (<) followed by a numeric value in a Word attachment (inside of a table), PROMS thinks the user put in an RO token will generate an RO not found error in the following table row who's text contains <U-Name>.
|
||||
// B2022-053 if the found text does not begin with a "<" and end with a ">", then
|
||||
// move past that text and try the Word Find function again.
|
||||
// B2022-088: [JPR] Find Doc Ro button not working in Word Sections
|
||||
// B2022-098: [JPR] ROs not being resolved in Word Sections
|
||||
if (executeResult && !string.IsNullOrEmpty(sel.Text) && !sel.Text.StartsWith("<") && !sel.Text.EndsWith(">"))
|
||||
{
|
||||
int location = sel.Start + sel.Text.Length - 1; //do not do this inline - this needs captured before WholeStory
|
||||
|
||||
sel.WholeStory();
|
||||
sel.MoveStart(LBWdUnits.wdCharacter, location);
|
||||
tryagain = true;
|
||||
{
|
||||
sel.MoveStart(LBWdUnits.wdCharacter, sel.Text.Length - 1);
|
||||
tryagain = true;
|
||||
}
|
||||
} while (tryagain);
|
||||
|
||||
@@ -2195,7 +2191,7 @@ namespace VEPROMS.CSLA.Library
|
||||
sel.MoveStart(LBWdUnits.wdCharacter, 1);
|
||||
executeResult = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (executeResult) return sel;
|
||||
|
||||
|
||||
@@ -7279,6 +7279,7 @@ namespace VEPROMS.CSLA.Library
|
||||
_ByWordSuffix = byWordSuffix;
|
||||
}
|
||||
}
|
||||
|
||||
private void DataPortal_Fetch(ItemListSearchCriteria criteria)
|
||||
{
|
||||
this.RaiseListChangedEvents = false;
|
||||
|
||||
@@ -262,10 +262,8 @@ namespace VEPROMS.CSLA.Library
|
||||
if (dvi.DocVersionAssociations[0].MyROFst.ROFstID != newfstid)
|
||||
{
|
||||
dv.DocVersionAssociations[0].MyROFst = localROFst.GetJustROFst();
|
||||
SetAssociationLastCompleted(dv, DateTime.Now.ToString());
|
||||
}
|
||||
// B2026-066 moved this out of if statement above
|
||||
// - was not resetting the datetime and thus not disabling the Update RO Values button and menu item
|
||||
SetAssociationLastCompleted(dv, DateTime.Now.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+135
-14
@@ -1,5 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using iTextSharp.text.pdf;
|
||||
using iTextSharp.text.factories;
|
||||
using Microsoft.Win32;
|
||||
using Volian.Base.Library;
|
||||
|
||||
namespace VG
|
||||
@@ -20,25 +25,141 @@ namespace VG
|
||||
}
|
||||
public partial class VGOut_Graphics: IVGOutput
|
||||
{
|
||||
public int DebugStatus { get; set; } = 0;
|
||||
private readonly Graphics _VGOutput;
|
||||
public VGOut_Graphics(Graphics vgOutput) => _VGOutput = vgOutput;
|
||||
public float Scale => 1;
|
||||
public void DrawLine(Pen pn, float startx, float starty, float endx, float endy) => _VGOutput.DrawLine(pn, startx, starty, endx, endy);
|
||||
public void DrawRectangle(Pen pn, RectangleF rectf)
|
||||
private int _DebugStatus = 0;
|
||||
public int DebugStatus
|
||||
{
|
||||
get { return _DebugStatus; }
|
||||
set { _DebugStatus = value; }
|
||||
}
|
||||
private Graphics _VGOutput;
|
||||
//public Graphics VGOutput
|
||||
//{ get { return _VGOutput; } }
|
||||
public VGOut_Graphics(Graphics vgOutput)
|
||||
{ _VGOutput = vgOutput; }
|
||||
public float Scale
|
||||
{ get { return 1; } }
|
||||
//{ get { return _VGOutput.Transform.Elements[0]; } }
|
||||
public void DrawLine(Pen pn, float startx, float starty, float endx, float endy)
|
||||
{ _VGOutput.DrawLine(pn, startx, starty, endx, endy); }
|
||||
public void DrawRectangle(Pen pn, RectangleF rectf)
|
||||
{
|
||||
_VGOutput.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy;
|
||||
_VGOutput.FillRectangle(DebugStatus == 1 ? Brushes.Transparent : Brushes.White, rectf.X, rectf.Y, rectf.Width, rectf.Height);
|
||||
_VGOutput.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
|
||||
_VGOutput.DrawRectangle(pn, rectf.X, rectf.Y, rectf.Width, rectf.Height);
|
||||
}
|
||||
public void DrawEllipse(Pen pn, float cx, float cy, float dx, float dy) => _VGOutput.DrawEllipse(pn, cx, cy, dx, dy);
|
||||
public void DrawImage(Bitmap bm, RectangleF rectf) => _VGOutput.DrawImage(bm, rectf);
|
||||
public void DrawString(string text, Font myFont, Brush brush, RectangleF rectf) => _VGOutput.DrawString(text, myFont, brush, rectf, StringFormat.GenericTypographic);
|
||||
public void DrawArc(Pen pn, RectangleF rectf, float startAngle, float sweepAngle) => _VGOutput.DrawArc(pn, rectf, startAngle, sweepAngle);
|
||||
public SizeF MeasureString(string text, Font myFont) => _VGOutput.MeasureString(text, myFont, new PointF(0, 0), StringFormat.GenericTypographic);
|
||||
public void Save(string fileName)
|
||||
public void DrawEllipse(Pen pn, float cx, float cy, float dx, float dy)
|
||||
{ _VGOutput.DrawEllipse(pn, cx, cy, dx, dy); }
|
||||
public void DrawImage(Bitmap bm, RectangleF rectf)
|
||||
{ _VGOutput.DrawImage(bm, rectf); }
|
||||
public void DrawString(string text, Font myFont, Brush brush, RectangleF rectf)
|
||||
{ _VGOutput.DrawString(text, myFont, brush, rectf, StringFormat.GenericTypographic); }
|
||||
public void DrawArc(Pen pn, RectangleF rectf, float startAngle, float sweepAngle)
|
||||
{ _VGOutput.DrawArc(pn, rectf, startAngle, sweepAngle); }
|
||||
public SizeF MeasureString(string text, Font myFont)
|
||||
{ return _VGOutput.MeasureString(text, myFont, new PointF(0, 0), StringFormat.GenericTypographic); }
|
||||
public void Save(string fileName)
|
||||
{ ;/* Don't do anything*/ }
|
||||
public float FontSizeAdjust => .71f * 96f / _VGOutput.DpiX; // Changed to adjust for Screen DPI Setting
|
||||
}
|
||||
public float FontSizeAdjust
|
||||
{ get { return .71f * 96f / _VGOutput.DpiX; } } // Changed to adjust for Screen DPI Setting
|
||||
}
|
||||
public partial class VGOut_ITextSharp : IVGOutput
|
||||
{
|
||||
private int _DebugStatus = 0;
|
||||
public int DebugStatus
|
||||
{
|
||||
get { return _DebugStatus; }
|
||||
set { _DebugStatus = value; }
|
||||
}
|
||||
private PdfContentByte _VGOutput;
|
||||
//public Graphics VGOutput
|
||||
//{ get { return _VGOutput; } }
|
||||
public VGOut_ITextSharp(PdfContentByte vgOutput)
|
||||
{ _VGOutput = vgOutput; }
|
||||
public float Scale
|
||||
{ get { return 1; } }
|
||||
public void DrawLine(Pen pn, float startx, float starty, float endx, float endy)
|
||||
{
|
||||
_VGOutput.SaveState();
|
||||
SetStrokeData(pn);
|
||||
_VGOutput.MoveTo(startx, ScaleY(starty));
|
||||
_VGOutput.LineTo(endx, ScaleY(endy));
|
||||
_VGOutput.Stroke();
|
||||
_VGOutput.RestoreState();
|
||||
}
|
||||
private void SetStrokeData(Pen pn)
|
||||
{
|
||||
_VGOutput.SetLineWidth(pn.Width);
|
||||
_VGOutput.SetColorStroke(new iTextSharp.text.Color(pn.Color.R, pn.Color.G, pn.Color.B, pn.Color.A));
|
||||
}
|
||||
public void DrawRectangle(Pen pn, RectangleF rectf)
|
||||
{
|
||||
_VGOutput.SaveState();
|
||||
SetStrokeData(pn);
|
||||
_VGOutput.Rectangle(rectf.X, ScaleY(rectf.Y), rectf.Width, -rectf.Height);
|
||||
_VGOutput.Stroke();
|
||||
_VGOutput.RestoreState();
|
||||
}
|
||||
public void DrawEllipse(Pen pn, float cx, float cy, float dx, float dy)
|
||||
{
|
||||
_VGOutput.SaveState();
|
||||
SetStrokeData(pn);
|
||||
_VGOutput.Ellipse(cx, ScaleY(cy), dx, -dy);
|
||||
_VGOutput.Stroke();
|
||||
_VGOutput.RestoreState();
|
||||
}
|
||||
public void DrawImage(Bitmap bm, RectangleF rectf)
|
||||
{
|
||||
_VGOutput.SaveState();
|
||||
// TODO: Determine how I can create an iTextSharp.text.Image
|
||||
//_VGOutput.AddImage(new iTextSharp.text.Image(
|
||||
_VGOutput.RestoreState();
|
||||
}
|
||||
public void DrawString(string text, Font myFont, Brush brush, RectangleF rectf)
|
||||
{
|
||||
_VGOutput.SaveState();
|
||||
_VGOutput.BeginText();
|
||||
iTextSharp.text.Font itFont = GetFont(myFont.Name);
|
||||
iTextSharp.text.pdf.BaseFont baseFont = itFont.BaseFont;
|
||||
// _VGOutput.DrawString(text, myFont, brush, rectf, StringFormat.GenericTypographic);
|
||||
_VGOutput.MoveText(rectf.X, ScaleY(rectf.Y) - myFont.SizeInPoints);
|
||||
_VGOutput.SetFontAndSize(baseFont, myFont.SizeInPoints);
|
||||
_VGOutput.SetTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL);
|
||||
_VGOutput.ShowTextKerned(text);
|
||||
_VGOutput.EndText();
|
||||
_VGOutput.RestoreState();
|
||||
}
|
||||
public void DrawArc(Pen pn, RectangleF rectf, float startAngle, float sweepAngle)
|
||||
{
|
||||
_VGOutput.SaveState();
|
||||
SetStrokeData(pn);
|
||||
_VGOutput.Arc(rectf.X, ScaleY(rectf.Y), rectf.X + rectf.Width, ScaleY(rectf.Y + rectf.Height), -startAngle, -sweepAngle);
|
||||
_VGOutput.Stroke();
|
||||
_VGOutput.RestoreState();
|
||||
}
|
||||
public SizeF MeasureString(string text, Font myFont)
|
||||
{
|
||||
iTextSharp.text.Font itFont = GetFont(myFont.Name);
|
||||
iTextSharp.text.pdf.BaseFont baseFont = itFont.BaseFont;
|
||||
return new SizeF(baseFont.GetWidthPoint(text,myFont.SizeInPoints)
|
||||
, baseFont.GetAscentPoint(text, myFont.SizeInPoints) + baseFont.GetDescentPoint(text, myFont.SizeInPoints));
|
||||
}
|
||||
public void Save(string fileName)
|
||||
{ ;/* Don't do anything*/ }
|
||||
public float FontSizeAdjust
|
||||
{ get { return 1; } } // Changed to adjust for Screen DPI Setting
|
||||
public static iTextSharp.text.Font GetFont(string fontName)
|
||||
{
|
||||
/// <summary>
|
||||
/// B2019-116 Volian.Base.Library This is a generic class for dealing with iTextSharp Fonts
|
||||
/// Code moved and consolidated from Volian.Print.Library Volian PDF.Library and VG
|
||||
/// </summary>
|
||||
VlnItextFont.RegisterFont(fontName);
|
||||
return iTextSharp.text.FontFactory.GetFont(fontName, BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
|
||||
}
|
||||
private float ScaleY(float y)
|
||||
{
|
||||
return _VGOutput.PdfWriter.PageSize.Height - y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+168
-39
@@ -20,34 +20,64 @@ namespace VG
|
||||
// Temporary page class to store portrait/landscape, Left Margin, Vertical offset, etc
|
||||
public class Page
|
||||
{
|
||||
public bool Portrait { get; set; } = true;
|
||||
public float LeftMargin { get; set; } = 0;
|
||||
public float TopMargin { get; set; } = 0;
|
||||
public float RightMargin { get; set; } = 0;
|
||||
public float BottomMargin { get; set; } = 0;
|
||||
public Page(bool portrait, float leftMargin, float topMargin, float rightMargin, float bottomMargin)
|
||||
private bool _Portrait = true;
|
||||
public bool Portrait
|
||||
{
|
||||
Portrait = portrait;
|
||||
LeftMargin = leftMargin;
|
||||
TopMargin = topMargin;
|
||||
RightMargin = rightMargin;
|
||||
BottomMargin = bottomMargin;
|
||||
get { return _Portrait; }
|
||||
set { _Portrait = value; }
|
||||
}
|
||||
private float _LeftMargin = 0;
|
||||
public float LeftMargin
|
||||
{
|
||||
get { return _LeftMargin; }
|
||||
set { _LeftMargin = value; }
|
||||
}
|
||||
private float _TopMargin = 0;
|
||||
public float TopMargin
|
||||
{
|
||||
get { return _TopMargin; }
|
||||
set { _TopMargin = value; }
|
||||
}
|
||||
private float _RightMargin = 0;
|
||||
public float RightMargin
|
||||
{
|
||||
get { return _RightMargin; }
|
||||
set { _RightMargin = value; }
|
||||
}
|
||||
private float _BottomMargin = 0;
|
||||
public float BottomMargin
|
||||
{
|
||||
get { return _BottomMargin; }
|
||||
set { _BottomMargin = value; }
|
||||
}
|
||||
public Page(bool portrait, float leftMargin, float topMargin, float rightMargin, float bottomMargin)
|
||||
{
|
||||
_Portrait = portrait;
|
||||
_LeftMargin = leftMargin;
|
||||
_TopMargin = topMargin;
|
||||
_RightMargin = rightMargin;
|
||||
_BottomMargin = bottomMargin;
|
||||
}
|
||||
public Page(bool portrait, float leftMargin, float topMargin)
|
||||
{
|
||||
Portrait = portrait;
|
||||
LeftMargin = leftMargin;
|
||||
TopMargin = topMargin;
|
||||
_Portrait = portrait;
|
||||
_LeftMargin = leftMargin;
|
||||
_TopMargin = topMargin;
|
||||
}
|
||||
}
|
||||
public class VG
|
||||
{
|
||||
public static Brush BlackBrush { get; set; } = Brushes.Black;
|
||||
private static Color _BlackColor = Color.Black;
|
||||
private static Brush _BlackBrush = Brushes.Black;
|
||||
public static Brush BlackBrush
|
||||
{
|
||||
get { return _BlackBrush; }
|
||||
set { _BlackBrush = value; }
|
||||
}
|
||||
private static Color _BlackColor = Color.Black;
|
||||
public static Color BlackColor
|
||||
{
|
||||
get { return _BlackColor; }
|
||||
set { _BlackColor = value; BlackBrush = new SolidBrush(value); }
|
||||
set { _BlackColor = value; _BlackBrush = new SolidBrush(value); }
|
||||
}
|
||||
// Values of vector graphics items are stored as twips (1440 twips in an inch)
|
||||
public int cx;
|
||||
@@ -75,12 +105,16 @@ namespace VG
|
||||
MoveAbsolute = ima;
|
||||
pg = ipg;
|
||||
}
|
||||
public float ToPoints(float twip) => (float)(((float)twip) * 0.05f);
|
||||
public void UpdatePageInfo(Page pa)
|
||||
public float ToPoints(float twip)
|
||||
{
|
||||
float r = ((float)twip) * 0.05f;
|
||||
return r;
|
||||
}
|
||||
public void UpdatePageInfo(Page pa)
|
||||
{
|
||||
pg.LeftMargin = pa.LeftMargin;
|
||||
pg.Portrait = pa.Portrait;
|
||||
pg.TopMargin = pa.TopMargin;
|
||||
pg.Portrait = pa.Portrait; // RHM 20081003 - This had been pg.portrait=pg.portrait
|
||||
pg.TopMargin = pa.TopMargin; // RHM 20081003 - This had been pg.VertOffset=pg.VertOffset
|
||||
}
|
||||
public string AddRTFBUI(string origStr, string bold, string underline, string italics)
|
||||
{
|
||||
@@ -111,6 +145,7 @@ namespace VG
|
||||
int B1 = (int)(colorFraction * color.B);
|
||||
int B2 = (int)((1 - colorFraction) * Color.White.B);
|
||||
pn = new Pen(Color.FromArgb(R1 + R2, G1 + G2, B1 + B2), scaleWid);
|
||||
//pn = new Pen(color, wid*wid);
|
||||
}
|
||||
else
|
||||
pn = new Pen(color, scaleWid);
|
||||
@@ -182,14 +217,74 @@ namespace VG
|
||||
vgOutput.DrawRectangle(pn, rc);
|
||||
}
|
||||
}
|
||||
public class VG_Image : VG
|
||||
{
|
||||
private int Scale;
|
||||
private string FileName;
|
||||
// Image is defined as starting point, scale factor (defaults to 1) & image file name
|
||||
public VG_Image(int sx, int sy, int iscale, string fname)
|
||||
{
|
||||
cx = sx;
|
||||
cy = sy;
|
||||
Scale = 1;
|
||||
FileName = fname;
|
||||
}
|
||||
public VG_Image(XmlElement svg, Page ipg)
|
||||
{
|
||||
cx = System.Convert.ToInt32(svg.GetAttribute("x"));
|
||||
cy = System.Convert.ToInt32(svg.GetAttribute("y"));
|
||||
Scale = 1;
|
||||
if (svg.HasAttribute("scale")) Scale = System.Convert.ToInt32(svg.GetAttribute("scale"));
|
||||
FileName = svg.GetAttribute("bname");
|
||||
pg = ipg;
|
||||
}
|
||||
public void Draw(IVGOutput vgOutput)
|
||||
{
|
||||
Pen pn = new Pen(VG.BlackBrush, lnwid);
|
||||
Bitmap bm = new Bitmap(FileName);
|
||||
RectangleF rc = new RectangleF();
|
||||
rc.Height = ToPoints((bm.Height * Scale) * 4.8f);
|
||||
rc.Width = ToPoints((bm.Width * Scale) * 4.8f);
|
||||
rc.X = ToPoints(pg.LeftMargin + cx);
|
||||
rc.Y = ToPoints(pg.TopMargin + cy);
|
||||
// TODO: grfx.DrawImage(bm, rc, ContentAlignment.MiddleCenter, ImageSizeModeEnum.Scale);
|
||||
}
|
||||
}
|
||||
public class VG_Ellipse : VG
|
||||
{
|
||||
// Ellipse (circle) is defined by a bounding rectangle specified by a coordinate pair, a width, and a height
|
||||
public VG_Ellipse(int sx, int sy, int ex, int ey, int w, Page ipg)
|
||||
{
|
||||
cx = sx;
|
||||
cy = sy;
|
||||
dx = ex;
|
||||
dy = ey;
|
||||
lnwid = w;
|
||||
pg = ipg;
|
||||
}
|
||||
public VG_Ellipse(XmlElement svg, Page ipg)
|
||||
{
|
||||
cx = System.Convert.ToInt32(svg.GetAttribute("cx"));
|
||||
cy = System.Convert.ToInt32(svg.GetAttribute("cy"));
|
||||
dx = System.Convert.ToInt32(svg.GetAttribute("rx"));
|
||||
dy = System.Convert.ToInt32(svg.GetAttribute("ry"));
|
||||
lnwid = System.Convert.ToInt32(svg.GetAttribute("stroke-width"));
|
||||
pg = ipg;
|
||||
}
|
||||
public void Draw(IVGOutput vgOutput)
|
||||
{
|
||||
Pen pn = new Pen(VG.BlackBrush, ToPoints(lnwid));
|
||||
vgOutput.DrawEllipse(pn, ToPoints(pg.LeftMargin + cx), ToPoints(pg.TopMargin + cy), ToPoints(dx), ToPoints(dy));
|
||||
}
|
||||
}
|
||||
public class VG_Text : VG
|
||||
{
|
||||
private readonly string FontName;
|
||||
private readonly int FontSize;
|
||||
private readonly string Bold;
|
||||
private readonly string Underline;
|
||||
private readonly string Italics;
|
||||
private readonly string Text;
|
||||
private string FontName;
|
||||
private int FontSize;
|
||||
private string Bold;
|
||||
private string Underline;
|
||||
private string Italics;
|
||||
private string Text;
|
||||
// Text is defined by a starting location, attributes & the string
|
||||
public VG_Text(int sx, int sy, int fs, string txt, string fn, string ibold, string iunder, string iitalics, Page ipg)
|
||||
{
|
||||
@@ -202,28 +297,48 @@ namespace VG
|
||||
Underline = iunder;
|
||||
Italics = iitalics;
|
||||
pg = ipg;
|
||||
// TODO: The following were in the 16-bit code - we may need to use these, wait and see
|
||||
// strokeWidth = stroke;
|
||||
// strokeWidthBold = strokebold;
|
||||
// ULOffset = UnderlineOffset;
|
||||
// ULWidth = UnderlineWidth;
|
||||
}
|
||||
public VG_Text(XmlElement svg, Page ipg)
|
||||
{
|
||||
cx = System.Convert.ToInt32(svg.GetAttribute("x"));
|
||||
cy = System.Convert.ToInt32(svg.GetAttribute("y"));
|
||||
FontSize = System.Convert.ToInt32(svg.GetAttribute("font-size"));
|
||||
Bold = svg.GetAttribute("font-weight");
|
||||
Underline = svg.GetAttribute("text-decoration");
|
||||
Italics = svg.GetAttribute("font-style");
|
||||
FontName = svg.GetAttribute("font-family");
|
||||
Text = svg.InnerText;
|
||||
pg = ipg;
|
||||
}
|
||||
public void Draw(IVGOutput vgOutput)
|
||||
{
|
||||
// TODO: Font myfont = new Font(FontName, (FontSize*9)/10);
|
||||
Font myfont = new Font(FontName, FontSize * vgOutput.FontSizeAdjust); // TODO: Trying 80%
|
||||
RectangleF rc = new RectangleF
|
||||
{
|
||||
// the returned value from c1 grfx code is already in points,
|
||||
// so need to convert the size.
|
||||
Size = vgOutput.MeasureString(Text, myfont), // TODO: 500 or pagewidth, or what
|
||||
//rc.Size = grfx.MeasureString(Text, myfont, 500); // TODO: 500 or pagewidth, or what
|
||||
X = ToPoints(pg.LeftMargin + cx),
|
||||
Y = ToPoints(pg.TopMargin + cy) - FontSize
|
||||
};
|
||||
rc.Height *= 1.0000001F; // Small factor to make text visible.
|
||||
RectangleF rc = new RectangleF();
|
||||
// the returned value from c1 grfx code is already in points,
|
||||
// so need to convert the size.
|
||||
rc.Size = vgOutput.MeasureString(Text, myfont); // TODO: 500 or pagewidth, or what
|
||||
//rc.Size = grfx.MeasureString(Text, myfont, 500); // TODO: 500 or pagewidth, or what
|
||||
rc.X = ToPoints(pg.LeftMargin + cx);
|
||||
rc.Y = ToPoints(pg.TopMargin + cy) - FontSize;
|
||||
rc.Height *= 1.0000001F; // Small factor to make text visible.
|
||||
// add bold, underline & italics for entire object.
|
||||
// TODO: string rtfout = AddRTFBUI(Text, Bold, Underline, Italics);
|
||||
//using(Pen pn = new Pen(Color.DarkBlue, .1F))
|
||||
// grfx.DrawRectangle(pn, rc.X,rc.Y,rc.Width,rc.Height);
|
||||
vgOutput.DrawString(Text, myfont, VG.BlackBrush, rc);
|
||||
//grfx.DrawString(Text, myfont, VG.BlackBrush, rc);
|
||||
}
|
||||
}
|
||||
public class VG_Arc : VG
|
||||
{
|
||||
public float sweepAngle;
|
||||
public float startAngle;
|
||||
public Single sweepAngle;
|
||||
public Single startAngle;
|
||||
public float stX, stY;
|
||||
public float rWid, rHgt;
|
||||
// Arc is defined by a bounding rectangle specified by a coordinate pair, a width, and a height
|
||||
@@ -250,7 +365,9 @@ namespace VG
|
||||
rHgt = -hight;
|
||||
}
|
||||
startAngle = stAngle;
|
||||
// startAngle = 90;
|
||||
sweepAngle = swpAngle;
|
||||
// sweepAngle = -45;
|
||||
lnwid = w;
|
||||
pg = ipg;
|
||||
}
|
||||
@@ -274,6 +391,18 @@ namespace VG
|
||||
float starty = pg.Portrait ? (stY + pg.TopMargin) : (pg.LeftMargin - stX);
|
||||
RectangleF rc = new RectangleF(ToPoints(startx), ToPoints(starty), ToPoints(rWid), ToPoints(rHgt));
|
||||
//Console.WriteLine("{0},'{1}',{2},{3},{4},{5},{6},{7}", iColor, pn.Color, rc.X, rc.Y, rc.Width, rc.Height, startAngle, sweepAngle);
|
||||
//if (iColor == 7 || iColor == 8) return;
|
||||
//if (iColor == 6) return;
|
||||
//if (iColor == 4 || iColor == 6)
|
||||
//{
|
||||
// using (Pen lightPen = new Pen(myColors[iColor % myColors.Length], .01F))
|
||||
//{
|
||||
// vgOutput.DrawEllipse(lightPen, rc.X, rc.Y, rc.Width, rc.Height);
|
||||
// float xc = rc.X + (rc.Width / 2);
|
||||
// float yc = rc.Y + (rc.Height / 2);
|
||||
// vgOutput.DrawEllipse(lightPen, xc - .5F, yc - .5F, 1F, 1F);
|
||||
//}
|
||||
//}
|
||||
if (sweepAngle > 0)
|
||||
vgOutput.DrawArc(pn, rc, startAngle, sweepAngle);
|
||||
else
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
|
||||
namespace Volian.Base.Library
|
||||
{
|
||||
public static class BaseLnSettings
|
||||
{
|
||||
public static bool blBaseLine { get; set; } = false;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ using System.Xml.Serialization;
|
||||
namespace Volian.Base.Library
|
||||
{
|
||||
[Serializable()]
|
||||
//[XmlRoot("BigNum")]
|
||||
public class BigNum
|
||||
{
|
||||
#region fields
|
||||
@@ -21,10 +22,19 @@ namespace Volian.Base.Library
|
||||
public BigNum()
|
||||
{
|
||||
}
|
||||
public BigNum(int value) => SetFlag(value);
|
||||
public BigNum(string values) => SetFlags(values);
|
||||
public BigNum(ICollection<int> values) => SetFlags(values);
|
||||
public override string ToString()
|
||||
public BigNum(int value)
|
||||
{
|
||||
SetFlag(value);
|
||||
}
|
||||
public BigNum(string values)
|
||||
{
|
||||
SetFlags(values);
|
||||
}
|
||||
public BigNum(ICollection<int> values)
|
||||
{
|
||||
SetFlags(values);
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return FlagList;
|
||||
}
|
||||
@@ -48,6 +58,10 @@ namespace Volian.Base.Library
|
||||
}
|
||||
#endregion
|
||||
#region methods
|
||||
//public override string ToString()
|
||||
//{
|
||||
// return GenericSerializer<BigNum>.StringSerialize(this);
|
||||
//}
|
||||
public bool Includes(BigNum other)
|
||||
{
|
||||
List<int> mine = GetFlags();
|
||||
@@ -68,6 +82,12 @@ namespace Volian.Base.Library
|
||||
public List<int> GetFlags()
|
||||
{
|
||||
List<int> myints = new List<int>();
|
||||
//if (MyValue.Count == 0)//1 && MyValue.ContainsKey(0) && MyValue[0] == 0)
|
||||
//{
|
||||
// myints.Add(-1);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
foreach (uint key in MyValue.Keys)
|
||||
{
|
||||
ulong y = MyValue[key];
|
||||
@@ -77,10 +97,18 @@ namespace Volian.Base.Library
|
||||
myints.Add((int)(i + (key * 64)));
|
||||
}
|
||||
}
|
||||
//}
|
||||
return myints;
|
||||
}
|
||||
public void SetFlag(int flag)
|
||||
{
|
||||
//if (flag == -1)
|
||||
//{
|
||||
// MyValue = new SortedDictionary<uint, ulong>();
|
||||
// //MyValue.Add(0, 0);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
uint offset = (uint)(flag / 64);
|
||||
ulong x = one << (flag % 64);
|
||||
if (MyValue.ContainsKey(offset))
|
||||
@@ -94,10 +122,15 @@ namespace Volian.Base.Library
|
||||
foreach (int f in flags)
|
||||
SetFlag(f);
|
||||
}
|
||||
public static BigNum MakeBigNum(string numbers) => numbers == "-1" ? null : new BigNum(numbers);
|
||||
#endregion
|
||||
#region properties
|
||||
[XmlAttribute]
|
||||
public static BigNum MakeBigNum(string numbers)
|
||||
{
|
||||
if (numbers == "-1")
|
||||
return null;
|
||||
return new BigNum(numbers);
|
||||
}
|
||||
#endregion
|
||||
#region properties
|
||||
[XmlAttribute]
|
||||
public string FlagList
|
||||
{
|
||||
get
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
namespace Volian.Base.Library
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Volian.Base.Library
|
||||
{
|
||||
public static class ByteArrayCompare
|
||||
{
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace Volian.Base.Library
|
||||
{
|
||||
public class DebugPrint:IDisposable
|
||||
{
|
||||
public void Dispose() => Close();
|
||||
private StreamWriter _MyStreamWriter = null;
|
||||
public void Dispose()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
private StreamWriter _MyStreamWriter = null;
|
||||
public StreamWriter MyStreamWriter
|
||||
{
|
||||
get { return _MyStreamWriter; }
|
||||
@@ -20,8 +25,11 @@ namespace Volian.Base.Library
|
||||
_MyStreamWriter = value;
|
||||
}
|
||||
}
|
||||
public bool IsOpen => MyStreamWriter != null;
|
||||
private string _FileName = null;
|
||||
public bool IsOpen
|
||||
{
|
||||
get { return MyStreamWriter != null; }
|
||||
}
|
||||
private string _FileName = null;
|
||||
public string FileName
|
||||
{
|
||||
get { return _FileName; }
|
||||
@@ -32,15 +40,22 @@ namespace Volian.Base.Library
|
||||
MyFileInfo = new FileInfo(value);
|
||||
}
|
||||
}
|
||||
|
||||
public FileInfo MyFileInfo { get; set; }
|
||||
public void Open(string fileName)
|
||||
private FileInfo _MyFileInfo;
|
||||
public FileInfo MyFileInfo
|
||||
{
|
||||
get { return _MyFileInfo; }
|
||||
set { _MyFileInfo = value; }
|
||||
}
|
||||
public void Open(string fileName)
|
||||
{
|
||||
FileName = fileName;
|
||||
MyStreamWriter = MyFileInfo.CreateText();
|
||||
}
|
||||
public void Close() => MyStreamWriter = null;
|
||||
public void Write(string format, params object[] args)
|
||||
public void Close()
|
||||
{
|
||||
MyStreamWriter = null;
|
||||
}
|
||||
public void Write(string format, params object[] args)
|
||||
{
|
||||
if (IsOpen) MyStreamWriter.Write(format, args);
|
||||
}
|
||||
@@ -58,62 +73,98 @@ namespace Volian.Base.Library
|
||||
}
|
||||
public static class DebugPagination
|
||||
{
|
||||
public static int TotalPages { get; set; } = 0;
|
||||
private static readonly DebugPrint _MyDebugPrint = new DebugPrint();
|
||||
public static void Open(string fileName) => _MyDebugPrint.Open(fileName);
|
||||
public static void Close()
|
||||
private static int _TotalPages = 0;
|
||||
public static int TotalPages
|
||||
{
|
||||
get { return _TotalPages; }
|
||||
set { _TotalPages = value; }
|
||||
}
|
||||
private static DebugPrint _MyDebugPrint = new DebugPrint();
|
||||
public static void Open(string fileName)
|
||||
{ _MyDebugPrint.Open(fileName); }
|
||||
public static void Close()
|
||||
{
|
||||
WriteLine("{0} Total Pages", TotalPages);
|
||||
_MyDebugPrint.Close();
|
||||
}
|
||||
public static void Write(string format, params object[] args) => _MyDebugPrint.Write(format, args);
|
||||
public static void WriteLine(string format, params object[] args) => _MyDebugPrint.WriteLine(format, args);
|
||||
public static void Show() => _MyDebugPrint.Show();
|
||||
public static bool IsOpen => _MyDebugPrint.IsOpen;
|
||||
}
|
||||
public static void Write(string format, params object[] args)
|
||||
{ _MyDebugPrint.Write(format, args); }
|
||||
public static void WriteLine(string format, params object[] args)
|
||||
{ _MyDebugPrint.WriteLine(format, args); }
|
||||
public static void Show()
|
||||
{ _MyDebugPrint.Show(); }
|
||||
public static bool IsOpen
|
||||
{ get { return _MyDebugPrint.IsOpen; } }
|
||||
}
|
||||
public static class DebugText
|
||||
{
|
||||
private static readonly DebugPrint _MyDebugPrint = new DebugPrint();
|
||||
public static void Open(string fileName) => _MyDebugPrint.Open(fileName);
|
||||
public static void Close() => _MyDebugPrint.Close();
|
||||
public static void Write(string format, params object[] args) => _MyDebugPrint.Write(format, args);
|
||||
public static void WriteLine(string format, params object[] args) => _MyDebugPrint.WriteLine(format, args);
|
||||
public static void Show() => _MyDebugPrint.Show();
|
||||
public static bool IsOpen => _MyDebugPrint.IsOpen;
|
||||
}
|
||||
private static DebugPrint _MyDebugPrint = new DebugPrint();
|
||||
public static void Open(string fileName)
|
||||
{ _MyDebugPrint.Open(fileName); }
|
||||
public static void Close()
|
||||
{ _MyDebugPrint.Close(); }
|
||||
public static void Write(string format, params object[] args)
|
||||
{ _MyDebugPrint.Write(format, args); }
|
||||
public static void WriteLine(string format, params object[] args)
|
||||
{ _MyDebugPrint.WriteLine(format, args); }
|
||||
public static void Show()
|
||||
{ _MyDebugPrint.Show(); }
|
||||
public static bool IsOpen
|
||||
{ get { return _MyDebugPrint.IsOpen; } }
|
||||
}
|
||||
public static class DebugProfile
|
||||
{
|
||||
private static DebugPrint _MyDebugPrint = new DebugPrint();
|
||||
public static void Open(string fileName) => _MyDebugPrint.Open(fileName);
|
||||
public static void Close()
|
||||
public static void Open(string fileName)
|
||||
{ _MyDebugPrint.Open(fileName); }
|
||||
public static void Close()
|
||||
{ _MyDebugPrint.Close(); _MyDebugPrint = null; }
|
||||
public static void Write(string format, params object[] args) => _MyDebugPrint.Write(format, args);
|
||||
public static void WriteLine(string format, params object[] args) => _MyDebugPrint.WriteLine(format, args);
|
||||
public static void Show() => _MyDebugPrint.Show();
|
||||
public static bool IsOpen => _MyDebugPrint.IsOpen;
|
||||
}
|
||||
public static void Write(string format, params object[] args)
|
||||
{ _MyDebugPrint.Write(format, args); }
|
||||
public static void WriteLine(string format, params object[] args)
|
||||
{ _MyDebugPrint.WriteLine(format, args); }
|
||||
public static void Show()
|
||||
{ _MyDebugPrint.Show(); }
|
||||
public static bool IsOpen
|
||||
{ get { return _MyDebugPrint.IsOpen; } }
|
||||
}
|
||||
public static class DebugDBTrack
|
||||
{
|
||||
private static DebugPrint _MyDebugPrint = new DebugPrint();
|
||||
public static void Open(string fileName) => _MyDebugPrint.Open(fileName);
|
||||
public static void Close()
|
||||
public static void Open(string fileName)
|
||||
{ _MyDebugPrint.Open(fileName); }
|
||||
public static void Close()
|
||||
{ _MyDebugPrint.Close(); _MyDebugPrint = null; }
|
||||
public static void Write(string format, params object[] args) => _MyDebugPrint.Write(format, args);
|
||||
public static void WriteLine(string format, params object[] args) => _MyDebugPrint.WriteLine(format, args);
|
||||
public static void Show() => _MyDebugPrint.Show();
|
||||
public static bool IsOpen => _MyDebugPrint.IsOpen;
|
||||
}
|
||||
public static void Write(string format, params object[] args)
|
||||
{ _MyDebugPrint.Write(format, args); }
|
||||
public static void WriteLine(string format, params object[] args)
|
||||
{ _MyDebugPrint.WriteLine(format, args); }
|
||||
public static void Show()
|
||||
{ _MyDebugPrint.Show(); }
|
||||
public static bool IsOpen
|
||||
{ get { return _MyDebugPrint.IsOpen; } }
|
||||
}
|
||||
// C2018-004 create meta file for baseline compares
|
||||
public static class BaselineMetaFile
|
||||
{
|
||||
private static readonly DebugPrint _MyDebugPrint = new DebugPrint();
|
||||
public static void Open(string fileName) => _MyDebugPrint.Open(fileName);
|
||||
public static void Close() => _MyDebugPrint.Close();
|
||||
public static void Write(string format, params object[] args) => _MyDebugPrint.Write(format, args);
|
||||
public static void WriteLine(string format, params object[] args) => _MyDebugPrint.WriteLine(format, args);
|
||||
public static void Show() => _MyDebugPrint.Show();
|
||||
public static bool IsOpen => _MyDebugPrint.IsOpen;
|
||||
|
||||
public static bool IncludeWordSecText { get; set; } = true;
|
||||
}
|
||||
private static DebugPrint _MyDebugPrint = new DebugPrint();
|
||||
public static void Open(string fileName)
|
||||
{ _MyDebugPrint.Open(fileName); }
|
||||
public static void Close()
|
||||
{ _MyDebugPrint.Close(); }
|
||||
public static void Write(string format, params object[] args)
|
||||
{ _MyDebugPrint.Write(format, args); }
|
||||
public static void WriteLine(string format, params object[] args)
|
||||
{ _MyDebugPrint.WriteLine(format, args); }
|
||||
public static void Show()
|
||||
{ _MyDebugPrint.Show(); }
|
||||
public static bool IsOpen
|
||||
{ get { return _MyDebugPrint.IsOpen; } }
|
||||
private static bool _IncludeWordSecText = true;
|
||||
public static bool IncludeWordSecText
|
||||
{
|
||||
get { return BaselineMetaFile._IncludeWordSecText; }
|
||||
set { BaselineMetaFile._IncludeWordSecText = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
@@ -8,17 +10,21 @@ namespace Volian.Base.Library
|
||||
{
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
public static string GetROEditorPath() => $@"{PROMSExecutableFolderPath()}\ROEDITOR.EXE";
|
||||
#endregion
|
||||
public static string GetROEditorPath()
|
||||
{
|
||||
string roapp = PROMSExecutableFolderPath() + @"\ROEDITOR.EXE";
|
||||
return roapp;
|
||||
}
|
||||
|
||||
// returns the path to the executable folder
|
||||
public static string PROMSExecutableFolderPath()
|
||||
// returns the path to the executable folder
|
||||
public static string PROMSExecutableFolderPath()
|
||||
{
|
||||
string pathPROMSexe = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
|
||||
if (pathPROMSexe[7] == ':') // either a local drive or a mapped network drive
|
||||
pathPROMSexe = pathPROMSexe.Substring(6);
|
||||
else
|
||||
pathPROMSexe = $@"\{pathPROMSexe.Substring(5)}"; // non-mapped network drive - need to add extra back slash in front
|
||||
pathPROMSexe = @"\" + pathPROMSexe.Substring(5); // non-mapped network drive - need to add extra back slash in front
|
||||
return pathPROMSexe;
|
||||
}
|
||||
|
||||
@@ -28,7 +34,7 @@ namespace Volian.Base.Library
|
||||
try
|
||||
{
|
||||
// Build the path to the PROMSFixes.sql file located in the PROMS exe folder
|
||||
string pathPROMSFixes = $@"{PROMSExecutableFolderPath()}\PROMSFixes.sql";
|
||||
string pathPROMSFixes = PROMSExecutableFolderPath() + @"\PROMSFixes.sql";
|
||||
|
||||
// open the PROMSFixes.sql file and grab the line of text containing the PROMSFixes RevDate
|
||||
// using Linq to open and read the PROMSFixes file
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing.Design;
|
||||
using System.Windows.Forms.Design;
|
||||
@@ -10,6 +13,7 @@ namespace Volian.Base.Library
|
||||
|
||||
public class FlagCheckedListBox : CheckedListBox
|
||||
{
|
||||
private System.ComponentModel.Container components = null;
|
||||
|
||||
public FlagCheckedListBox()
|
||||
{
|
||||
@@ -17,6 +21,16 @@ namespace Volian.Base.Library
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
if (components != null)
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
private void InitializeComponent()
|
||||
{
|
||||
@@ -110,7 +124,7 @@ namespace Volian.Base.Library
|
||||
|
||||
// If the item has been unchecked, remove its bits from the sum
|
||||
if (cs == CheckState.Unchecked)
|
||||
sum &= (~composite.value);
|
||||
sum = sum & (~composite.value);
|
||||
// If the item has been checked, combine its bits with the sum
|
||||
else
|
||||
sum |= composite.value;
|
||||
@@ -193,15 +207,27 @@ namespace Volian.Base.Library
|
||||
caption = c;
|
||||
}
|
||||
|
||||
public override string ToString() => caption;
|
||||
public override string ToString()
|
||||
{
|
||||
return caption;
|
||||
}
|
||||
|
||||
// Returns true if the value corresponds to a single bit being set
|
||||
public bool IsFlag => (value & (value - 1)) == 0;
|
||||
// Returns true if the value corresponds to a single bit being set
|
||||
public bool IsFlag
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((value & (value - 1)) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Returns true if this value is a member of the composite bit value
|
||||
public bool IsMemberFlag(FlagCheckedListBoxItem composite) => IsFlag && ((value & composite.value) == value);
|
||||
// Returns true if this value is a member of the composite bit value
|
||||
public bool IsMemberFlag(FlagCheckedListBoxItem composite)
|
||||
{
|
||||
return (IsFlag && ((value & composite.value) == value));
|
||||
}
|
||||
|
||||
public uint value;
|
||||
public uint value;
|
||||
public string caption;
|
||||
}
|
||||
|
||||
@@ -210,15 +236,13 @@ namespace Volian.Base.Library
|
||||
public class FlagEnumUIEditor : UITypeEditor
|
||||
{
|
||||
// The checklistbox
|
||||
private readonly FlagCheckedListBox flagEnumCB;
|
||||
private FlagCheckedListBox flagEnumCB;
|
||||
|
||||
public FlagEnumUIEditor()
|
||||
{
|
||||
flagEnumCB = new FlagCheckedListBox
|
||||
{
|
||||
BorderStyle = BorderStyle.None
|
||||
};
|
||||
}
|
||||
flagEnumCB = new FlagCheckedListBox();
|
||||
flagEnumCB.BorderStyle = BorderStyle.None;
|
||||
}
|
||||
|
||||
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
|
||||
{
|
||||
@@ -242,9 +266,12 @@ namespace Volian.Base.Library
|
||||
return null;
|
||||
}
|
||||
|
||||
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) => UITypeEditorEditStyle.DropDown;
|
||||
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
|
||||
{
|
||||
return UITypeEditorEditStyle.DropDown;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
using System.Windows.Forms;
|
||||
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 Volian.Base.Library
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user