Compare commits

..

10 Commits

Author SHA1 Message Date
0da2d38bd8 C2025-009 Added a report for tracking when a user is added into PROMS / when a user is added to specific PROMS security groups. Report can be run from the V-button->General Tools->Reports. 2025-09-08 14:38:36 -04:00
3a6ce52ead Merge pull request 'C2025-022-PROMS-FIXES_CHECKIN' (#609) from C2025-022-PROMS-FIXES_CHECKIN into Development
good for testing
2025-09-04 17:03:41 -04:00
eb0582ae69 C2025-022-PROMS-FIXES_CHECKIN 2025-09-04 16:59:48 -04:00
3143d094e8 C2025-022-PROMS-FIXES_CHECKIN 2025-09-04 16:28:23 -04:00
f265a23f97 C2025-022-PROMS-FIXES_CHECKIN 2025-09-04 16:22:29 -04:00
dceeb410c6 Merge pull request 'C2024-036 Add Filtering ability to the main PROMS procedure tree.' (#608) from C2024-036 into Development
good for testing phase
2025-09-04 15:52:57 -04:00
30be08fe4d C2024-036 Add Filtering ability to the main PROMS procedure tree.
Typing a procedure number or title into the search box and pressing enter/clicking the tree view search button will down base the PROMS procedure tree to matching procedures/folders.
2025-09-04 15:48:29 -04:00
20247d0bc2 Merge pull request 'C2025-017 Added an option to print (generate) all of the current Approved versions of PDFs and place them in a user specified folder' (#607) from C2025-017_PrintAllApproved into Development
Looks good. Ready for QA.
2025-09-04 15:44:01 -04:00
c0ac325911 C2025-017 Added an option to print (generate) all of the current Approved versions of PDFs and place them in a user specified folder 2025-09-04 14:38:26 -04:00
c02ab116cd Merge pull request 'C2025-022-Remove-UCF-2' (#606) from C2025-022-Remove-UCF-2 into Development
Good for QA Testing
2025-09-04 06:55:25 -04:00
13 changed files with 1067 additions and 65 deletions

View File

@@ -24231,6 +24231,39 @@ GO
==========================================================================================================
*/
-- C2025-009 Report for tracking PROMS Users / Security
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[getUserAcessControl]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [getUserAcessControl];
GO
/****** Object: StoredProcedure [dbo].[getUserAcessControl] Script Date: 9/5/2025 6:51:42 AM ******/
-- =============================================
-- Author: Matthew Schill
-- Create date: 09/05/2025
-- Description: Get Data on When Users were added to PROMS and when they were added to Security Groups
-- =============================================
CREATE PROCEDURE [dbo].[getUserAcessControl]
AS
BEGIN
SELECT Users.UserID,
WhenUserAddedToPROMS = Users.[DTS],
GroupName = Groups.GroupName,
WhenUserAddedToGroup = Memberships.[DTS],
WhoAddedUserToGroup = CASE WHEN
Memberships.UsrID = Users.UsrID
AND Users.UsrID = Users.UserID
THEN 'INITIAL_SETUP'
ELSE Memberships.UsrID END,
DateUserRemovedFromGroup = Memberships.EndDate
FROM Memberships
inner join Groups on Memberships.GID = Groups.GID
right outer join Users on Users.UID = Memberships.UID
order by UserID, Memberships.[DTS]
RETURN
END
/*
---------------------------------------------------------------------------
| ADD New Code Before this Block |
@@ -24264,8 +24297,8 @@ BEGIN TRY -- Try Block
DECLARE @RevDate varchar(255)
DECLARE @RevDescription varchar(255)
set @RevDate = '08/18/2025 2:07 PM'
set @RevDescription = 'Updated Index maintenance that occurs after RO FST Load to improve RO Performance'
set @RevDate = '09/05/2025 7:00 AM'
set @RevDescription = 'Added stored procedure for User Access Control Report'
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription

View File

@@ -121,6 +121,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\3rdPartyLibraries\Log4Net\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Data">
@@ -224,6 +228,12 @@
<Compile Include="dlgPickROFolder.designer.cs">
<DependentUpon>dlgPickROFolder.cs</DependentUpon>
</Compile>
<Compile Include="dlgPrintAllApprovedProcedures.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="dlgPrintAllApprovedProcedures.Designer.cs">
<DependentUpon>dlgPrintAllApprovedProcedures.cs</DependentUpon>
</Compile>
<Compile Include="DlgPrintProcedure.cs">
<SubType>Form</SubType>
</Compile>
@@ -359,6 +369,9 @@
<EmbeddedResource Include="dlgImpHowToHandleROs.resx">
<DependentUpon>dlgImpHowToHandleROs.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="dlgPrintAllApprovedProcedures.resx">
<DependentUpon>dlgPrintAllApprovedProcedures.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="DlgPrintProcedure.resx">
<DependentUpon>DlgPrintProcedure.cs</DependentUpon>
<SubType>Designer</SubType>

View File

@@ -0,0 +1,136 @@

namespace VEPROMS
{
partial class dlgPrintAllApprovedProcedures
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(dlgPrintAllApprovedProcedures));
this.txbApprovedPDFsPath = new DevComponents.DotNetBar.Controls.TextBoxX();
this.labelX1 = new DevComponents.DotNetBar.LabelX();
this.ppBtnPDFLoc = new DevComponents.DotNetBar.ButtonX();
this.ApprovedPDFsFolderDlg = new System.Windows.Forms.FolderBrowserDialog();
this.btnPrntAllAprv = new DevComponents.DotNetBar.ButtonX();
this.btnCancel = new DevComponents.DotNetBar.ButtonX();
this.SuspendLayout();
//
// txbApprovedPDFsPath
//
//
//
//
this.txbApprovedPDFsPath.Border.Class = "TextBoxBorder";
this.txbApprovedPDFsPath.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.txbApprovedPDFsPath.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txbApprovedPDFsPath.Location = new System.Drawing.Point(11, 45);
this.txbApprovedPDFsPath.Name = "txbApprovedPDFsPath";
this.txbApprovedPDFsPath.PreventEnterBeep = true;
this.txbApprovedPDFsPath.Size = new System.Drawing.Size(611, 22);
this.txbApprovedPDFsPath.TabIndex = 0;
this.txbApprovedPDFsPath.WatermarkText = "Enter to Path of where to Place All Approved PDFs";
this.txbApprovedPDFsPath.TextChanged += new System.EventHandler(this.txbApprovedPDFsPath_TextChanged);
//
// labelX1
//
//
//
//
this.labelX1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square;
this.labelX1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.labelX1.Location = new System.Drawing.Point(12, 22);
this.labelX1.Name = "labelX1";
this.labelX1.Size = new System.Drawing.Size(360, 23);
this.labelX1.TabIndex = 1;
this.labelX1.Text = "Approved PDFs Location:";
//
// ppBtnPDFLoc
//
this.ppBtnPDFLoc.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.ppBtnPDFLoc.Image = ((System.Drawing.Image)(resources.GetObject("ppBtnPDFLoc.Image")));
this.ppBtnPDFLoc.Location = new System.Drawing.Point(627, 45);
this.ppBtnPDFLoc.Margin = new System.Windows.Forms.Padding(2);
this.ppBtnPDFLoc.Name = "ppBtnPDFLoc";
this.ppBtnPDFLoc.Size = new System.Drawing.Size(37, 22);
this.ppBtnPDFLoc.TabIndex = 32;
this.ppBtnPDFLoc.Click += new System.EventHandler(this.ppBtnPDFLoc_Click);
//
// btnPrntAllAprv
//
this.btnPrntAllAprv.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnPrntAllAprv.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnPrntAllAprv.Enabled = false;
this.btnPrntAllAprv.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnPrntAllAprv.Location = new System.Drawing.Point(397, 120);
this.btnPrntAllAprv.Name = "btnPrntAllAprv";
this.btnPrntAllAprv.Size = new System.Drawing.Size(132, 26);
this.btnPrntAllAprv.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnPrntAllAprv.TabIndex = 33;
this.btnPrntAllAprv.Text = "Print All Approved";
this.btnPrntAllAprv.Click += new System.EventHandler(this.btnPrntAllAprv_Click);
//
// btnCancel
//
this.btnCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnCancel.Location = new System.Drawing.Point(564, 120);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(99, 26);
this.btnCancel.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnCancel.TabIndex = 34;
this.btnCancel.Text = "Close";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// dlgPrintAllApprovedProcedures
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(675, 161);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnPrntAllAprv);
this.Controls.Add(this.ppBtnPDFLoc);
this.Controls.Add(this.labelX1);
this.Controls.Add(this.txbApprovedPDFsPath);
this.Cursor = System.Windows.Forms.Cursors.Default;
this.DoubleBuffered = true;
this.Name = "dlgPrintAllApprovedProcedures";
this.ShowIcon = false;
this.Text = "Print All Approved Procedures";
this.ResumeLayout(false);
}
#endregion
private DevComponents.DotNetBar.Controls.TextBoxX txbApprovedPDFsPath;
private DevComponents.DotNetBar.LabelX labelX1;
private DevComponents.DotNetBar.ButtonX ppBtnPDFLoc;
private System.Windows.Forms.FolderBrowserDialog ApprovedPDFsFolderDlg;
private DevComponents.DotNetBar.ButtonX btnPrntAllAprv;
private DevComponents.DotNetBar.ButtonX btnCancel;
}
}

View File

@@ -0,0 +1,202 @@
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;
namespace VEPROMS
{
public partial class dlgPrintAllApprovedProcedures : DevComponents.DotNetBar.Office2007Form
{
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private StringBuilder NotApproved;
private DocVersionInfo _DocVersionInfo = null;
private int unitId = 0;
public dlgPrintAllApprovedProcedures(DocVersionInfo dvi)
{
InitializeComponent();
_DocVersionInfo = dvi;
unitId = (_DocVersionInfo.DocVersionConfig.SelectedSlave < 0) ? 0 : _DocVersionInfo.DocVersionConfig.SelectedSlave; // set unitId to zero if not Parent/Child
NotApproved = new StringBuilder();
txbApprovedPDFsPath.Text = BuildInitialPDFPath(); // set to default approved PDF path
}
// create an approved PDFs path based on the user's Documents folder and the tree path to the working draft
private string BuildInitialPDFPath()
{
// start with the SearchDVPath which is the node path staring with the top of the PROMS Procedure tree (VEPROMS)
string rtnstr = _DocVersionInfo.ActiveParent.SearchDVPath;
// remove top tree node (VEPROMS) and put a " - " between each tree node name
rtnstr = rtnstr.Substring(rtnstr.IndexOf("\a") + 1).Replace("\a", " - ");
// add the user's path to the My Documments folder to the start of the path
rtnstr = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\" + rtnstr;
// check if we are printing Approved Child Procedures
// 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
return rtnstr;
}
private void ppBtnPDFLoc_Click(object sender, EventArgs e)
{
if (txbApprovedPDFsPath.Text.Length > 0)
ApprovedPDFsFolderDlg.SelectedPath = txbApprovedPDFsPath.Text;
DialogResult dr = ApprovedPDFsFolderDlg.ShowDialog();
if (dr == DialogResult.OK)
{
txbApprovedPDFsPath.Text = ApprovedPDFsFolderDlg.SelectedPath;
}
}
private bool FolderIsWritable(string dirPath)
{
try
{
using (FileStream fs = File.Create(Path.Combine(dirPath, Path.GetRandomFileName()), 1, FileOptions.DeleteOnClose))
{ }
return true;
}
catch
{
return false;
}
}
private void btnPrntAllAprv_Click(object sender, EventArgs e)
{
try
{
// Create folder if needed, clear the folder
if (!Directory.Exists(txbApprovedPDFsPath.Text))
Directory.CreateDirectory(txbApprovedPDFsPath.Text);
// check if the folder location is writable
if (!FolderIsWritable(txbApprovedPDFsPath.Text))
{
MessageBox.Show("Cannot Write to this folder.\n\nSelect a different location.", "Invalid Folder Access", MessageBoxButtons.OK, MessageBoxIcon.Error);
btnPrntAllAprv.Enabled = false;
}
else
{
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)
{
RevisionInfoList ril = RevisionInfoList.GetByItemID(myProc.ItemID);
if (ril.Count == 0)
{
NotApproved.AppendLine(string.Format("No approved Version for {0}", (myProc.PDFNumber.Length > 0) ? myProc.PDFNumber : myProc.DisplayText));
}
else
{
bool foundApproved = false;
foreach (RevisionInfo revinfo in ril)
{
// if not Parent/Child, "unitId" and "Applicability_index" will be zero
if (unitId == revinfo.MyConfig.Applicability_Index)
{
if (revinfo.LatestVersion.MyStage.IsApproved > 0)
{
foundApproved = true;
ItemInfo ii = ItemInfo.Get(revinfo.ItemID);
ii.MyDocVersion.DocVersionConfig.SelectedSlave = unitId;
ProcedureInfo prcInfo = ProcedureInfo.Get(ii.ItemID);
SaveApprovedPDFToFolder(revinfo, prcInfo.PDFNumber);// save PDF to folder
pdfCount++;
break; // got the latest Approved - jump out of foreach revision info loop
}
}
}
if (!foundApproved) NotApproved.AppendLine(string.Format("No approved Version for {0}", myProc.PDFNumber));
}
}
// if no Approved PDFs were save, display general message and exit
if (pdfCount == 0)
{
string msg = "There are no Approved Procedure PDFs in this procedure set.\n\n Approved Procedures PDFs are created when a procedure is approved using the PROMS Approval function.";
FlexibleMessageBox.Show(msg, "Print PDFs Completed", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
else // we saved some approved PDFs tell user how many were saved and list procedures that were not approved
{
string msg = string.Format("{0} PDFs were saved at\n\n{1}", pdfCount, txbApprovedPDFsPath.Text);
if (NotApproved.Length > 0)
{
msg += string.Format("\n\n--------------------------------------------\n\nPDFs for the Following were not Generated:\n\n{0}", NotApproved.ToString());
}
FlexibleMessageBox.Show(msg, "Print PDFs Completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
catch (Exception ex)
{
_MyLog.Error("Print All Approved PDFs", ex);// save error in PROMS error log
MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
this.Close(); // close dialog
}
private void SaveApprovedPDFToFolder(RevisionInfo revInfo,string PDFName)
{
byte[] buffer = revInfo.LatestVersion.PDF;
string PDFFilePath = string.Format("{0}\\{1}.PDF", txbApprovedPDFsPath.Text, PDFName);
try
{
FileStream fs = new FileStream(PDFFilePath, FileMode.Create);
fs.Write(buffer, 0, buffer.Length);
fs.Close();
}
catch (Exception ex)
{
string str = string.Format("Could not create {0}", PDFFilePath);
NotApproved.AppendLine(str); // save to list of procedure that were not approved
_MyLog.Info(str, ex);// save error in PROMS error log
}
}
private void DeleteExistingPDFs()
{
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");
foreach (FileInfo fi in fis)
{
if (fi.IsReadOnly) fi.IsReadOnly = false;
fi.Delete();
}
}
catch (Exception ex)
{
string str = string.Format("Cannot delete files in {0}", txbApprovedPDFsPath.Text);
MessageBox.Show(str, "Error deleting files", MessageBoxButtons.OK, MessageBoxIcon.Error);
_MyLog.Info(str, ex); // save error in PROMS error log
}
}
private void txbApprovedPDFsPath_TextChanged(object sender, EventArgs e)
{
btnPrntAllAprv.Enabled = txbApprovedPDFsPath.Text.Length > 0;
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

View File

@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="ppBtnPDFLoc.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6
JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAr2AAAK9gHCr3ADAAACc0lE
QVQ4T6WSWUjUURSH/w899GSRGoVgZIlYIAaGVA8hSouaUm6FkiaUWyWGYq7NuM7oLI46pWLOqNOoo5Wl
GFYIhSIRWi6UmJoFhaWYGiq5feFIg9tL9fDBvYf7+ziccwVA+B82FDYjs1DnKlbpuSktJ1ttIEmmTf4r
QUisGp8IedDy+VpCmWWaSk9chsYvOLYQoU6nDKjTKVlPU41Evl70h8ikojO+UXK8I/KMAvq7tcxO1Br5
Na5nflSDoVxOvS4jbX14GZ9IBd7hKjzDChBqKxTMjFetCS+OFDHfG0NVmZTK4iw0hWmU5KVyR5ZIgSSe
1TKhWpvLzHetKbw0UgT9idAbtikbBPdKJfz8WmIKN9flGnliyKFBL+FhZRYGTTr6EjHl6lvcVSVTrEhE
nZtglAmVJVlMfco3tj3UKqK+SsHikBiGM9byUQyDSdAXC++i6KrxJzrUq0LQqNOZHJDCZxmPquW0P5Wt
PFrd+ttg6PBloc2D2WcufKhw4OrFk5PRoV4HhVKViB/vxQy3pVCvl7E0KIKe8JVgVyh0nGeh3YvZlhNM
NR1jrO4Q4ghbLrhZ5BlnUKRIYaw7gfu6XDpfSqEvBnouQ2cQS6/OMvfiNNPNxxmvd+JbtT0dmdsJ9LDB
yc7MzihQ5yTS05LKA10ODKTCm2B47cdcqyfTz12YaHBm1ODAF+1+emXmiML24XjAqtG0hfzseGrLpfQ+
jqRDKZhol22hRbKVxrRt1CRboom34vaNPQS6711ydrR2NwmUGXEoRVfITggh6XrA8mS55O/GuVNHcD3q
wGEHW+xtrLDebcHOHWbsMjdb+w9WX/6F370P0Tty1Sp4AAAAAElFTkSuQmCC
</value>
</data>
<metadata name="ApprovedPDFsFolderDlg.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -9,6 +9,8 @@ using Volian.Controls.Library;
using DevComponents.DotNetBar;
using JR.Utils.GUI.Forms;
using System.Linq;
using System.Data;
using xls = Microsoft.Office.Interop.Excel;
namespace VEPROMS
{
@@ -275,6 +277,13 @@ namespace VEPROMS
setupProgessSteps1();
}
//C2025-009 Report for tracking PROMS Users / security
private void sideNavItmReports_Click(object sender, EventArgs e)
{
GenToolType = E_GenToolType.Reports;
setupProgessSteps1();
}
// C2017-030 new Tools user interface
private void sideNavItmExit_Click(object sender, EventArgs e)
{
@@ -287,7 +296,8 @@ namespace VEPROMS
private enum E_GenToolType : int
{
Check = 0,
Users = 3
Users = 3,
Reports = 5
};
private E_GenToolType GenToolType = 0;
@@ -314,8 +324,8 @@ namespace VEPROMS
progressSteps1.Visible = true;
progressSteps1.Refresh();
break;
case E_GenToolType.Users:
case E_GenToolType.Reports:
splitContainer3.Panel2Collapsed = true;
progressSteps1.Visible = false;
break;
@@ -416,6 +426,132 @@ namespace VEPROMS
ClearStepProgress();
}
//C2025-009 Report for tracking PROMS Users / security
//UACfilename will hold the filename for cases when scheduled for later
private string UACfilename;
//C2025-009 Report for tracking PROMS Users / security
private void btnUAC_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(UACfilename))
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "Excel XLS (*.xlsx)|*.xlsx";
sfd.FileName = "UACReport.xlsx";
if (sfd.ShowDialog() == DialogResult.OK)
{
UACfilename = sfd.FileName;
}
}
if (!CheckProcessLater()) return; // delay processing if set//B2017-221 Allow the batch dialog to close when waiting to process.
txtProcess.Clear();
txtResults.Clear();
if (!string.IsNullOrEmpty(UACfilename))
{
Generate_UAC_Report(UACfilename);
}
UACfilename = null;
}
//C2025-009 Report for tracking PROMS Users / security
//Get Datatable of results then loop through outputting into excel
private void Generate_UAC_Report(string filename)
{
this.Cursor = Cursors.WaitCursor;
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Generate User Access Control Report in PROMS");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
txtResults.Clear();
txtResults.AppendText("Generating User Access Control Report");
using (DataTable dt = UserReports.GetUserAccessControlData())
{
// Start Excel and get Application object.
xls.Application excel = new xls.Application
{
// Make Excel invisible and disable alerts.
Visible = false,
DisplayAlerts = false
};
// Create a new Workbook.
xls.Workbook excelworkBook = excel.Workbooks.Add();
// Create a Worksheet.
var workSheet = (xls.Worksheet)excelworkBook.ActiveSheet;
workSheet.Name = "UAC Report";
// column headings
for (var i = 0; i < dt.Columns.Count; i++)
{
workSheet.Cells[1, i + 1] = dt.Columns[i].ColumnName;
}
// rows
for (var i = 0; i < dt.Rows.Count; i++)
{
for (var j = 0; j < dt.Columns.Count; j++)
{
workSheet.Cells[i + 2, j + 1] = dt.Rows[i][j];
}
}
//resize the columns to match the data
workSheet.Columns.AutoFit();
//freeze the top row, and highlight those cells
workSheet.Application.ActiveWindow.SplitRow = 1;
workSheet.Application.ActiveWindow.FreezePanes = true;
workSheet.Cells.Range[workSheet.Cells[1, 1], workSheet.Cells[1, dt.Columns.Count]].Interior.Color = xls.XlRgbColor.rgbLightBlue;
//save the excel file
excelworkBook.SaveAs(filename);
excelworkBook.Close();
excel.Quit();
//release any in use com objects
releaseObject(workSheet);
releaseObject(excelworkBook);
releaseObject(excel);
}
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
Application.DoEvents();
this.Cursor = Cursors.Default;
MessageBox.Show("Generate User Access Control Report Completed", "User Access Control Report");
}
//C2025-009 Report for tracking PROMS Users / security
//for releasing any Excel com objects still in memory
private void releaseObject(object obj)
{
try
{
System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
obj = null;
}
catch (Exception ex)
{
obj = null;
MessageBox.Show("Exception Occurred while releasing object " + ex.ToString());
}
finally
{
GC.Collect();
}
}
//C2025-011 RO Update Tool Memory Enhancements
private void txtProcess_TextChanged(object sender, EventArgs e)
{

View File

@@ -51,6 +51,9 @@
this.expandableSplitter1 = new DevComponents.DotNetBar.ExpandableSplitter();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.sideNav1 = new DevComponents.DotNetBar.Controls.SideNav();
this.sideNavPanel6 = new DevComponents.DotNetBar.Controls.SideNavPanel();
this.sideNavPanel5 = new DevComponents.DotNetBar.Controls.SideNavPanel();
this.btn_ShowUsers = new DevComponents.DotNetBar.ButtonX();
this.sideNavPanel1 = new DevComponents.DotNetBar.Controls.SideNavPanel();
this.warningBox3 = new DevComponents.DotNetBar.Controls.WarningBox();
this.labelX7 = new DevComponents.DotNetBar.LabelX();
@@ -62,12 +65,11 @@
this.swCkOrphanDataRecs = new DevComponents.DotNetBar.Controls.SwitchButton();
this.labelX1 = new DevComponents.DotNetBar.LabelX();
this.btnRunCheck = new DevComponents.DotNetBar.ButtonX();
this.sideNavPanel5 = new DevComponents.DotNetBar.Controls.SideNavPanel();
this.btn_ShowUsers = new DevComponents.DotNetBar.ButtonX();
this.sideNavItem1 = new DevComponents.DotNetBar.Controls.SideNavItem();
this.separator1 = new DevComponents.DotNetBar.Separator();
this.sideNavItmCheck = new DevComponents.DotNetBar.Controls.SideNavItem();
this.sideNavItmUsers = new DevComponents.DotNetBar.Controls.SideNavItem();
this.sideNavItmReports = new DevComponents.DotNetBar.Controls.SideNavItem();
this.sideNavItmExit = new DevComponents.DotNetBar.Controls.SideNavItem();
this.panelEx4 = new DevComponents.DotNetBar.PanelEx();
this.progressSteps1 = new DevComponents.DotNetBar.ProgressSteps();
@@ -78,6 +80,7 @@
this.lblAdmToolProgressType = new DevComponents.DotNetBar.LabelX();
this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem();
this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip();
this.btnUAC = new DevComponents.DotNetBar.ButtonX();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
@@ -89,8 +92,9 @@
this.pnlLater.SuspendLayout();
this.panelEx1.SuspendLayout();
this.sideNav1.SuspendLayout();
this.sideNavPanel1.SuspendLayout();
this.sideNavPanel6.SuspendLayout();
this.sideNavPanel5.SuspendLayout();
this.sideNavPanel1.SuspendLayout();
this.panelEx4.SuspendLayout();
this.SuspendLayout();
//
@@ -416,8 +420,9 @@
// sideNav1
//
this.sideNav1.BackColor = System.Drawing.SystemColors.Control;
this.sideNav1.Controls.Add(this.sideNavPanel1);
this.sideNav1.Controls.Add(this.sideNavPanel6);
this.sideNav1.Controls.Add(this.sideNavPanel5);
this.sideNav1.Controls.Add(this.sideNavPanel1);
this.sideNav1.Dock = System.Windows.Forms.DockStyle.Fill;
this.sideNav1.EnableClose = false;
this.sideNav1.EnableMaximize = false;
@@ -426,6 +431,7 @@
this.separator1,
this.sideNavItmCheck,
this.sideNavItmUsers,
this.sideNavItmReports,
this.sideNavItmExit});
this.sideNav1.Location = new System.Drawing.Point(0, 0);
this.sideNav1.Name = "sideNav1";
@@ -434,6 +440,40 @@
this.sideNav1.TabIndex = 3;
this.sideNav1.Text = "sideNav1";
//
// sideNavPanel6
//
this.sideNavPanel6.Controls.Add(this.btnUAC);
this.sideNavPanel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.sideNavPanel6.Location = new System.Drawing.Point(88, 31);
this.sideNavPanel6.Name = "sideNavPanel6";
this.sideNavPanel6.Size = new System.Drawing.Size(292, 493);
this.sideNavPanel6.TabIndex = 14;
//
// sideNavPanel5
//
this.sideNavPanel5.Controls.Add(this.btn_ShowUsers);
this.sideNavPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.sideNavPanel5.Location = new System.Drawing.Point(88, 31);
this.sideNavPanel5.Name = "sideNavPanel5";
this.sideNavPanel5.Size = new System.Drawing.Size(292, 493);
this.sideNavPanel5.TabIndex = 14;
this.sideNavPanel5.Visible = false;
//
// btn_ShowUsers
//
this.btn_ShowUsers.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btn_ShowUsers.Checked = true;
this.btn_ShowUsers.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btn_ShowUsers.Location = new System.Drawing.Point(57, 37);
this.btn_ShowUsers.Name = "btn_ShowUsers";
this.btn_ShowUsers.Size = new System.Drawing.Size(171, 23);
this.btn_ShowUsers.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.superTooltip1.SetSuperTooltip(this.btn_ShowUsers, new DevComponents.DotNetBar.SuperTooltipInfo("Show Users", "", "This will return all of the users currently with open sessions in the database an" +
"d the details of any items they have checked out.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(200, 80)));
this.btn_ShowUsers.TabIndex = 0;
this.btn_ShowUsers.Text = "Show Users";
this.btn_ShowUsers.Click += new System.EventHandler(this.btn_ShowUsers_Click);
//
// sideNavPanel1
//
this.sideNavPanel1.Controls.Add(this.warningBox3);
@@ -451,6 +491,7 @@
this.sideNavPanel1.Name = "sideNavPanel1";
this.sideNavPanel1.Size = new System.Drawing.Size(292, 493);
this.sideNavPanel1.TabIndex = 2;
this.sideNavPanel1.Visible = false;
//
// warningBox3
//
@@ -600,31 +641,6 @@
this.btnRunCheck.Text = "Run Check";
this.btnRunCheck.Click += new System.EventHandler(this.btnRunCheck_Click);
//
// sideNavPanel5
//
this.sideNavPanel5.Controls.Add(this.btn_ShowUsers);
this.sideNavPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.sideNavPanel5.Location = new System.Drawing.Point(88, 31);
this.sideNavPanel5.Name = "sideNavPanel5";
this.sideNavPanel5.Size = new System.Drawing.Size(292, 493);
this.sideNavPanel5.TabIndex = 14;
this.sideNavPanel5.Visible = false;
//
// btn_ShowUsers
//
this.btn_ShowUsers.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btn_ShowUsers.Checked = true;
this.btn_ShowUsers.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btn_ShowUsers.Location = new System.Drawing.Point(57, 37);
this.btn_ShowUsers.Name = "btn_ShowUsers";
this.btn_ShowUsers.Size = new System.Drawing.Size(171, 23);
this.btn_ShowUsers.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.superTooltip1.SetSuperTooltip(this.btn_ShowUsers, new DevComponents.DotNetBar.SuperTooltipInfo("Show Users", "", "This will return all of the users currently with open sessions in the database an" +
"d the details of any items they have checked out.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(200, 80)));
this.btn_ShowUsers.TabIndex = 0;
this.btn_ShowUsers.Text = "Show Users";
this.btn_ShowUsers.Click += new System.EventHandler(this.btn_ShowUsers_Click);
//
// sideNavItem1
//
this.sideNavItem1.IsSystemMenu = true;
@@ -644,7 +660,6 @@
//
// sideNavItmCheck
//
this.sideNavItmCheck.Checked = true;
this.sideNavItmCheck.Name = "sideNavItmCheck";
this.sideNavItmCheck.Panel = this.sideNavPanel1;
this.sideNavItmCheck.Symbol = "";
@@ -659,6 +674,15 @@
this.sideNavItmUsers.Text = "Users";
this.sideNavItmUsers.Click += new System.EventHandler(this.sideNavItmUsers_Click);
//
// sideNavItmReports
//
this.sideNavItmReports.Checked = true;
this.sideNavItmReports.Name = "sideNavItmReports";
this.sideNavItmReports.Panel = this.sideNavPanel6;
this.sideNavItmReports.Symbol = "";
this.sideNavItmReports.Text = "Reports";
this.sideNavItmReports.Click += new System.EventHandler(this.sideNavItmReports_Click);
//
// sideNavItmExit
//
this.sideNavItmExit.Name = "sideNavItmExit";
@@ -761,6 +785,20 @@
this.superTooltip1.DefaultTooltipSettings = new DevComponents.DotNetBar.SuperTooltipInfo("", "", "", null, null, DevComponents.DotNetBar.eTooltipColor.Gray);
this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F";
//
// btnUAC
//
this.btnUAC.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton;
this.btnUAC.Checked = true;
this.btnUAC.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground;
this.btnUAC.Location = new System.Drawing.Point(35, 30);
this.btnUAC.Name = "btnUAC";
this.btnUAC.Size = new System.Drawing.Size(187, 23);
this.btnUAC.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnUAC.TabIndex = 0;
this.btnUAC.Text = "Run User Access Control Report";
this.superTooltip1.SetSuperTooltip(this.btnUAC, new DevComponents.DotNetBar.SuperTooltipInfo("UAC Report", "", "This will return a report containing info on when users were added to PROMS and when users were added to specific PROMS security groups.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
this.btnUAC.Click += new System.EventHandler(this.btnUAC_Click);
//
// frmGenTools
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -790,8 +828,9 @@
this.panelEx1.ResumeLayout(false);
this.sideNav1.ResumeLayout(false);
this.sideNav1.PerformLayout();
this.sideNavPanel1.ResumeLayout(false);
this.sideNavPanel6.ResumeLayout(false);
this.sideNavPanel5.ResumeLayout(false);
this.sideNavPanel1.ResumeLayout(false);
this.panelEx4.ResumeLayout(false);
this.ResumeLayout(false);
@@ -829,10 +868,12 @@
private DevComponents.DotNetBar.ButtonX btnRunCheck;
private DevComponents.DotNetBar.Controls.SideNavPanel sideNavPanel5;
private DevComponents.DotNetBar.ButtonX btn_ShowUsers;
private DevComponents.DotNetBar.Controls.SideNavPanel sideNavPanel6;
private DevComponents.DotNetBar.Controls.SideNavItem sideNavItem1;
private DevComponents.DotNetBar.Separator separator1;
private DevComponents.DotNetBar.Controls.SideNavItem sideNavItmCheck;
private DevComponents.DotNetBar.Controls.SideNavItem sideNavItmUsers;
private DevComponents.DotNetBar.Controls.SideNavItem sideNavItmReports;
private DevComponents.DotNetBar.Controls.SideNavItem sideNavItmExit;
private DevComponents.DotNetBar.LabelX lblAdmToolProgressType;
private DevComponents.DotNetBar.ProgressSteps progressSteps1;
@@ -847,6 +888,7 @@
private DevComponents.DotNetBar.PanelEx panelEx4;
private DevComponents.DotNetBar.Controls.WarningBox warningBox3;
private DevComponents.DotNetBar.ButtonItem buttonItem1;
private DevComponents.DotNetBar.ButtonX btnUAC;
}
}

View File

@@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="warningBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>

View File

@@ -71,9 +71,12 @@ namespace VEPROMS
this.labelItem10 = new DevComponents.DotNetBar.LabelItem();
this.bottomProgBar = new DevComponents.DotNetBar.ProgressBarItem();
this.labelItem9 = new DevComponents.DotNetBar.LabelItem();
this.lblPreEditView = new DevComponents.DotNetBar.LabelItem();
this.lblEditView = new DevComponents.DotNetBar.LabelItem();
this.labelItem11 = new DevComponents.DotNetBar.LabelItem();
this.btnItemInfo = new DevComponents.DotNetBar.ButtonItem();
this.btnFilter = new DevComponents.DotNetBar.ButtonItem();
this.txtFilter = new DevComponents.DotNetBar.TextBoxItem();
this.lblItemID = new DevComponents.DotNetBar.LabelItem();
this.lblResolution = new DevComponents.DotNetBar.LabelItem();
this.btnEditItem = new DevComponents.DotNetBar.ButtonItem();
@@ -524,9 +527,12 @@ namespace VEPROMS
this.bottomBar.Font = new System.Drawing.Font("Segoe UI", 9F);
this.bottomBar.IsMaximized = false;
this.bottomBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
this.btnFilter,
this.txtFilter,
this.labelItem10,
this.bottomProgBar,
this.labelItem9,
this.lblPreEditView,
this.lblEditView,
this.labelItem11,
this.btnItemInfo,
@@ -546,6 +552,21 @@ namespace VEPROMS
this.bottomBar.TabStop = false;
this.bottomBar.Text = "bar1";
//
// btnFilter
//
this.btnFilter.Name = "btnFilter";
this.btnFilter.Text = "Tree View Search:";
this.btnFilter.Click += SubmitFilter;
//
// txtFilter
//
this.txtFilter.TextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F);
this.txtFilter.Name = "txtFilter";
this.txtFilter.TextBoxWidth = 120;
this.txtFilter.TextBox.TabIndex = 0;
this.txtFilter.TextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.FilterEnterKey);
this.superTooltip1.SetSuperTooltip(this.txtFilter, new DevComponents.DotNetBar.SuperTooltipInfo("Filter", "", "This will filter the Procedure Tree in PROMS to Procedures containing entered words in the Procedure Number or Title. Press enter or the Tree View Search button to submit.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
//
// txtSearch
//
this.txtSearch.Dock = System.Windows.Forms.DockStyle.Right;
@@ -647,6 +668,11 @@ namespace VEPROMS
this.lblEditView.ForeColor = System.Drawing.SystemColors.MenuText;
this.lblEditView.Name = "lblEditView";
this.lblEditView.Text = "Edit";
// lblEditView
//
this.lblPreEditView.BorderSide = DevComponents.DotNetBar.eBorderSide.Left;
this.lblPreEditView.BorderType = DevComponents.DotNetBar.eBorderType.Bump;
this.lblPreEditView.Name = "lblPreEditView";
//
// labelItem11
//
@@ -1744,8 +1770,11 @@ namespace VEPROMS
private DevComponents.DotNetBar.TabItem tabItemLibDocs;
private Volian.Controls.Library.DisplayTags displayTags;
private Volian.Controls.Library.DisplaySearch displaySearch1;
private DevComponents.DotNetBar.LabelItem lblPreEditView;
private DevComponents.DotNetBar.LabelItem lblEditView;
private DevComponents.DotNetBar.ButtonItem btnItemInfo;
private DevComponents.DotNetBar.ButtonItem btnFilter;
private DevComponents.DotNetBar.TextBoxItem txtFilter;
private DevComponents.DotNetBar.ButtonItem btnFixMSWord;
private Volian.Controls.Library.DisplayBookMarks displayBookMarks;
//private DevComponents.DotNetBar.LabelItem lblLocked;

View File

@@ -22,6 +22,9 @@ using Volian.Base.Library;
using Volian.Print.Library;
using JR.Utils.GUI.Forms;
using System.Diagnostics;
using System.Linq;
using System.Collections.Concurrent;
using System.Threading.Tasks;
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
@@ -534,6 +537,7 @@ namespace VEPROMS
tv.QPrintSection += new vlnTreeViewEvent(tv_QPrintSection);
tv.QPrintProcedure += new vlnTreeViewEvent(tv_QPrintProcedure);
tv.PrintAllProcedures += new vlnTreeViewEvent(tv_PrintAllProcedures);
tv.PrintAllApprovedProcedures += new vlnTreeViewEvent(tv_PrintAllApprovedProcedures);
tv.ApproveProcedure += new vlnTreeViewEvent(tv_ApproveProcedure);
tv.ApproveAllProcedures += new vlnTreeViewEvent(tv_ApproveAllProcedures);
tv.ApproveSomeProcedures += new vlnTreeViewEvent(tv_ApproveSomeProcedures);
@@ -1213,6 +1217,26 @@ namespace VEPROMS
dvi.DocVersionConfig.SelectedSlave = 0;
}
// C2025-017 print all approved procedure to a specified folder
void tv_PrintAllApprovedProcedures(object sender, vlnTreeEventArgs args)
{
using (DocVersionInfo dvi = (args.Node as VETreeNode).VEObject as DocVersionInfo)
{
if (dvi == null) return;
tc.SaveCurrentEditItem(); // save the current edit item if user happens to be editing a procedure
// add a diaglog to prompt for the path inwhich to put the approved pdfs
int currentChildSetting = dvi.DocVersionConfig.SelectedSlave;
dvi.DocVersionConfig.SelectedSlave = args.UnitIndex; // set to selected child - will be -1 for non Parent/Child
dlgPrintAllApprovedProcedures dlgPrnAllAprv = new dlgPrintAllApprovedProcedures(dvi);
dlgPrnAllAprv.ShowDialog(this);
dvi.DocVersionConfig.SelectedSlave = currentChildSetting; // set back to what it was
}
}
void tv_PrintProcedure(object sender, vlnTreeEventArgs args)
{
ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo;
@@ -2470,6 +2494,7 @@ namespace VEPROMS
int _ItemID = (int)TabState["ItemID"];
ItemInfo _Procedure = ItemInfo.Get(_ItemID);
// Open procedure in the editor.
if (_Procedure == null) continue; //skip and continue with foreach
OpenItem(_Procedure);
// SelectedStepTabPanel needs to be set so the print buttons on the ribbon will work.
SelectedStepTabPanel = tc.MyEditItem.MyStepPanel.MyStepTabPanel;
@@ -2749,6 +2774,199 @@ namespace VEPROMS
}
}
//C2024-036 IntelliSense
// Recursively Expand the Tree
// up to the procedure level
// Since items are only loaded as they are expanded,
// this is needed to search for matching text.
private void LoadAllProcedures(VETreeNode tn)
{
if (tn == null || tn.VEObject.IsProcedure)
return;
if (!tn.IsExpanded)
{ tn.Expand(); }
foreach (var nde in tn.Nodes)
LoadAllProcedures((VETreeNode)nde);
}
//C2024-036 IntelliSense
// Return a list containing all
// items in the Tree that match the entered text
// + any item that is a parent of those.
private List<IVEDrillDownReadOnly> GetMatchingTreeNodes(VETreeNode tn, string texttomatch)
{
List<IVEDrillDownReadOnly> matches = new List<IVEDrillDownReadOnly>();
//add any item that matches text
//and all parents back up to the top most item
if (tn.Text.ToLower().Contains(texttomatch.ToLower()))
{
matches.Add(tn.VEObject);
VETreeNode parent_tn = (VETreeNode) tn.Parent;
while (parent_tn != null)
{
if (!matches.Contains(parent_tn.VEObject))
{ matches.Add(parent_tn.VEObject); }
parent_tn = (VETreeNode)parent_tn.Parent;
}
}
if (!tn.VEObject.IsProcedure)
{
//if not at a procedure level,
//loop through sub items
//to check those for matches
foreach (VETreeNode nde in tn.Nodes.OfType<VETreeNode>())
{
if (nde.Text != "Dummy VETreeNode(IVEDrillDownReadOnly o)")
{
List<IVEDrillDownReadOnly> tmpmatches = GetMatchingTreeNodes(nde, texttomatch);
matches.AddRange(from mtch in tmpmatches
where !matches.Contains(mtch)
select mtch);
}
}
}
return matches;
}
//C2024-036 IntelliSense
// Recursively loop through the Child Nodes
// in the TreeView
// remove anything not in the list
private bool FilterTreeNodes(VETreeNode tn, List<IVEDrillDownReadOnly> filterlist)
{
if (tn == null)
return false;
if (!filterlist.Contains(tn.VEObject) && (tn != (VETreeNode) tv.Nodes[0])) //Note:Always keep the top node
{
return true;
}
else if (!tn.VEObject.IsProcedure)
{
//if not a procedure
//mark the sub-items that need removal
List<TreeNode> lst = (from VETreeNode nde in tn.Nodes.OfType<VETreeNode>()
where FilterTreeNodes(nde, filterlist)
select (TreeNode) nde).ToList();
//remove all items in the removal list
//need to do this separately as can't modify the collection while looping through it above
while (lst.Count > 0)
{
tn.Nodes.Remove(lst[0]);
lst.Remove(lst[0]);
}
//found a folder that matched that has no matching procedures
//if this is case, allow folder to be expanded
if (tn.Nodes.Count == 0 && filterlist.Contains(tn.VEObject))
{
tn.ChildrenLoaded = false;
tn.RefreshNode();
}
}
return false;
}
//C2024-036 IntelliSense
//Collection to block for task to complete
private BlockingCollection<string> blockingQueueFilter = new BlockingCollection<string>();
//C2024-036 IntelliSense
// When Text Changes, Perform the filtering
// Note that uses a blocking collection
// in case multiple events fire at the same time
// this is to prevent incorrect behavior when
//doing something like hitting backspace a bunch
private void SubmitFilter(object sender, EventArgs e)
{
//Consumer
Task.Run(() =>
{
//Blocks until a new filter is available
while (!blockingQueueFilter.IsCompleted)
{
string fltrtxt = blockingQueueFilter.Take();
ProcessFilter(fltrtxt);
}
});
//Producer
Task.Run(() => { blockingQueueFilter.Add(txtFilter?.Text); });
}
//C2024-036 IntelliSense
// When Enter Key is pressed in the TextBox
private void FilterEnterKey(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == '\r') // enter key pressed
{
e.Handled = true;
SubmitFilter(sender, e);
}
}
//C2024-036 IntelliSense
// When Text Changes, Perform the filtering
// Note that uses Invoke to
// avoid multi-threaded problems
//with the blocking collection
private void ProcessFilter(string fltrtxt)
{
//Step 1: reload the base tree
VETreeNode tbase = (VETreeNode)tv.Nodes[0];
tbase.ChildrenLoaded = false;
this.Invoke((Action) (() => { tbase.RefreshNode(); }));
if (!string.IsNullOrEmpty(fltrtxt))
{
//Step 2: Expand all TreeNodes
this.Invoke((Action)(() => { LoadAllProcedures(tbase); }));
//Step 3: get items that match filter to those containing the title or number
List<IVEDrillDownReadOnly> filterlist = GetMatchingTreeNodes(tbase, fltrtxt);
//Step 4: filter to those containing the title or number
this.Invoke((Action)(() => {FilterTreeNodes(tbase, filterlist);}));
//Step 5: refresh the view
this.Invoke((Action)(() => {tv.Update();}));
//Step 6: select 1st procedure in tree view
this.Invoke((Action)(() => {SelectFirstProcedure(filterlist);}));
}
//Step 7: set progress bar as done
this.Invoke((Action)(() => {ProgBarText = "Filtering Complete";}));
}
//C2024-036 IntelliSense
//Gives Focus to last child in first section of treeview
//then given focus to treeview
//so that can click enter and open 1st found item/procedure
void SelectFirstProcedure(List<IVEDrillDownReadOnly> filterlist)
{
TreeNode tn = tv.Nodes[0];
while (tn.Nodes.Count > 0 && filterlist.Contains(((VETreeNode) tn).VEObject))
{
tn = tn.Nodes[0];
}
tv.SelectedNode = tn;
tv.Enabled = true;
tv.SelectedNode.Collapse();
tv.Focus();
}
void btnPrevious_Click(object sender, EventArgs e)
{
CurrentID = FindPreviousLine();

View File

@@ -0,0 +1,42 @@
using System;
using Csla.Data;
using System.Data;
using System.Data.SqlClient;
//CSM - C2025-009 - Minimal Class for User based Reports
namespace VEPROMS.CSLA.Library
{
public static class UserReports
{
#region Get User Reports
//CSM - C2025-009 Report for tracking PROMS Users / security
public static DataTable GetUserAccessControlData()
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "getUserAcessControl";
cm.CommandTimeout = Database.DefaultTimeout;
using (SqlDataAdapter da = new SqlDataAdapter(cm))
{
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
}
}
}
catch (Exception ex)
{
throw new DbCslaException("Error in getUserAcessControl Report: retrieving data failed", ex);
}
}
#endregion
}
}

View File

@@ -388,6 +388,7 @@
<Compile Include="Generated\ZTransition.cs" />
<Compile Include="Generated\ZTransitionInfo.cs" />
<Compile Include="Minimal\AnnotationstypeSections.cs" />
<Compile Include="Minimal\UserReports.cs" />
<Compile Include="Minimal\UserSettings.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="VEObjects\VEDrillDown.cs" />

View File

@@ -563,6 +563,11 @@ namespace Volian.Controls.Library
{
if (PrintAllProcedures != null) PrintAllProcedures(sender, args);
}
public event vlnTreeViewEvent PrintAllApprovedProcedures; //C2025-017 print all approved procedures
private void OnPrintAllApprovedProcedures(object sender, vlnTreeEventArgs args)
{
if (PrintAllApprovedProcedures != null) PrintAllApprovedProcedures(sender, args);
}
public event vlnTreeViewEvent SelectDateToStartChangeBars;
private void OnSelectDateToStartChangeBars(object sender, vlnTreeEventArgs args)
{
@@ -784,6 +789,7 @@ namespace Volian.Controls.Library
MenuItem mip = new MenuItem("Print All Procedures for");
MenuItem mia = new MenuItem("Approve All Procedures for");
MenuItem mis = new MenuItem("Approve Some Procedures for");
MenuItem mir = new MenuItem("Print All Approved Procedures for"); // C2025-017 print all approved procedures
int k = 0;
foreach (string s in dvi.UnitNames)
{
@@ -794,6 +800,8 @@ namespace Volian.Controls.Library
ma.Tag = k;
MenuItem ms = mis.MenuItems.Add(s, new EventHandler(miMultiUnit_Click));
ms.Tag = k;
MenuItem mr = mir.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); // C2025-017 print all approved procedures
mr.Tag = k;
}
//MenuItem mmp = mip.MenuItems.Add("All Units", new EventHandler(miMultiUnit_Click));
//mmp.Tag = 0;
@@ -804,6 +812,7 @@ namespace Volian.Controls.Library
cm.MenuItems.Add(mip);
cm.MenuItems.Add(mia);
cm.MenuItems.Add(mis);
cm.MenuItems.Add(mir); // C2025-017 print all approved procedures
}
else
{
@@ -811,6 +820,7 @@ namespace Volian.Controls.Library
cm.MenuItems.Add("Print All Procedures", new EventHandler(mi_Click));
cm.MenuItems.Add("Approve All Procedures", new EventHandler(mi_Click));
cm.MenuItems.Add("Approve Some Procedures", new EventHandler(mi_Click));
cm.MenuItems.Add("Print All Approved Procedures", new EventHandler(mi_Click));
}
cm.MenuItems.Add("Report All Procedures Inconsistencies", new EventHandler(mi_Click));
}
@@ -2035,6 +2045,9 @@ namespace Volian.Controls.Library
case "Create Time Critical Action Summary":
OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
break;
case "Print All Approved Procedures for": //C2025-017 print all approved procedures
OnPrintAllApprovedProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
break;
default:
if (mip.Text.StartsWith("Showing Change Bars Starting"))
OnSelectDateToStartChangeBars(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
@@ -2133,16 +2146,6 @@ namespace Volian.Controls.Library
OnPrintTransitionReport(this, new vlnTreeEventArgs(SelectedNode as VETreeNode));
return;
}
if (mi.Text == "Export Procedure Set" || mi.Text == "Export Procedure")
{
OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
@@ -2346,6 +2349,9 @@ namespace Volian.Controls.Library
//case "Check In Procedure Set":
// CheckInDocVersion(SelectedNode as VETreeNode);
// break;
case "Print All Approved Procedures": //C2025-017 print all approved procedures
OnPrintAllApprovedProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
break;
default:
if (mi.Text.StartsWith("Showing Change Bars Starting"))
OnSelectDateToStartChangeBars(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));