VEPROMS_UI / remove BouncyCastle

This commit is contained in:
2026-08-21 06:11:06 -04:00
parent 23a296df86
commit 0c3e4bb3e9
41 changed files with 2298 additions and 4704 deletions
@@ -1,10 +1,7 @@
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;
@@ -15,13 +12,8 @@ namespace VEPROMS
{
public partial class frmRODbProperties : Form
{
private ProgressBarItem _ProgressBar = null;
public ProgressBarItem ProgressBar
{
get { return _ProgressBar; }
set { _ProgressBar = value; }
}
private void DoProgressBarRefresh(int value, int max, string text)
public ProgressBarItem ProgressBar { get; set; } = null;
private void DoProgressBarRefresh(int value, int max, string text)
{
if (ProgressBar == null) return;
ProgressBar.Value = value;
@@ -29,54 +21,30 @@ 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 RODbInfo _roDbInfo;
private string _origROName;
private string _origFolderPath;
private string _origSQLConnect = null;
private DocVersion _docVersion;
private readonly RODbInfo _roDbInfo;
private readonly string _origROName;
private readonly string _origFolderPath;
private readonly string _origSQLConnect = null;
private readonly DocVersion _docVersion;
public frmRODbProperties(DocVersion docVersion, RODbInfo roDbInfo)
{
_roDbInfo = roDbInfo;
_docVersion = docVersion;
InitializeComponent();
_origROName = (_roDbInfo == null) ? null : _roDbInfo.ROName;
_origFolderPath = (_roDbInfo == null) ? null : _roDbInfo.FolderPath;
_origROName = _roDbInfo?.ROName;
_origFolderPath = _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 = CanMigrateRoAccessToSql(roDbInfo);
ppTxtSQL.Visible = ppTxtSQL.Enabled = CanMigrateRoAccessToSql(roDbInfo);
ppLblSQL.Visible = CanMigrateRoAccessToSql(roDbInfo);
ppBtnTestSQL.Visible = ppBtnTestSQL.Enabled = ppTxtSQL.Visible = ppTxtSQL.Enabled = ppLblSQL.Visible = CanMigrateRoAccessToSql();
ppBtnOk.Enabled = false;
}
private bool CanMigrateRoAccessToSql(RODbInfo rODbi)
private bool CanMigrateRoAccessToSql()
{
// 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
@@ -92,10 +60,12 @@ namespace VEPROMS
}
private void ppBtnFldrDlg_Click(object sender, EventArgs e)
{
FolderBrowserDialog dlgROFolder = new FolderBrowserDialog();
// Initialize the starting location in the Browser window
dlgROFolder.SelectedPath = ppTxtPath.Text;
if (dlgROFolder.ShowDialog() == DialogResult.OK)
FolderBrowserDialog dlgROFolder = new FolderBrowserDialog
{
// Initialize the starting location in the Browser window
SelectedPath = ppTxtPath.Text
};
if (dlgROFolder.ShowDialog() == DialogResult.OK)
{
ppTxtPath.Text = dlgROFolder.SelectedPath;
}
@@ -141,7 +111,7 @@ namespace VEPROMS
catch (SqlException) { }
}
}
catch (Exception ex) {}
catch (Exception) { }
if (canconnect)
roDb.DBConnectionString = (ppTxtSQL.Text == null || ppTxtSQL.Text == "") ? "cstring" : ppTxtSQL.Text;
else
@@ -228,7 +198,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";
@@ -242,8 +212,8 @@ namespace VEPROMS
private void frmRODbProperties_Load(object sender, EventArgs e)
{
Location = ParentLocation;
ppRTxtName.Text = (_roDbInfo == null) ? null : _roDbInfo.ROName;
ppTxtPath.Text = (_roDbInfo == null) ? null : _roDbInfo.FolderPath;
ppRTxtName.Text = _roDbInfo?.ROName;
ppTxtPath.Text = _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
@@ -251,15 +221,17 @@ 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 == null) ? null : cfg.GetDefaultGraphicExtensionLocation();
ppLblGraphicFileExtLoc.Text = cfg?.GetDefaultGraphicExtensionLocation();
ppBtnOk.Enabled = false;
if (_roDbInfo == null)
{
string newFolderPath = null;
FolderBrowserDialog dlgROFolder = new FolderBrowserDialog();
dlgROFolder.RootFolder = Environment.SpecialFolder.MyComputer;
dlgROFolder.SelectedPath = ppTxtPath.Text;
if (dlgROFolder.ShowDialog() == DialogResult.OK)
FolderBrowserDialog dlgROFolder = new FolderBrowserDialog
{
RootFolder = Environment.SpecialFolder.MyComputer,
SelectedPath = ppTxtPath.Text
};
if (dlgROFolder.ShowDialog() == DialogResult.OK)
{
newFolderPath = dlgROFolder.SelectedPath;
RODbInfoList allRODBs = RODbInfoList.Get();
@@ -275,8 +247,6 @@ 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)
@@ -313,7 +283,7 @@ namespace VEPROMS
}
catch (Exception ex)
{
MessageBox.Show("Connection failed: " + ex);
MessageBox.Show($"Connection failed: {ex}");
}
}