Compare commits

..

38 Commits

Author SHA1 Message Date
a0be60a1b9 B2026-025_Unicode_removed_from_RO_menu_titles_in_treeview 2026-03-07 22:38:18 -05:00
d296d6f000 Merge pull request 'B2026-026_RO_Values_in_the_RO_value_textbox_at_the_top_Step_Properties_panel_now_displays_symbols' (#728) from B2026-026_RO_Values_in_the_RO_value_textbox_at_the_top_Step_Properties_panel_now_displays_symbols into Development
good for testing
2026-03-03 08:35:21 -05:00
8df4bd2537 B2026-026_RO_Values_in_the_RO_value_textbox_at_the_top_Step_Properties_panel_now_displays_symbols 2026-03-02 23:23:47 -05:00
cc5cdb88ff Merge pull request 'B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open' (#727) from B2026-019 into Development
good for testing phase
2026-03-02 14:18:13 -05:00
f66c6a93c5 Merge branch 'Development' into B2026-019 2026-03-02 14:12:12 -05:00
a7b5ee33e2 B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open 2026-03-02 14:12:26 -05:00
fe90af5aa4 Merge pull request 'B2026-021-some-symbols-not-being-displayed-correctly' (#726) from B2026-021-some-symbols-not-being-displayed-correctly into Development
good for testing phase
2026-02-27 13:34:23 -05:00
7e672d91e9 Merge branch 'Development' of https://git.volian.com/Volian/SourceCode into Development 2026-02-27 12:07:26 -05:00
09f472bee2 Merge pull request 'F2026-011 Vogtle Units 3&4 Backgrounds. Adjusted the section title text for the section 5.0 continue message so that it aligns with the background text on the page' (#725) from F2026-011_VogtleBackgrounds_sect_title_adj into Development
format only change
2026-02-27 10:35:25 -05:00
30da0c5105 F2026-011 Vogtle Units 3&4 Backgrounds. Adjusted the section title text for the section 5.0 continue message so that it aligns with the background text on the page 2026-02-27 10:35:46 -05:00
d2082cdbea Merge pull request 'B2026-019' (#724) from B2026-019 into Development
good for testing
2026-02-27 10:11:28 -05:00
c42596811e Merge branch 'Development' into B2026-019 2026-02-27 10:05:26 -05:00
d095a19187 Merge branch 'B2026-019' of https://git.volian.com/Volian/SourceCode into B2026-019 2026-02-27 10:06:42 -05:00
8089e2c898 B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open 2026-02-27 10:06:24 -05:00
a657d03fb0 Merge pull request 'F2026-012 Vogtle Units 3&4 Background format. Fixed the step tab for FOP Criteria (foldout background information).' (#723) from F2026-012_VogtleBackgroundFOP into Development
format only change
2026-02-27 09:34:25 -05:00
4e829200f5 F2026-012 Vogtle Units 3&4 Background format. Fixed the step tab for FOP Criteria (foldout background information). 2026-02-27 09:01:34 -05:00
bef9be5cbe Merge branch 'Development' of https://git.volian.com/Volian/SourceCode into Development 2026-02-26 15:44:46 -05:00
56f14323d1 Merge pull request 'B2026-017 Use Pre-typed in information when adding New Applicability' (#722) from B2026-017 into Development
good for testing phase
2026-02-26 15:07:15 -05:00
4fcd22ca68 B2026-017 Use Pre-typed in information when adding New Applicability 2026-02-26 14:49:06 -05:00
21890e74fe Merge branch 'Development' of https://git.volian.com/Volian/SourceCode into Development 2026-02-26 14:33:59 -05:00
ef32564fba Merge pull request 'B2026-024 Change bars should not show when updating Applicability.' (#721) from B2026-024 into Development
good for testing phase
2026-02-26 14:04:16 -05:00
d95505726f B2026-024 Change bars should not show when updating Applicability. 2026-02-26 13:14:25 -05:00
bb7b892f7c Merge branch 'Development' of https://git.volian.com/Volian/SourceCode into Development 2026-02-25 15:51:27 -05:00
836cdaf087 Merge pull request 'B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open' (#719) from B2026-019 into Development
good for testing phase
2026-02-25 15:48:11 -05:00
6f5c41abb8 Merge branch 'Development' into B2026-019 2026-02-25 15:41:45 -05:00
6379321785 Merge pull request 'F2026-010_VogtleBack_fontsize' (#720) from F2026-010_VogtleBack_fontsize into Development
format only change.
2026-02-25 15:40:41 -05:00
e4c6e4393e B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open 2026-02-25 15:36:44 -05:00
3e6bb81e39 F2025-010 Vogtle Units 3&4 Backgrounds. Made the font size of the hard-coded section 5.0 title and the linked step tab and step number consistent with the rest of the document. 2026-02-25 15:34:19 -05:00
ded6f18dd5 Development 2026-02-25 15:27:25 -05:00
81643e2aef Merge pull request 'C2026-023 Change "Applicability - Set All at Level" to check the transitions at each level for steps that would be changed.' (#718) from C2026-023 into Development
good for testing
2026-02-25 11:30:15 -05:00
8a186f9f0c C2026-023 Change "Applicability - Set All at Level" to check the transitions at each level for steps that would be changed. 2026-02-25 08:37:29 -05:00
14aa39976a Merge pull request 'B2025-064 PROMS clears the windows clipboard when closing PROMS with tabs open.' (#717) from B2025-064_v2 into Development
good for testing
2026-02-24 09:10:36 -05:00
c077e0ddc2 Merge pull request 'B2026-016 Fix Error Approving a Procedure without ROs set' (#716) from B2026-016 into Development
good for testing
2026-02-24 09:08:40 -05:00
d198a7b63a B2025-064 PROMS clears the windows clipboard when closing PROMS with tabs open. 2026-02-24 08:22:18 -05:00
7f36a33dea B2026-016 Fix Error Approving a Procedure without ROs set 2026-02-24 07:08:07 -05:00
db3d9fc65f Merge pull request 'C2026-010 Add Audit History to Setting Change Bars' (#715) from C2026-010 into Development
good for testing
2026-02-23 15:40:15 -05:00
f9738451db C2026-010 Add Audit History to Setting Change Bars 2026-02-23 15:25:32 -05:00
ec73b5cbea Merge pull request 'C2022-003-Change-Textboxes-to-RTF-3' (#701) from C2022-003-Change-Textboxes-to-RTF-3 into Development
Ready for testing phase.
2026-02-20 10:31:50 -05:00
23 changed files with 504 additions and 83 deletions

View File

@@ -2186,6 +2186,20 @@ namespace RODBInterface
}
string xmlstr = GenerateXmlString(ro, false);
StringBuilder xmlstrTmp = new StringBuilder(); // B2026-025 prep the info field data so it will be saved correctly.
char[] chrAry = xmlstr.ToCharArray();
foreach (int chr in chrAry)
{
if (chr > 160)
{
xmlstrTmp.Append($"\\u{(int)chr}?");
}
else
{
xmlstrTmp.Append((char)chr);
}
}
string wraccid = null;
if (ro.HasAttribute("AccPageID"))
{
@@ -2209,13 +2223,13 @@ namespace RODBInterface
// strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageID, ModDateTime, Info ) ";
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, AccPageID, Info ) ";
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');";
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp + "');";
}
else
{
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, Info ) ";
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.Group + ",'" + ro.GetAttribute("ParentID");
strInsert = strInsert + "','" + dt + "','" + xmlstr + "');";
strInsert = strInsert + "','" + dt + "','" + xmlstrTmp + "');";
}
}
@@ -2223,7 +2237,7 @@ namespace RODBInterface
{
strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageId, ModDateTime, Info ) ";
strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint)RecordType.RRO + ",'" + ro.GetAttribute("ParentID");
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');";
strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstrTmp + "');";
}
try

View File

@@ -96,6 +96,7 @@ using System.IO;
using System.Windows.Forms;
using ROFields;
using VlnStatus;
using System.Text.RegularExpressions;
//using VlnProfiler; //don't forget to add VlnProfiler to the reference list
namespace RODBInterface
@@ -517,7 +518,9 @@ namespace RODBInterface
strtmp.Append(" ");
cnt++;
}
if ((cnt + text.Length) > frmt2) // longer than the field length?
// string sym = symbcode < 256 ? ((char)symbcode).ToString() : string.Format(@"\u{0}", symbcode);
text = Regex.Replace(text, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString()); //B2026-025 Unicode removed from RO menu titles in treeview.
if ((cnt + text.Length) > frmt2) // longer than the field length?
strtmp.Append(text.Substring(0,frmt2-cnt));
else
strtmp.Append(text);

View File

@@ -32,7 +32,7 @@ namespace ctlXMLEditLib
public void InsertSymbol( int symbcode)
{
int position = this.SelectionStart;
string sym = string.Format(symbcode < 256 ? "\'{0:X2}" : @"\u{0}", symbcode);
string sym = symbcode < 256 ? ((char)symbcode).ToString() : string.Format(@"\u{0}", symbcode);
this.SelectedRtf = RtfPrefixForSymbols + sym + @"}";
Select(position, -1);
Select(position + 1, 0);

View File

@@ -24578,6 +24578,161 @@ IF (@@Error = 0) PRINT 'Procedure Creation: [GetCurrentApprovedRevisions] Succee
ELSE PRINT 'Procedure Creation: [GetCurrentApprovedRevisions] Error on Creation'
GO
/*
==========================================================================================================
-- Begin: C2026-010 Add Audit Ability for ChangeBars
-- Author: Matthew Schill
-- Create date: 02/17/2026
==========================================================================================================
*/
/*
----------------------------------------------------------------------------------
Tables:
----------------------------------------------------------------------------------
[ChangeBarAudits]
----------------------------------------------------------------------------------
Indexes:
----------------------------------------------------------------------------------
[IX_ChangeBarAudits_ItemID] on [dbo].[ChangeBarAudits]
*/
IF Not Exists(SELECT * FROM sys.objects Where name = 'ChangeBarAudits' AND type in (N'U'))
Begin
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
/****** Create Table to hold Audit Information ******/
CREATE TABLE [dbo].[ChangeBarAudits](
[AuditID] [bigint] IDENTITY(1,1) NOT NULL,
[ItemID] [bigint] NOT NULL,
[Text] [nvarchar](max) NULL,
[DTS] [datetime] NOT NULL,
[UserID] [nvarchar](100) NOT NULL,
[UnitIndex] [int] NULL,
CONSTRAINT [PK_ChangeBarAudits] PRIMARY KEY CLUSTERED
(
[AuditID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
IF (@@Error = 0) PRINT 'Table Creation: [ChangeBarAudits] Succeeded'
ELSE PRINT 'Table Creation: [ChangeBarAudits] Error on Creation'
/****** Table was not previously created - so intially populate with info from Approvals ******/
INSERT into ChangeBarAudits([ItemID],[Text],[DTS],[UserID],[UnitIndex])
select --rr.RevisionID,
rr.ItemID,
Text = CASE WHEN r1.value('@Index','int') <> 0 AND UnitName IS NOT NULL THEN
'(Unit ' + UnitName + ') '
ELSE
''
END +
'Approved by (' + rr.UserID + ') on (' +
CAST(rr.DTS AS VARCHAR) + ')',
rr.DTS,
rr.UserID,
UnitIndex = r1.value('@Index','int')
-- , UnitName
from revisions rr
inner join versions vv on rr.revisionid = vv.revisionid
inner join stages ss on vv.stageid = ss.stageid
outer apply rr.config.nodes('Config/Applicability') t1(r1)
outer apply
( Select r2.value('@Name','varchar') UnitName
FROM
(select DocVerSions.ItemID, cast(config as xml) xconfig from DocVersions
inner join
vefn_AllSiblingItems(rr.ItemID) Sib ON DocVerSions.ItemID = Sib.ItemID) SDV
cross apply
xconfig.nodes('Config/Slaves/Slave') t2(r2)
WHERE r2.value('@index','varchar') = r1.value('@Index','int')
) UN
where ss.isapproved = 1
order by rr.ItemID, rr.RevisionID desc
IF (@@Error = 0) PRINT '[ChangeBarAudits] Initial Population Succeeded'
ELSE PRINT '[ChangeBarAudits] Initial Population Error'
/****** Create Index to get ChangeBar Audit Information for Item (ItemID = ProcedureID) ******/
CREATE NONCLUSTERED INDEX [IX_ChangeBarAudits_ItemID] ON [dbo].[ChangeBarAudits]
(
[ItemID] ASC
)
INCLUDE ([AuditID], [Text], [DTS], [UnitIndex])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
IF (@@Error = 0) PRINT 'Index Creation: [IX_ChangeBarAudits_ItemID] Succeeded'
ELSE PRINT 'Index Creation: [IX_ChangeBarAudits_ItemID] Error on Creation'
End
-- =============================================
-- Description: Gets ChangeBar Audit History by item
-- =============================================
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[GetChangeBarAuditHistoryByItem]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [GetChangeBarAuditHistoryByItem];
GO
CREATE PROCEDURE [dbo].[GetChangeBarAuditHistoryByItem]
(
@ItemID AS bigint
)
AS
BEGIN
Select * FROM ChangeBarAudits where ItemID = @ItemID
order by DTS desc
RETURN
END
IF (@@Error = 0) PRINT 'Procedure Creation: [GetChangeBarAuditHistoryByItem] Succeeded'
ELSE PRINT 'Procedure Creation: [GetChangeBarAuditHistoryByItem] Error on Creation'
GO
-- =============================================
-- Description: Adds ChangeBar Audit History
-- =============================================
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[AddChangeBarAuditHistory]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [AddChangeBarAuditHistory];
GO
CREATE PROCEDURE [dbo].[AddChangeBarAuditHistory]
(
@ItemID AS bigint,
@Description As nvarchar(max),
@DTS AS Datetime,
@UserID As nvarchar(100),
@UnitIndex AS bigint = NULL
)
AS
BEGIN
INSERT into ChangeBarAudits([ItemID],[Text],[DTS],[UserID],[UnitIndex])
VALUES (@ItemID, @Description, @DTS, @UserID, @UnitIndex)
RETURN
END
IF (@@Error = 0) PRINT 'Procedure Creation: [AddChangeBarAuditHistory] Succeeded'
ELSE PRINT 'Procedure Creation: [AddChangeBarAuditHistory] Error on Creation'
GO
/*
==========================================================================================================
-- End: C2026-010 Add Audit Ability for ChangeBars
==========================================================================================================
*/
/*
---------------------------------------------------------------------------
| ADD New Code Before this Block |
@@ -24611,8 +24766,8 @@ BEGIN TRY -- Try Block
DECLARE @RevDate varchar(255)
DECLARE @RevDescription varchar(255)
set @RevDate = '02/09/2026 7:00 AM'
set @RevDescription = 'Added procedure for getting current revisions'
set @RevDate = '02/18/2026 7:00 AM'
set @RevDescription = 'Added Audit Ability for ChangeBars'
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription

View File

@@ -1135,6 +1135,7 @@ namespace VEPROMS
ViewPDF = ViewPDF && MyProcedures.Count == 1;
StringBuilder sb = new StringBuilder();
StageInfo nsi = StageInfo.GetJustStage(RevStage);
DateTime now = DateTime.Now; //using variable so dates are consistent
foreach (ApprovalProcedure ap in MyProcedures) //spin thru looking for updating current revision
{
// ric: current revision info record, not new one being created.
@@ -1207,7 +1208,7 @@ namespace VEPROMS
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(), DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
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();
@@ -1234,7 +1235,7 @@ namespace VEPROMS
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(), DateTime.Now, Volian.Base.Library.VlnSettings.UserID);
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();
@@ -1253,7 +1254,7 @@ namespace VEPROMS
byte[] summaryBuf = null;
//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 = DateTime.Now;
DateTime currentDTS = now;
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
@@ -1311,7 +1312,15 @@ namespace VEPROMS
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
if (si.IsApproved == 1)
{
dlgExportImport dlg = new dlgExportImport("Export", pi, MyFrmVEPROMS, (selectedSlave)); // "true tell export to convert ROs and Transitions to text
//B2026-016 - Fix error pulling Reference Object info into Export
if (pi.MyDocVersion.DocVersionAssociationCount == 0)
{
MessageBox.Show("Prior to Approval you must set the Referenced Object Database", "No RO Database set", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return false;
}
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");
@@ -1319,30 +1328,46 @@ namespace VEPROMS
version.ApprovedXML = xd.OuterXml;
version.Save();
dlg.Dispose();
UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, DateTime.Now, selectedSlave);
UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, now, selectedSlave);
// Clear the change bar override for this procedure:
pi.ClearChangeBarOverrides();
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
ChangeBarAuditHistory.AddAudit(pi.ItemID, $"{(selectedSlave > 0 ? $"(Unit {pi.MyDocVersion.UnitNames[selectedSlave - 1]}) " : "")}Approved by ({VlnSettings.UserID}) on ({now})", now, VlnSettings.UserID, selectedSlave);
// Clear the change bar override for this procedure:
pi.ClearChangeBarOverrides();
//B2019-140 Change bars do not get refreshed when approval is run.
ProcedureInfo newproc = ItemInfo.ResetProcedure(pi.ItemID);
ProcedureInfo newproc;
//// Refresh the StepPanel for the current Procedure
//// so change bars update
//// on any open StepPanel
DisplayTabItem dti = MyFrmVEPROMS.GetTabContainingProcedure(pi.ItemID);
//// Refresh the StepPanel for the current Procedure
//// so change bars update
//// on any open StepPanel
//B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open
DisplayTabItem dti = MyFrmVEPROMS.GetTabContainingProcedure(pi.ItemID);
if (dti != null)
{
if (!dti.MyStepTabPanel.MyStepPanel.ContainsFocus)
dti.MyStepTabPanel.MyStepPanel.Focus();
foreach (EditItem eitm in dti.MyStepTabPanel.MyStepPanel.Controls.OfType<EditItem>())
eitm.ChangeBar = eitm.MyItemInfo.HasChangeBar;
}
{
eitm.ChangeBar = eitm.MyItemInfo.HasChangeBar;
}
//since in a separate form, need to update the tree view
//so "Showing Change Bars" Content Menu Item is correct
MyFrmVEPROMS.RefreshProcedureNode(newproc);
dti.MyStepTabPanel.MyStepTabRibbon.RefreshProcedure();
Application.DoEvents();
newproc = ProcedureInfo.Get(pi.ItemID);
}
else
{
newproc = ItemInfo.ResetProcedure(pi.ItemID);
}
//since in a separate form, need to update the tree view
//so "Showing Change Bars" Content Menu Item is correct
MyFrmVEPROMS.RefreshProcedureNode(newproc);
}
else
UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, myDTS, selectedSlave);

View File

@@ -1618,8 +1618,15 @@ namespace VEPROMS
public void ExportItem(XmlDocument xd, ItemInfo ii, string nodename)
{
XmlElement xe = xd.CreateElement(nodename);
if (ii.IsProcedure)
//B2026-016 - Fix error pulling Reference Object info into Export
if (ii.MyDocVersion.DocVersionAssociationCount == 0)
{
MessageBox.Show("Prior to Exporting Procedures you must set the Referenced Object Database", "No RO Database set", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
XmlElement xe = xd.CreateElement(nodename);
if (ii.IsProcedure)
{
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID.ToString()));
xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofolderpath", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath));

View File

@@ -1,8 +1,10 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Volian.Base.Library;
using Volian.Controls.Library;
namespace VEPROMS
@@ -29,7 +31,7 @@ namespace VEPROMS
{
cbdt = DateTime.Now.ToString("MM/dd/yyyy") + " " + DateTime.Now.ToString("HH:mm:ss");
dateTimeInput1.Value = DateTime.Parse(cbdt);
return;
return;
}
else
{
@@ -64,10 +66,14 @@ namespace VEPROMS
private void btnOK_Click(object sender, EventArgs e)
{
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.ToString("MM/dd/yyyy HH:mm:ss")}) by ({ VlnSettings.UserID}) on ({DateTime.Now})", DateTime.Now, VlnSettings.UserID, 0);
}
private void btnNow_Click(object sender, EventArgs e)
private void btnNow_Click(object sender, EventArgs e)
{
dateTimeInput1.Value = DateTime.Now;
}
@@ -84,11 +90,16 @@ namespace VEPROMS
{
MyProcConfig.Print_ChangeBarDate = "";
DialogResult = DialogResult.OK;
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show all changes.", DateTime.Now, VlnSettings.UserID, 0);
Close();
}
}
else if (RevisionData.HasUnits(dt))
{
//any with units
string maxDTS = RevisionData.MaxDTS(dt).ToString("MM/dd/yyyy HH:mm:ss");
@@ -107,15 +118,22 @@ namespace VEPROMS
//Change the overall ChangeBarDate
MyProcConfig.Print_ChangeBarDate = maxDTS;
//Change the ChangeBarDate for each unit
foreach (DataRow r in dt.Rows)
//Change the ChangeBarDate for each unit
foreach (DataRow r in dt.Rows)
{
MyProcConfig.SelectedSlave = Convert.ToInt32(r["UnitID"]);
MyProcConfig.Print_ChangeBarDate = Convert.ToDateTime(r["DTS"]).ToString("MM / dd / yyyy HH: mm: ss");
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show since last approval ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave);
}
MyProcConfig.SelectedSlave = 0;
DialogResult = DialogResult.OK;
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show since last approval ({maxDTS})", DateTime.Now, VlnSettings.UserID, 0);
Close();
}
}
@@ -127,6 +145,9 @@ namespace VEPROMS
{
MyProcConfig.Print_ChangeBarDate = maxDTS;
DialogResult = DialogResult.OK;
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Reset ChangeBars performed by ({VlnSettings.UserID}) on ({DateTime.Now}). ChangeBars reset to show since last approval ({maxDTS})", DateTime.Now, VlnSettings.UserID, 0);
Close();
}
}

View File

@@ -877,7 +877,7 @@ namespace VEPROMS
this.infoPanel.ExpandOnTitleClick = true;
this.infoPanel.Location = new System.Drawing.Point(614, 57);
this.infoPanel.Name = "infoPanel";
this.infoPanel.Size = new System.Drawing.Size(230, 490);
this.infoPanel.Size = new System.Drawing.Size(300, 490);
this.infoPanel.Style.Alignment = System.Drawing.StringAlignment.Center;
this.infoPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;
this.infoPanel.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;

View File

@@ -626,21 +626,26 @@ namespace VEPROMS
itm.UserID = Volian.Base.Library.VlnSettings.UserID;
itm.Save();
//B2019-140 Change bars do not get refreshed when approval is run.
// Reset a Procedure and sub items in the cache
ProcedureInfo newproc = ItemInfo.ResetProcedure(pi.ItemID);
//B2019-140 Change bars do not get refreshed when approval is run.
// Reset a Procedure and sub items in the cache
ProcedureInfo newproc = ItemInfo.ResetProcedure(pi.ItemID);
//// Refresh the StepPanel for the current Procedure
//// so change bars update
//// on any open StepPanel
//B2026-019 Attempt to prevent an Access Error by utilizing a different Refresh if a Procedure is Open
DisplayTabItem dti = GetTabContainingProcedure(pi.ItemID);
if (dti != null)
{
//// Refresh the StepPanel for the current Procedure
//// so change bars update
//// on any open StepPanel
DisplayTabItem dti = GetTabContainingProcedure(pi.ItemID);
if (dti != null)
{
if (!dti.MyStepTabPanel.MyStepPanel.ContainsFocus)
dti.MyStepTabPanel.MyStepPanel.Focus();
dti.MyStepTabPanel.MyStepPanel.Focus();
foreach (EditItem eitm in dti.MyStepTabPanel.MyStepPanel.Controls.OfType<EditItem>())
{
eitm.ChangeBar = eitm.MyItemInfo.HasChangeBar;
}
}
}
}

View File

@@ -1113,13 +1113,34 @@ namespace VEPROMS
if (_Apples == null)
{
_Apples = new List<MiniConfig>();
}
_Apples.Add(cfg);
}
//B2026-017 Use Pre-typed in information when adding New Applicability
if (_Apples.Count == 0)
{
cfg.ID = textBox1.Text;
if (!string.IsNullOrEmpty(textBox2.Text))
{
cfg.Name = textBox2.Text;
}
cfg.Number = textBox3.Text;
cfg.Text = textBox4.Text;
cfg.OtherID = textBox8.Text;
cfg.OtherName = textBox9.Text;
cfg.OtherNumber = textBox10.Text;
cfg.OtherText = textBox11.Text;
cfg.ProcedureNumber = textBox5.Text;
cfg.SetID = textBox6.Text;
cfg.SetName = textBox7.Text;
}
_Apples.Add(cfg);
bsApples.DataSource = null;
bsApples.DataSource = _Apples;
lbApplicabilities.SelectedItem = cfg;
}
lbApplicabilities.SelectedItem = cfg;
lbApplicabilities_SelectedIndexChanged(sender, e);
}
private bool ApplicIsUsed(MiniConfig cfg) // B2017-230 - don't allow user to remove an applicability that is being used (specified)
{

View File

@@ -2291,7 +2291,7 @@ OnPropertyChanged("Default_BkColor");
public void RemoveSlave(int index)
{
XmlNode dd = _Xp.XmlContents.SelectSingleNode("//Slave[@index='" + index.ToString() + "']");
dd.ParentNode.RemoveChild(dd);
dd?.ParentNode?.RemoveChild(dd);
}
public int MaxSlaveIndex
{

View File

@@ -3839,9 +3839,17 @@ namespace VEPROMS.CSLA.Library
_SupInfos = null;
}
//B2019-140 Change bars do not get refreshed when approval is run.
// Reset a Procedure and sub items in the cache
public static ProcedureInfo ResetProcedure(int procID)
//B2019-140 Change bars do not get refreshed when approval is run.
// Reset a Procedure and sub items in the cache
// **********************
// Be carefull calling this when the Procedure is Open
// When the Procedure is Open - use StepTabRibbon.RefreshProcedure(); instead
// When a Procedure is open and you try to refresh it,
// events can fire behind the scenes - causing data to try to be accessed while you are trying to refresh it
// When This occurs, it will cause a
// "ThreadException ... Collection was modified; enumeration operation may not execute.”
// **********************
public static ProcedureInfo ResetProcedure(int procID)
{
// The following lines reload the procedure info cache
ProcedureInfo newproc = ProcedureInfo.Get(procID, true);
@@ -3859,26 +3867,27 @@ namespace VEPROMS.CSLA.Library
ItemInfo newprocitem = Get(procID, true);
newprocitem.RefreshConfig();
//Reload all the child/sub items
//Reload all the child/sub items
#pragma warning disable S2971 // LINQ expressions should be simplified - need initial ToList to force enumeration
//otherwise will get a "Collection was modified; enumeration operation may not execute" error
List<int> itemIDs = _CacheByPrimaryKey.Values.ToList().SelectMany(y => y).Where(t => t?.ActiveParent != null && (t.ActiveParent is ItemInfo) && t.MyProcedure.ItemID == procID).Select(x => (x.ActiveParent as ItemInfo).ItemID).Distinct().ToList();
//otherwise will get a "Collection was modified; enumeration operation may not execute" error
List<int> itemIDs = _CacheByPrimaryKey.SelectMany(kvp => kvp.Value).ToList().Where(t => t?.ActiveParent != null && (t.ActiveParent is ItemInfo) && t.MyProcedure.ItemID == procID).Select(x => (x.ActiveParent as ItemInfo).ItemID).Distinct().ToList();
#pragma warning restore S2971 // LINQ expressions should be simplified
for (int index = 0; index < itemIDs.Count; index++)
{
ResetParts(itemIDs[index]);
}
//reset the procedure config for all items attached to current procedure
#pragma warning disable S2971 // LINQ expressions should be simplified - need initial ToList to force enumeration
//otherwise will get a "Collection was modified; enumeration operation may not execute" error
List<ItemInfo> pconfigrefresh_items = _CacheByPrimaryKey.Values.ToList().SelectMany(y => y).Where(t => t?.MyProcedure?.ItemID == procID).Distinct().ToList();
#pragma warning restore S2971 // LINQ expressions should be simplified
for (int index = 0; index < pconfigrefresh_items.Count; index++)
{
pconfigrefresh_items[index].MyProcedure = newproc;
ResetParts(itemIDs[index]);
}
//reset the procedure config for all items attached to current procedure
#pragma warning disable S2971 // LINQ expressions should be simplified - need initial ToList to force enumeration
//otherwise will get a "Collection was modified; enumeration operation may not execute" error
List<ItemInfo> pconfigrefresh_items = _CacheByPrimaryKey.SelectMany(kvp => kvp.Value).ToList().Where(t => t?.MyProcedure?.ItemID == procID).Distinct().ToList();
#pragma warning restore S2971 // LINQ expressions should be simplified
for (int index = 0; index < pconfigrefresh_items.Count; index++)
{
pconfigrefresh_items[index].MyProcedure = newproc;
}
//return the changed procedure info
return newproc;
}

View File

@@ -0,0 +1,72 @@
using System;
using Csla.Data;
using System.Data;
using System.Data.SqlClient;
//CSM - C2026-010 - Minimal Class for Managing Change Bar Audit History
namespace VEPROMS.CSLA.Library
{
public static class ChangeBarAuditHistory
{
#region Add Audit Record for ChangeBar History
public static void AddAudit(int itemID, string description, DateTime dts, string userID, int unitIndex)
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "AddChangeBarAuditHistory";
cm.Parameters.AddWithValue("@ItemID", itemID);
cm.Parameters.AddWithValue("@Description", description);
cm.Parameters.AddWithValue("@DTS", dts);
cm.Parameters.AddWithValue("@UserID", userID);
if (unitIndex != 0) cm.Parameters.AddWithValue("@UnitIndex", unitIndex);
cm.CommandTimeout = 0;
cm.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
throw new DbCslaException("Error in ChangeBarAuditHistory.AddAudit: ", ex);
}
}
#endregion
#region Get Change Bar Audit History
public static DataTable GetChangeBarAuditHistory(int itemID)
{
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "GetChangeBarAuditHistoryByItem";
cm.Parameters.AddWithValue("@ItemID", itemID);
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 ChangeBarAuditHistory.GetChangeBarAuditHistoryByItem: retrieving data failed", ex);
}
}
#endregion
}
}

View File

@@ -389,6 +389,7 @@
<Compile Include="Generated\ZTransition.cs" />
<Compile Include="Generated\ZTransitionInfo.cs" />
<Compile Include="Minimal\AnnotationstypeSections.cs" />
<Compile Include="Minimal\ChangeBarAuditHistory.cs" />
<Compile Include="Minimal\Maintenance.cs" />
<Compile Include="Minimal\GeneralReports.cs" />
<Compile Include="Minimal\RevisionData.cs" />

View File

@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
@@ -225,8 +226,8 @@ namespace Volian.Controls.Library
// return internal and external for the procedure level)
if ((!MyItemInfo.IsProcedure && invalidTrans.Count == 0) || IsProcWithNoExternalTrans(MyItemInfo, invalidTrans))
{
// C2021 - 027: Procedure level PC/PC
if (MyItemInfo.IsProcedure && MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ProcAppl)
// C2021 - 027: Procedure level PC/PC
if (MyItemInfo.IsProcedure && MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ProcAppl)
{
ProcedureConfig sc = MyItemInfo.MyConfig as ProcedureConfig;
sc.MasterSlave_Applicability = Volian.Base.Library.BigNum.MakeBigNum(MyApplicability);
@@ -284,26 +285,56 @@ namespace Volian.Controls.Library
Volian.Base.Library.BigNum MasterSlave_ApplicabilityTmp;
StepConfig sc = MyItemInfo.MyConfig as StepConfig;
MasterSlave_ApplicabilityTmp = sc.MasterSlave_Applicability;
StringBuilder sb = new StringBuilder();
ItemInfo startitm = MyItemInfo.FirstSibling;
ItemInfo startitm = MyItemInfo.FirstSibling;
while (startitm != null)
{
StepConfig sc2 = startitm.MyConfig as StepConfig;
using (Content cnt = Content.Get(startitm.MyContent.ContentID))
{
sc2.MasterSlave_Applicability = (MasterSlave_ApplicabilityTmp);
cnt.Config = sc2.ToString();
cnt.Save();
// C2026-023: Check for Transitions when setting Applicability to all for a level
List<InvalidTransition> invalidTrans = WillTransitionsBeValidCommand.Execute(startitm.ItemID, MasterSlave_ApplicabilityTmp.ToString());
if (IsProcWithNoExternalTrans(startitm, invalidTrans))
{
StepConfig sc2 = startitm.MyConfig as StepConfig;
using (Content cnt = Content.Get(startitm.MyContent.ContentID))
{
sc2.MasterSlave_Applicability = (MasterSlave_ApplicabilityTmp);
cnt.Config = sc2.ToString();
cnt.Save();
}
}
else
{
if (sb.Length == 0)
{
sb.AppendLine("The applicability for some Step(s) cannot be changed due to transition links.");
sb.AppendLine("Applicability settings for these steps will return to original settings when OK is selected.");
sb.AppendLine("Changing the applicability for would invalidate a transition in the following steps:");
sb.AppendLine();
}
foreach (InvalidTransition inv in invalidTrans.Where(x => !x.TgtStep.StartsWith(x.SrcStep)))
{
sb.AppendLine(string.Format("{0} : From {1} to {2}.", startitm.MyTab.CleanTextNoSymbols.Trim(), inv.TgtStep, inv.SrcStep));
}
invalidTrans.Clear();
}
startitm = startitm.GetNext();
}
_MyDisplayTabItem.MyStepTabPanel.MyStepTabRibbon.RefreshProcedure();
}
if (sb.Length > 0)
FlexibleMessageBox.Show(sb.ToString(), "Transitions Affected By Applicability Change");
// B2021-149: for procedure, only consider external transitions as invalid
private bool IsProcWithNoExternalTrans(ItemInfo ii, List<InvalidTransition> invalidTrans)
}
// B2021-149: for procedure, only consider external transitions as invalid
private bool IsProcWithNoExternalTrans(ItemInfo ii, List<InvalidTransition> invalidTrans)
{
if (invalidTrans.Count == 0) return true;
foreach (InvalidTransition iT in invalidTrans)

View File

@@ -56,7 +56,20 @@ namespace Volian.Controls.Library
set
{
if (DesignMode) return; // B2019-043 need to check if we are just saving changes to the user interface
if (value is ProcedureInfo && _MyProcedureInfo is ProcedureInfo && value.ItemID == _MyProcedureInfo.ItemID)
//CSM - C2026-010 - Set/Show Change Bar Audit History
if (value != null)
{
lbChangeBarHistory.DataSource = ChangeBarAuditHistory.GetChangeBarAuditHistory(value.ItemID);
lbChangeBarHistory.ValueMember = "AuditID";
lbChangeBarHistory.DisplayMember = "Text";
}
else
{
lbChangeBarHistory.DataSource = null;
}
if (value is ProcedureInfo && _MyProcedureInfo is ProcedureInfo && value.ItemID == _MyProcedureInfo.ItemID)
return;
_MyProcedureInfo = value;
if (value == null) return;
@@ -184,6 +197,15 @@ namespace Volian.Controls.Library
InitializeComponent();
myRTB.FormatFont = null;
RefreshRequired = true;
if (MyProcedureInfo != null)
{
lbChangeBarHistory.DataSource = ChangeBarAuditHistory.GetChangeBarAuditHistory(MyProcedureInfo.ItemID);
}
else
{
lbChangeBarHistory.DataSource = null;
}
}
private void lbChanges_VisibleChanged(object sender, System.EventArgs e)
@@ -1075,7 +1097,25 @@ namespace Volian.Controls.Library
{
tvAudits.Height = ((tcpDetail.Height - btnRestore.Height) / 4) * 3;
}
public void RefreshChangeList()
//CSM - C2026-010 - Set/Show Change Bar Audit History
//Display a Tooltip for what was in the list
private void LbChangeBarHistory_MouseMove(object sender, MouseEventArgs e)
{
// Just use the item's value for the tooltip.
int index = lbChangeBarHistory.IndexFromPoint(e.Location);
if (index != ListBox.NoMatches)
{
DataRow rw = (lbChangeBarHistory.Items[index] as DataRowView)?.Row;
// Display the item's value as a tooltip.
if (tipCBHistory.GetToolTip(lbChangeBarHistory) != rw["Text"].ToString())
tipCBHistory.SetToolTip(lbChangeBarHistory, rw["Text"].ToString());
}
}
public void RefreshChangeList()
{
myTimer.Enabled = false;
myTimer.Enabled = true;

View File

@@ -188,4 +188,7 @@
<metadata name="myTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="tipCBHistory.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>119, 17</value>
</metadata>
</root>

View File

@@ -374,6 +374,7 @@ namespace Volian.Controls.Library
// B2022-098: [JPR] ROs not being resolved in Word Sections
if (e.Node.Tag is ROFSTLookup.rochild){
ROFSTLookup.rochild chld = (ROFSTLookup.rochild)e.Node.Tag;
chld.value = Regex.Replace(chld.value, @"\\u([0-9]{1,4})\?", m => Convert.ToChar(int.Parse(m.Groups[1].Value)).ToString());
selectedChld = chld;
if (chld.value != null)

View File

@@ -4162,8 +4162,11 @@ namespace Volian.Controls.Library
}
void MyConfig_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
SaveConfig();
}
//B2026-024 Change bars should not show when updating Applicability.
if (e.PropertyName == "MasterSlave_Applicability") ChangeBarForConfigItemChange = false;
SaveConfig();
if (e.PropertyName == "MasterSlave_Applicability") ChangeBarForConfigItemChange = true;
}
public void SaveConfig()
{
if (!MyItemInfo.MyConfig.IsDirty) return;

View File

@@ -1404,7 +1404,7 @@ namespace Volian.Controls.Library
var pattern = @"\\u([0-9]{1,4})\?"; // RO Editor add symbols C2022 - 003
foreach (Match match in Regex.Matches(linkValue, pattern, RegexOptions.IgnoreCase))
{
linkValue = linkValue.Replace(match.Value, "\\f1 " + match.Value + " \\f0");
linkValue = linkValue.Replace(match.Value, "\\f1 " + match.Value + "\\f0");
}
linkValue = linkValue.Replace(@"{", @"\{");

View File

@@ -1668,7 +1668,17 @@ namespace Volian.Controls.Library
}
Clipboard.Clear();
Clipboard.SetDataObject(myDO); // this saves the cleaned up information to the Windows clipboard
//Try to update the data object to persist beyond PROMS life
//if can't, log it and use old method of scoping clipboard to PROMS life
try
{
Clipboard.SetDataObject(myDO, true); // this saves the cleaned up information to the Windows clipboard
}
catch (Exception ex)
{
_MyLog.Warn($"Error Setting Clipboard Object to Persist beyond PROMS. Clipboard will be scoped to PROMS. Error:{ex.Message}");
Clipboard.SetDataObject(myDO); // this saves the cleaned up information to the Windows clipboard
}
}
iData = Clipboard.GetDataObject();
bool noEquationData = true;