C2025-043 Admin Tool - Data Check - Tool to identify and report RO's that are not used in any of the PROMS data.

This commit is contained in:
2026-01-09 09:12:00 -05:00
parent 862cf67375
commit ac88add40b
8 changed files with 480 additions and 161 deletions

View File

@@ -1778,7 +1778,44 @@ namespace VEPROMS
return true;
}
}
//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();
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)
{
//Initial messaging
string statmsg = "Generating Snapshot (this may take a few minutes to complete)...";
InitialProgressBarMessage = statmsg;
txtResults.AppendText(statmsg);
txtResults.AppendText(Environment.NewLine);
//Generate the data for ROs Not Used and save it to a TreeView
TreeView tv = TreeViewExtensions.GetROTree(GeneralReports.GetROsNotUsedInPROMS(), true);
//Output the TreeView as an Image
if (tv.Nodes.Count != 0)
tv.SaveTreeViewAsImage(sfd.FileName);
//Give Messaging demonstrating finished and open file if requested
statmsg = "Finished Generating Snapshot of ROs Not Used.";
FinalProgressBarMessage = statmsg;
txtResults.AppendText(statmsg);
txtResults.AppendText(Environment.NewLine);
if (tv.Nodes.Count != 0 && MessageBox.Show($"{statmsg}\r\n\r\nDo you wish to open the snapshot now?", "ROs Not Used", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
System.Diagnostics.Process.Start(sfd.FileName);
else if (tv.Nodes.Count == 0)
MessageBox.Show("All ROs are currently in use.", "ROs Not Used", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
}
}