Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 23173074aa | |||
| be8bb9c4e1 | |||
| d07e132216 | |||
| 401fa12851 | |||
| 194ca84d38 | |||
| 7bbf62d735 | |||
| 3924e2fca5 | |||
| 2e39102e7c | |||
| 2a0849fae5 | |||
| 9f4e8f6eef | |||
| d0fe36f86e | |||
| 10da22cd77 | |||
| 6dacc2d515 | |||
| 7baa9628d6 | |||
| ec5229101f | |||
| a0e0b1e788 | |||
| f1e04396de | |||
| d0cae8c2fc | |||
| 90c215d4c1 | |||
| 1b1dc78548 | |||
| a112163f85 | |||
| 2a9f2e188d | |||
| 652e0cb06f | |||
| 123b1b08c2 | |||
| b321bc354b | |||
| 03d7397242 | |||
| 7273a8b13b |
Binary file not shown.
@@ -844,12 +844,8 @@ namespace ROEditor
|
||||
AccPageID = " ";
|
||||
WriteString(AccPageID);
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
string moddt = ROdatabase.RODB_GetModDateTime(elem.GetAttribute("RecID"), elem.GetAttribute("Table"));
|
||||
if (!string.IsNullOrEmpty(moddt)) WriteString(moddt);
|
||||
|
||||
// Save the ID and offset entry for the current ID
|
||||
IdsAndOffsets.Add(RORecID, startFST);
|
||||
IdsAndOffsets.Add(RORecID,startFST);
|
||||
|
||||
// Save the RecID and Accessory Page id
|
||||
IdsAndAccPgIds[AccPageID] = RORecID;
|
||||
|
||||
@@ -355,7 +355,6 @@ namespace RODBInterface
|
||||
public abstract string RODB_GetDBServerForAbout();
|
||||
public abstract string RODB_HasBeenConverted();
|
||||
public abstract bool RODB_WriteSqlConnectToAccess(string newConectStr);
|
||||
public abstract string RODB_GetModDateTime(string Recid, string table);
|
||||
#endregion
|
||||
|
||||
public RODB()
|
||||
@@ -3083,27 +3082,6 @@ namespace RODBInterface
|
||||
return GrpCnt;
|
||||
}
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
//Get the Modification Date / Time for the RO
|
||||
public override string RODB_GetModDateTime(string Recid, string table)
|
||||
{
|
||||
using (System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection(strDatabaseConnectionCommand))
|
||||
{
|
||||
connection.Open();
|
||||
using (System.Data.OleDb.OleDbCommand command = connection.CreateCommand())
|
||||
{
|
||||
//Unfortunately Access wont let you paramaterize the table name
|
||||
command.CommandText = $"SELECT ModDateTime FROM {Regex.Replace(table, "[^a-zA-Z0-9]", "")} WHERE RecID = @Value";
|
||||
command.Parameters.Add(new System.Data.OleDb.OleDbParameter
|
||||
{
|
||||
OleDbType = System.Data.OleDb.OleDbType.VarChar,
|
||||
ParameterName = "@Value",
|
||||
Value = Recid
|
||||
});
|
||||
return command.ExecuteScalar().ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2653,34 +2653,6 @@ namespace RODBInterface
|
||||
}
|
||||
return GrpCnt;
|
||||
}
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
//Get the Modification Date / Time for the RO
|
||||
public override string RODB_GetModDateTime(string Recid, string table)
|
||||
{
|
||||
using (SqlConnection connection = new SqlConnection(strDatabaseConnectionCommand))
|
||||
{
|
||||
connection.Open();
|
||||
using (SqlCommand command = connection.CreateCommand())
|
||||
{
|
||||
command.CommandText = $"SELECT ModDateTime FROM ROALL WHERE RecID = @Value AND ROTable = @table";
|
||||
command.Parameters.Add(new SqlParameter
|
||||
{
|
||||
SqlDbType = SqlDbType.VarChar,
|
||||
ParameterName = "@Value",
|
||||
Value = Recid
|
||||
});
|
||||
command.Parameters.Add(new SqlParameter
|
||||
{
|
||||
SqlDbType = SqlDbType.VarChar,
|
||||
ParameterName = "@table",
|
||||
Value = table
|
||||
});
|
||||
|
||||
return command.ExecuteScalar().ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
public static bool TestConnect(string constring)
|
||||
{
|
||||
|
||||
@@ -13541,6 +13541,34 @@ IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteAllDocVers
|
||||
DROP PROCEDURE [deleteAllDocVersionPdfs];
|
||||
GO
|
||||
|
||||
/*****************************************************************************
|
||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
Copyright 2017 - Volian Enterprises, Inc. All rights reserved.
|
||||
*****************************************************************************/
|
||||
CREATE PROCEDURE [dbo].[deleteAllDocVersionPdfs]
|
||||
|
||||
(
|
||||
@VersionID int
|
||||
)
|
||||
WITH EXECUTE AS OWNER
|
||||
AS
|
||||
BEGIN TRY -- Try Block
|
||||
BEGIN TRANSACTION
|
||||
DELETE [Pdfs]
|
||||
WHERE [DocID] IN(select EE.DocID from vefn_GetVersionItems(cast(@VersionID as varchar(20))) VI
|
||||
Join Entries EE ON EE.ContentID= VI.ContentID)
|
||||
IF( @@TRANCOUNT > 0 ) COMMIT
|
||||
END TRY
|
||||
BEGIN CATCH -- Catch Block
|
||||
IF( @@TRANCOUNT = 1 ) ROLLBACK -- Only rollback if top level
|
||||
ELSE IF( @@TRANCOUNT > 1 ) COMMIT -- Otherwise commit. Top level will rollback
|
||||
EXEC vlnErrorHandler
|
||||
END CATCH
|
||||
GO
|
||||
-- Display the status of Proc creation
|
||||
IF (@@Error = 0) PRINT 'Procedure Creation: deleteAllDocVersionPdfs Succeeded'
|
||||
ELSE PRINT 'Procedure Creation: deleteAllDocVersionPdfs Error on Creation'
|
||||
GO
|
||||
/****** Object: StoredProcedure [addFiguresByROFstIDandImageIDs] ******/
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[addFiguresByROFstIDandImageIDs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [addFiguresByROFstIDandImageIDs];
|
||||
@@ -17141,7 +17169,6 @@ GO
|
||||
[roid] [varchar](50) NOT NULL,
|
||||
[appid] [varchar](max) NULL,
|
||||
[value] [varchar](max) NULL,
|
||||
[moddatetime] [datetime] NULL,
|
||||
CONSTRAINT [PK_RofstChild] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[RofstChildID] ASC
|
||||
@@ -17276,23 +17303,6 @@ GO
|
||||
End -- Rofst Tables
|
||||
Go
|
||||
|
||||
-- =============================================
|
||||
-- Author: Matthew Schill
|
||||
-- Create date: 03/30/2026
|
||||
-- Description: Store RO Modification date/time
|
||||
-- =============================================
|
||||
|
||||
--- Add Column to store RO Modification date/time if it does not already exist
|
||||
IF NOT EXISTS(SELECT *
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_NAME = 'RofstChild'
|
||||
AND COLUMN_NAME = 'moddatetime')
|
||||
ALTER TABLE RofstChild ADD moddatetime datetime NULL;
|
||||
go
|
||||
-- Display the status
|
||||
IF (@@Error = 0) PRINT 'Altered table [RofstChild] Succeeded for moddatetime'
|
||||
ELSE PRINT 'Altered table [RofstChild] Error on Alter for moddatetime'
|
||||
go
|
||||
|
||||
/*
|
||||
----------------------------------------------------------------------------------
|
||||
@@ -19695,7 +19705,6 @@ GO
|
||||
@roid VarChar(50),
|
||||
@appid VarChar(Max) = null,
|
||||
@value VarChar(Max) = null,
|
||||
@ModDateTime DateTime = null,
|
||||
@missingDefaultValue VarChar(Max) = null
|
||||
)
|
||||
With Execute as Owner
|
||||
@@ -19713,8 +19722,8 @@ GO
|
||||
Set @missingDefaultValue = '[TBD]';
|
||||
|
||||
-- Create Rofst Child/Group Record --> [Roid = (12) Digits]
|
||||
Insert Into RofstChild (RofstID, ID, ParentID, dbiID, [type], title, roid, appid, moddatetime, [value])
|
||||
Values (@RofstID, @ID, @ParentID, @dbiID, @type, @title, @roid, @appid, @ModDateTime, REPLACE(REPLACE(@value, '&123;', '{'), '&125;', '}'));
|
||||
Insert Into RofstChild (RofstID, ID, ParentID, dbiID, [type], title, roid, appid, [value])
|
||||
Values (@RofstID, @ID, @ParentID, @dbiID, @type, @title, @roid, @appid, REPLACE(REPLACE(@value, '&123;', '{'), '&125;', '}'));
|
||||
|
||||
|
||||
-- Check for appid, if exists, then insert the default value for each return type if multi-value
|
||||
@@ -24768,146 +24777,6 @@ IF (@@Error = 0) PRINT 'Procedure Creation: [GetMissingDocsByUnit] Succeeded'
|
||||
ELSE PRINT 'Procedure Creation: [GetMissingDocsByUnit] Error on Creation'
|
||||
GO
|
||||
|
||||
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[vefn_ROFST_changes]') AND OBJECTPROPERTY(id,N'IsTableFunction') = 1)
|
||||
DROP FUNCTION [vefn_ROFST_changes];
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
/*
|
||||
==========================================================================================================
|
||||
Author: Matthew Schill
|
||||
Create Date: 03/31/2026
|
||||
Description: Function for ROs that updated in latest RO FST Load
|
||||
==========================================================================================================
|
||||
*/
|
||||
CREATE FUNCTION [dbo].[vefn_ROFST_changes](@OrigFSTID int, @NewFSTid int, @VersionID int)
|
||||
RETURNS @ROIDs TABLE
|
||||
(
|
||||
[roid] varchar(50)
|
||||
)
|
||||
WITH EXECUTE AS OWNER
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
insert into @ROIDs
|
||||
SELECT DISTINCT ISNULL(RofstChild.roid,previous.roid)
|
||||
FROM
|
||||
(SELECT * FROM RofstChild where RofstChild.RofstID = @NewFSTid) RofstChild
|
||||
FULL OUTER JOIN
|
||||
(SELECT * FROM RofstChild previous where previous.RofstID = @OrigFSTID) previous
|
||||
ON previous.dbiID = RofstChild.dbiID AND previous.ID = RofstChild.ID
|
||||
where
|
||||
ISNULL(previous.RofstID,'') != ISNULL(RofstChild.RofstID,'')
|
||||
AND
|
||||
(
|
||||
(RofstChild.RofstID = @NewFSTid OR RofstChild.RofstID IS NULL)
|
||||
AND
|
||||
(previous.RofstID = @OrigFSTID OR previous.RofstID IS NULL)
|
||||
)
|
||||
AND
|
||||
(previous.moddatetime IS NULL
|
||||
OR RofstChild.moddatetime IS NULL
|
||||
OR RofstChild.moddatetime != previous.moddatetime
|
||||
OR RofstChild.title != previous.title
|
||||
OR RofstChild.value != previous.value
|
||||
)
|
||||
|
||||
RETURN
|
||||
END
|
||||
go
|
||||
|
||||
IF (@@Error = 0) PRINT 'TableFunction [vefn_ROFST_changes] Succeeded'
|
||||
ELSE PRINT 'TableFunction [vefn_ROFST_changes] Error on Creation'
|
||||
go
|
||||
|
||||
/****** Object: StoredProcedure [deleteDocVersionPdfsWithNewROs] ******/
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteDocVersionPdfsWithNewROs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [deleteDocVersionPdfsWithNewROs];
|
||||
GO
|
||||
|
||||
/*
|
||||
==========================================================================================================
|
||||
Author: Matthew Schill
|
||||
Create Date: 03/31/2026
|
||||
Description: Delete all PDFs with ROs that will need re-resolved
|
||||
==========================================================================================================
|
||||
*/
|
||||
CREATE PROCEDURE [dbo].[deleteDocVersionPdfsWithNewROs]
|
||||
|
||||
(
|
||||
@VersionID int,
|
||||
@OrigFSTid int,
|
||||
@NewFSTid int
|
||||
)
|
||||
WITH EXECUTE AS OWNER
|
||||
AS
|
||||
BEGIN
|
||||
DELETE [Pdfs]
|
||||
WHERE [DocID] IN
|
||||
(
|
||||
select EE.DocID from vefn_GetVersionItems(cast(@VersionID as varchar(20))) VI
|
||||
Join Entries EE ON EE.ContentID= VI.ContentID
|
||||
Join DRoUsages ON DRoUsages.DocID = EE.DocID
|
||||
Join dbo.vefn_ROFST_changes(@OrigFSTID, @NewFSTid, @VersionID) ROFST_changes on LEFT(DRoUsages.ROID,12) = ROFST_changes.roid
|
||||
)
|
||||
|
||||
RETURN
|
||||
END
|
||||
|
||||
GO
|
||||
|
||||
-- Display the status of Proc creation
|
||||
IF (@@Error = 0) PRINT 'Procedure Creation: deleteDocVersionPdfsWithNewROs Succeeded'
|
||||
ELSE PRINT 'Procedure Creation: deleteDocVersionPdfsWithNewROs Error on Creation'
|
||||
GO
|
||||
|
||||
|
||||
/****** Object: StoredProcedure [getItemsWithNewROs] ******/
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[getItemsWithNewROs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [getItemsWithNewROs];
|
||||
GO
|
||||
|
||||
/*
|
||||
==========================================================================================================
|
||||
Author: Matthew Schill
|
||||
Create Date: 03/31/2026
|
||||
Description: Get Items with New ROs that will need resolved
|
||||
==========================================================================================================
|
||||
*/
|
||||
CREATE PROCEDURE [dbo].[getItemsWithNewROs]
|
||||
|
||||
(
|
||||
@VersionID int,
|
||||
@OrigFSTid int,
|
||||
@NewFSTid int
|
||||
)
|
||||
WITH EXECUTE AS OWNER
|
||||
AS
|
||||
BEGIN
|
||||
select DISTINCT tblItems.ItemID FROM
|
||||
dbo.vefn_ROFST_changes(@OrigFSTID, @NewFSTid, @VersionID) ROFST_changes
|
||||
INNER JOIN RoUsages ON LEFT(RoUsages.ROID,12) = ROFST_changes.roid
|
||||
INNER JOIN tblItems ON RoUsages.ContentID = tblItems.ContentID
|
||||
OUTER APPLY (Select VersionID = dbo.vefn_GetVersionIDByItemID(tblItems.ItemID)) ver
|
||||
INNER JOIN DocVersions DV ON DV.VersionID = ver.VersionID
|
||||
INNER JOIN Associations ON Associations.VersionID = DV.VersionID
|
||||
where ver.VersionID = @VersionID
|
||||
|
||||
RETURN
|
||||
END
|
||||
|
||||
GO
|
||||
|
||||
-- Display the status of Proc creation
|
||||
IF (@@Error = 0) PRINT 'Procedure Creation: getItemsWithNewROs Succeeded'
|
||||
ELSE PRINT 'Procedure Creation: getItemsWithNewROs Error on Creation'
|
||||
GO
|
||||
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
| ADD New Code Before this Block |
|
||||
@@ -24941,8 +24810,8 @@ BEGIN TRY -- Try Block
|
||||
DECLARE @RevDate varchar(255)
|
||||
DECLARE @RevDescription varchar(255)
|
||||
|
||||
set @RevDate = '04/21/2026 7:00 AM'
|
||||
set @RevDescription = 'Store RO Modification date/time'
|
||||
set @RevDate = '03/13/2026 7:00 AM'
|
||||
set @RevDescription = 'Added Get Missing Docs by Unit for Generating Pdf table'
|
||||
|
||||
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
|
||||
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
|
||||
|
||||
@@ -1478,19 +1478,34 @@ namespace VEPROMS
|
||||
{
|
||||
ProcedureConfig pc = procedureInfo.MyConfig as ProcedureConfig;
|
||||
if (pc == null) return;
|
||||
|
||||
pc.SelectedSlave = selectedSlave;
|
||||
pc.Print_Rev = revNumber;
|
||||
//AppRevDate Change
|
||||
pc.Print_RevDate = revDate.ToString("MM/dd/yyyy");
|
||||
pc.Print_ChangeBarDate = dts.ToString("MM/dd/yyyy HH:mm:ss");
|
||||
pc.Print_ChangeBarDate = dts.ToString("MM/dd/yyyy HH:mm:ss"); //this is needed to set the changebar date for an indeividual unit also
|
||||
using (Item itm = Item.Get(procedureInfo.ItemID))
|
||||
{
|
||||
itm.MyContent.Config = pc.ToString();
|
||||
//itm.DTS = dts;
|
||||
itm.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
itm.Save();
|
||||
}
|
||||
|
||||
//C2026-015 set overall change bar date
|
||||
if (selectedSlave > 0)
|
||||
{
|
||||
pc.SelectedSlave = 0;
|
||||
pc.Print_Rev = revNumber;
|
||||
pc.Print_RevDate = revDate.ToString("MM/dd/yyyy");
|
||||
pc.Print_ChangeBarDate = dts.ToString("MM/dd/yyyy HH:mm:ss"); //this is needed to set the changebar date for an indeividual unit also
|
||||
using (Item itm2 = Item.Get(procedureInfo.ItemID))
|
||||
{
|
||||
itm2.MyContent.Config = pc.ToString();
|
||||
itm2.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
itm2.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public class RevType
|
||||
|
||||
@@ -68,8 +68,26 @@ namespace VEPROMS
|
||||
MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");// ("MM/dd/yyyy HH:mm:ss");
|
||||
|
||||
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
|
||||
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({ dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({ VlnSettings.UserID}) on ({DateTime.Now})", DateTime.Now, VlnSettings.UserID, 0);
|
||||
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({VlnSettings.UserID}) on ({DateTime.Now})", DateTime.Now, VlnSettings.UserID, 0);
|
||||
|
||||
//CSM C2026-014 if multi-unit, set for each unit
|
||||
System.Data.DataTable dt = RevisionData.GetRevisionDataByUnit(MyProcInfo.ItemID);
|
||||
if (RevisionData.HasUnits(dt))
|
||||
{
|
||||
//Change the ChangeBarDate for each unit
|
||||
foreach (DataRow r in dt.Rows)
|
||||
{
|
||||
if (!r.IsNull("UnitID"))
|
||||
{
|
||||
MyProcConfig.SelectedSlave = Convert.ToInt32(r["UnitID"]);
|
||||
MyProcConfig.Print_ChangeBarDate = dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss");
|
||||
|
||||
//CSM - C2026-010 - Add Audit Record for Change Bar Audit History
|
||||
ChangeBarAuditHistory.AddAudit(MyProcInfo.ItemID, $"Set ChangeBars set to ({dateTimeInput1.Value.ToString("MM/dd/yyyy HH:mm:ss")}) by ({VlnSettings.UserID}) on ({DateTime.Now}) for (Unit {r["UnitName"]})", DateTime.Now, VlnSettings.UserID, MyProcConfig.SelectedSlave);
|
||||
}
|
||||
}
|
||||
MyProcConfig.SelectedSlave = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,9 +125,12 @@ namespace VEPROMS
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append($" The Procedure Viewer Change Bar Date will be set to ({maxDTS}).");
|
||||
foreach (DataRow r in dt.Rows)
|
||||
{
|
||||
if (!r.IsNull("UnitID"))
|
||||
{
|
||||
sb.Append($"\r\n The Change Bar Date for Unit ({r["UnitName"]}) will be set to ({Convert.ToDateTime(r["DTS"]):MM/dd/yyyy HH:mm:ss}).");
|
||||
}
|
||||
}
|
||||
|
||||
sb.Append("\r\n Any Change Bars for Units not listed above will use the Overall/Procedure Viewer Change Bar Date (as these Units have no approvals).");
|
||||
|
||||
@@ -121,12 +142,14 @@ namespace VEPROMS
|
||||
//Change the ChangeBarDate for each unit
|
||||
foreach (DataRow r in dt.Rows)
|
||||
{
|
||||
if (!r.IsNull("UnitID"))
|
||||
{
|
||||
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;
|
||||
|
||||
@@ -1036,9 +1036,6 @@ namespace VEPROMS
|
||||
ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst;
|
||||
string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst";
|
||||
|
||||
//must get id before ROFST gets updated so know what to refresh later
|
||||
int origfstid = roFstInfo.ROFstID;
|
||||
|
||||
//if (!pathExists(rofstPath))
|
||||
if (!File.Exists(rofstPath))
|
||||
{
|
||||
@@ -1067,7 +1064,7 @@ namespace VEPROMS
|
||||
roFstInfo = dq.DocVersionAssociations[0].MyROFst;
|
||||
}
|
||||
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, txtProcess, roFstInfo, origfstid, roFstInfo.ROFstID);
|
||||
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, txtProcess);
|
||||
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||
}
|
||||
|
||||
|
||||
@@ -1594,7 +1594,7 @@ namespace VEPROMS
|
||||
displayRO.MyROFST = SelectedROFst;
|
||||
// B2023-021: force Load of Step Prop/RO panel RO tree by passing in
|
||||
// true to LoadTree
|
||||
if (!_WeAreExitingPROMS) displayRO.LoadTree(true);
|
||||
displayRO.LoadTree(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2395,7 +2395,6 @@ namespace VEPROMS
|
||||
tv.MySessionInfo = MySessionInfo;
|
||||
tv.MyUserInfo = MyUserInfo;
|
||||
StepTabRibbon.MySessionInfo = MySessionInfo;
|
||||
displayRO.MySessionInfo = MySessionInfo;
|
||||
|
||||
// Initialize Caption with Server name and Database name.
|
||||
SetCaption(tv.TopNode as VETreeNode);
|
||||
@@ -4554,15 +4553,6 @@ namespace VEPROMS
|
||||
SetCaption(tv.SelectedNode as VETreeNode);
|
||||
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
// DisplayTab was changed
|
||||
// need to clear the RTB selected
|
||||
// without resetting the DVI or FST
|
||||
// (those will be set manually / individually)
|
||||
// this will prevent DVI and FST from changing to null then back again
|
||||
// which will trigger reloads
|
||||
displayRO.ClearRTB();
|
||||
|
||||
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
|
||||
{
|
||||
displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||
@@ -4572,24 +4562,9 @@ namespace VEPROMS
|
||||
displayRO.MyROFST = null;
|
||||
}
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
// set the DocVersionInfo so that the FST and docversion are in sync
|
||||
SelectedDVI = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion;
|
||||
if (displayRO.MyDvi != SelectedDVI)
|
||||
{
|
||||
displayRO.MyDvi = SelectedDVI;
|
||||
}
|
||||
Application.DoEvents();
|
||||
|
||||
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
||||
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures. (Added True for the forceLoad parameter)
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
// if ROFST got updated,
|
||||
// set the Selected FST so it is in sync
|
||||
if (!_WeAreExitingPROMS && displayRO.LoadTree(true))
|
||||
{
|
||||
SelectedROFst = displayRO.MyROFST;
|
||||
}
|
||||
displayRO.LoadTree(true);
|
||||
|
||||
lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole;
|
||||
|
||||
@@ -4790,13 +4765,7 @@ namespace VEPROMS
|
||||
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
||||
displayRO.ProgressBar = bottomProgBar;
|
||||
displayRO.MyRTB = args.MyEditItem.MyStepRTB;
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
// if ROFST got updated,
|
||||
// set the Selected FST so it is in sync
|
||||
if (!_WeAreExitingPROMS && displayRO.LoadTree())
|
||||
{
|
||||
SelectedROFst = displayRO.MyROFST;
|
||||
}
|
||||
displayRO.LoadTree();
|
||||
|
||||
displayBookMarks.MyEditItem = args.MyEditItem;
|
||||
displayHistory.MyEditItem = args.MyEditItem;
|
||||
@@ -4826,7 +4795,7 @@ namespace VEPROMS
|
||||
|
||||
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
||||
displayRO.SetFindDocROButton(false);
|
||||
if (!_WeAreExitingPROMS) displayRO.LoadTree();
|
||||
displayRO.LoadTree();
|
||||
|
||||
//C2019-036 View Only mode work with Checked Out Procedures
|
||||
//In View Only Mode - Step Properties should be disabled
|
||||
@@ -4960,13 +4929,7 @@ namespace VEPROMS
|
||||
displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo;
|
||||
|
||||
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
// if ROFST got updated,
|
||||
// set the Selected FST so it is in sync
|
||||
if (displayRO.LoadTree())
|
||||
{
|
||||
SelectedROFst = displayRO.MyROFST;
|
||||
}
|
||||
displayRO.LoadTree();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1527,9 +1527,6 @@ namespace VEPROMS
|
||||
|
||||
Cursor = Cursors.WaitCursor;
|
||||
|
||||
//must get id before ROFST gets updated so know what to refresh later
|
||||
int origfstid = SelectedROFst.ROFstID;
|
||||
|
||||
// RO changes placed in file in the Documents\VEPROMS folder
|
||||
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(_DocVersionConfig.MyDocVersion.MyDocVersionInfo));
|
||||
DocVersion dv = _DocVersionConfig.MyDocVersion;
|
||||
@@ -1543,7 +1540,7 @@ namespace VEPROMS
|
||||
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
|
||||
SelectedROFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||
|
||||
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, null, SelectedROFst, origfstid, SelectedROFst.ROFstID);
|
||||
ROFst newrofst = ROFstInfo.RefreshROFst(_DocVersionConfig.MyDocVersion, SelectedROFst, DoProgressBarRefresh, null);
|
||||
|
||||
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
|
||||
SelectedROFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||
|
||||
@@ -97,7 +97,6 @@ namespace VEPROMS.CSLA.Library
|
||||
public string appid;
|
||||
public int ID;
|
||||
public int ParentID;
|
||||
public DateTime? ModDateTime; //C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
public rochild[] children;
|
||||
};
|
||||
|
||||
@@ -111,7 +110,6 @@ namespace VEPROMS.CSLA.Library
|
||||
public string roid; // roid unique identifier
|
||||
public string appid; // accessory page id - user specified unique id
|
||||
public string value; // return value, can be multiple values
|
||||
public DateTime? ModDateTime; //C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
public rochild[] children;
|
||||
};
|
||||
|
||||
@@ -688,10 +686,6 @@ namespace VEPROMS.CSLA.Library
|
||||
//return string.Format("{0,10:#####0.00}", TimeSpan.FromTicks(DateTime.Now.Ticks - dtStart.Ticks).TotalSeconds);
|
||||
}
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
//return new ROFstID if there is a newer ID that matches the same ROFSTDB
|
||||
public int GetNewerFSTID() => RofstGetLatestID(RofstID);
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
@@ -894,7 +888,7 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
|
||||
private void RofstChildInsert(int rofstID, int id, int parentID, int dbiID, int type, string title, string roid, string appid, string value, DateTime? dt = null)
|
||||
private void RofstChildInsert(int rofstID, int id, int parentID, int dbiID, int type, string title, string roid, string appid, string value)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -923,9 +917,6 @@ namespace VEPROMS.CSLA.Library
|
||||
if (!string.IsNullOrEmpty(this.RoMissingDefaultValue))
|
||||
cmd.Parameters.Add(new SqlParameter("@missingDefaultValue", SqlDbType.VarChar)).Value = this.RoMissingDefaultValue;
|
||||
|
||||
if (dt != null)
|
||||
cmd.Parameters.Add(new SqlParameter("@ModDateTime", SqlDbType.DateTime)).Value = dt;
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
@@ -1308,32 +1299,6 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
//return new ROFstID if there is a newer ID that matches the same ROFSTDB
|
||||
private int RofstGetLatestID(int rofstID)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cmd = cn.CreateCommand())
|
||||
{
|
||||
cmd.CommandTimeout = 0;
|
||||
cmd.CommandType = CommandType.Text;
|
||||
cmd.CommandText = "SELECT ISNULL((SELECT TOP 1 ROFsts.ROFstID FROM ROFsts INNER JOIN ROFsts curFST ON curFST.RODbID = ROFsts.RODbID WHERE curFST.ROFstID = @FSTid order by ROFsts.DTS desc),-1)";
|
||||
|
||||
cmd.Parameters.Add(new SqlParameter("@FSTid", SqlDbType.Int)).Value = rofstID;
|
||||
|
||||
return (int) cmd.ExecuteScalar();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("RofstData.RofstGetLatestID", ex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region (Core/Base logic for RO Values & UnitInfo RO Values)
|
||||
@@ -1558,10 +1523,6 @@ namespace VEPROMS.CSLA.Library
|
||||
tmp.appid = tmpg.appid;
|
||||
tmp.roid = tableID.ToString("X4") + tmp.ID.ToString("X8");
|
||||
tmp.children = tmpg.children;
|
||||
if (tmpg.ModDateTime != null)
|
||||
{
|
||||
tmp.ModDateTime = tmpg.ModDateTime;
|
||||
}
|
||||
|
||||
int j;
|
||||
|
||||
@@ -1581,12 +1542,6 @@ namespace VEPROMS.CSLA.Library
|
||||
int slen2 = StringLength(ab, offset + 13 + slen);
|
||||
myGrp.appid = Encoding.Default.GetString(ab, offset + 13 + slen, slen2);
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
if (myGrp.value != "" && DateTime.TryParseExact(Encoding.Default.GetString(ab, offset + 14 + slen + slen2, 14), "yyyyMMddHHmmss", null, System.Globalization.DateTimeStyles.None, out DateTime dt))
|
||||
{
|
||||
myGrp.ModDateTime = dt;
|
||||
}
|
||||
|
||||
_dbRoCnt++;
|
||||
}
|
||||
|
||||
@@ -1700,7 +1655,7 @@ namespace VEPROMS.CSLA.Library
|
||||
private void LoadChild(int rofstID, int dbiID, ROFSTLookup.rochild child)
|
||||
{
|
||||
//Insert Rofst Child
|
||||
RofstChildInsert(rofstID, child.ID, child.ParentID, dbiID, child.type, child.title, child.roid, child.appid, child.value, child.ModDateTime);
|
||||
RofstChildInsert(rofstID, child.ID, child.ParentID, dbiID, child.type, child.title, child.roid, child.appid, child.value);
|
||||
|
||||
//Increment RO Count if RoChild has a return value
|
||||
if (!string.IsNullOrEmpty(child.value)) _curRoCnt++;
|
||||
|
||||
@@ -1093,15 +1093,6 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
//Refresh at item level
|
||||
public static void RefreshReferenceObjects(ItemInfo tmp, ROFstInfo origROFst)
|
||||
{
|
||||
if (tmp.MyDocVersion.DocVersionConfig.SelectedSlave <= 0)
|
||||
MyRefreshReferenceObjects(tmp, null, tmp.GetSectionInfo(), tmp.MyDocVersion, origROFst);
|
||||
}
|
||||
|
||||
// B2022-026 RO Memory Reduction code - pass in ROFstInfo
|
||||
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, ROFstInfo origROFst)
|
||||
{
|
||||
@@ -1228,22 +1219,6 @@ namespace VEPROMS.CSLA.Library
|
||||
return true;
|
||||
}
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
public static List<ItemInfo> GetItemInfoWithChangedROs(int docversionid, int origfstid, int newfstid)
|
||||
{
|
||||
List<ItemInfo> lst = new List<ItemInfo>();
|
||||
|
||||
foreach (DataRow r in Data_GetItemsWithChangedROs(docversionid, origfstid, newfstid).Rows)
|
||||
{
|
||||
using (ItemInfo itm = Get((int)r["ItemID"]))
|
||||
{
|
||||
lst.Add(itm);
|
||||
}
|
||||
}
|
||||
|
||||
return lst;
|
||||
}
|
||||
|
||||
#region Debug Code
|
||||
|
||||
//private static void ShowDifference(string oldText, string newText)
|
||||
@@ -1915,40 +1890,6 @@ namespace VEPROMS.CSLA.Library
|
||||
foreach (ItemInfo itemInfo in partInfo.MyItems)
|
||||
itemInfo.SpinThroughChildren();
|
||||
}
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
private static DataTable Data_GetItemsWithChangedROs(int docversionid, int origfstid, int newfstid)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandText = "getItemsWithNewROs";
|
||||
cm.Parameters.AddWithValue("@VersionID", docversionid);
|
||||
cm.Parameters.AddWithValue("@OrigFSTid", origfstid);
|
||||
cm.Parameters.AddWithValue("@NewFSTid", newfstid);
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
|
||||
using (SqlDataAdapter da = new SqlDataAdapter(cm))
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
da.Fill(dt);
|
||||
return dt;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Database.LogException("ItemInfoList.Data_GetItemsWithChangedROs", ex);
|
||||
throw new DbCslaException("ItemInfoList.Data_GetItemsWithChangedROs", ex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region LoadAtOnce
|
||||
// Method to Get Item and children
|
||||
@@ -4113,7 +4054,7 @@ namespace VEPROMS.CSLA.Library
|
||||
// date). Print_ViewableAfterChangeBarDate was created to get only that user specified date, if it exists. If it does exist, we compare
|
||||
// that with the Content datetime, otherwise we proceed as before.
|
||||
DateTime? viewableStartingDateTime = (MyProcedure.MyConfig as ProcedureConfig).Print_ViewableStartingChangeBarDate;
|
||||
if (viewableStartingDateTime != null && viewableStartingDateTime > MyProcedure.ChangeBarDate)
|
||||
if (viewableStartingDateTime != null && viewableStartingDateTime > MyProcedure.ChangeBarDate && (MyProcedure.MyConfig as ProcedureConfig).SelectedSlave == 0)
|
||||
return (MyContent.DTS > viewableStartingDateTime);
|
||||
return (MyContent.DTS > MyProcedure.ChangeBarDate);
|
||||
}
|
||||
|
||||
@@ -61,25 +61,35 @@ namespace VEPROMS.CSLA.Library
|
||||
throw new DbCslaException("Pdf.DataPortal_Delete", ex);
|
||||
}
|
||||
}
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
// used to remove word section PDFs to force ROs to be updated when printed or saved
|
||||
public static void DeleteDocVersionPDFsWithNewROs(int versionID, int origfstid, int newfstid)
|
||||
public static void DeleteAllDocVersion(int versionID)
|
||||
{
|
||||
if (!CanDeleteObject())
|
||||
throw new System.Security.SecurityException("User not authorized to remove a Pdf");
|
||||
try
|
||||
{
|
||||
DeleteWithNewROs(versionID, origfstid, newfstid);
|
||||
DataPortal.Delete(new VersionIDCriteria(versionID));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new DbCslaException("Error on Pdf.DeleteAllDocVersion", ex);
|
||||
}
|
||||
}
|
||||
|
||||
static private void DeleteWithNewROs(int docversionID, int origfstid, int newfstid)
|
||||
[Serializable()]
|
||||
protected class VersionIDCriteria
|
||||
{
|
||||
private int _VersionID;
|
||||
public int VersionID
|
||||
{ get { return _VersionID; } }
|
||||
public VersionIDCriteria(int versionID)
|
||||
{
|
||||
_VersionID = versionID;
|
||||
}
|
||||
}
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
private void DataPortal_Delete(VersionIDCriteria criteria)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Pdf.DataPortal_Delete", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
@@ -88,20 +98,20 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandTimeout = Database.SQLTimeout;
|
||||
cm.CommandText = "deleteDocVersionPdfsWithNewROs";
|
||||
cm.Parameters.AddWithValue("@VersionID", docversionID);
|
||||
cm.Parameters.AddWithValue("@OrigFSTid", origfstid);
|
||||
cm.Parameters.AddWithValue("@NewFSTid", newfstid);
|
||||
cm.CommandText = "deleteAllDocVersionPdfs";
|
||||
cm.Parameters.AddWithValue("@VersionID", criteria.VersionID);
|
||||
cm.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Pdf.DeleteWithNewROs", ex);
|
||||
throw new DbCslaException("Pdf.DeleteWithNewROs", ex);
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Pdf.DataPortal_Delete", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Pdf.DataPortal_Delete", ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public partial class PdfInfo
|
||||
{
|
||||
|
||||
@@ -225,51 +225,38 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
// Refresh at item level
|
||||
public static int RefreshROFstAtItemLevel(DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus, ROFstInfo localROFst, int origfstid, int newfstid)
|
||||
// B2022-026 RO Memory Reduction code - pass in the ROFstInfo
|
||||
public static int RefreshROFst(DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus, ROFstInfo origROFst)
|
||||
{
|
||||
int fixedROs = 0;
|
||||
|
||||
if (dvi.DocVersionConfig.SelectedSlave <= 0)
|
||||
{
|
||||
// remove word section PDFs to force update of RO values when printed
|
||||
myProgressBarRefresh(1, 100, "Updating MS Word ROs In Progress");
|
||||
Pdf.DeleteDocVersionPDFsWithNewROs(dvi.VersionID, origfstid, newfstid);
|
||||
myProgressBarRefresh(1, 100, "Update MS Word ROs");
|
||||
|
||||
//Loop Through ROs in this docversion that are different than the previous fst
|
||||
myProgressBarRefresh(50, 100, "Updating ROs In PROMS Steps In Progress");
|
||||
Pdf.DeleteAllDocVersion(dvi.VersionID); // remove word section PDFs to force update of RO values when printed
|
||||
int i = 0;
|
||||
List<ItemInfo> list = ItemInfo.GetItemInfoWithChangedROs(dvi.VersionID, origfstid, newfstid);
|
||||
foreach (ItemInfo itm in list)
|
||||
|
||||
foreach (ProcedureInfo proc in dvi.Procedures)
|
||||
{
|
||||
DateTime start = DateTime.Now;
|
||||
|
||||
ItemInfo.ResetROCounters();
|
||||
myProgressBarRefresh(++i, list.Count, string.Format("{0} ({1}/{2} ROs {3})", itm.MyProcedure.DisplayNumber, i, list.Count, fixedROs));
|
||||
ItemInfo.RefreshReferenceObjects(itm, localROFst);
|
||||
fixedROs += ItemInfo.ROFixCount;
|
||||
ProcedureInfo.ResetROCounters();
|
||||
myProgressBarRefresh(++i, dvi.Procedures.Count, string.Format("{0} ({1}/{2} ROs {3})", proc.DisplayNumber, i, dvi.Procedures.Count, fixedROs));
|
||||
ProcedureInfo.RefreshReferenceObjects(proc, origROFst);
|
||||
fixedROs += ProcedureInfo.ROFixCount;
|
||||
|
||||
TimeSpan ts = DateTime.Now - start;
|
||||
|
||||
if (tbStatus != null)
|
||||
tbStatus.AppendText(string.Format("Procedure: {1}{0}, Checked {2} Referenced Objects{0}, Fixed {3} Referenced Objects{0}, Elapsed Seconds:{4}{0}{0}", Environment.NewLine, itm.MyProcedure.DisplayNumber, ItemInfo.ROCheckCount, ItemInfo.ROFixCount, ts.TotalSeconds));
|
||||
}
|
||||
|
||||
//Update the DocVersion Associations to link to the new RO FST id and current date/time
|
||||
using (DocVersion dv = DocVersion.Get(dvi.VersionID))
|
||||
{
|
||||
if (dvi.DocVersionAssociations[0].MyROFst.ROFstID != newfstid)
|
||||
{
|
||||
dv.DocVersionAssociations[0].MyROFst = localROFst.GetJustROFst();
|
||||
SetAssociationLastCompleted(dv, DateTime.Now.ToString());
|
||||
}
|
||||
tbStatus.AppendText(string.Format("Procedure: {1}{0}, Checked {2} Referenced Objects{0}, Fixed {3} Referenced Objects{0}, Elapsed Seconds:{4}{0}{0}", Environment.NewLine, proc.DisplayNumber, ProcedureInfo.ROCheckCount, ProcedureInfo.ROFixCount, ts.TotalSeconds));
|
||||
}
|
||||
}
|
||||
|
||||
return fixedROs;
|
||||
}
|
||||
|
||||
|
||||
//C2022-028 for Admin tool to check for bad RO links
|
||||
//B2022-144 we now loop through checked procedures list from Admin Tools and call this method for each procedure we want to process
|
||||
public static int CheckROLinksInThisProcedure(ProcedureInfo proc, System.Windows.Forms.TextBox tbStatus)
|
||||
@@ -304,6 +291,34 @@ namespace VEPROMS.CSLA.Library
|
||||
return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\ROUpdateReport_" + ValidFileName.FixFileName(dvi.MyFolder.Name.Replace(" ", "_") + "_" + DateTime.Now.ToString("MM-dd-yyyy_HH-mm-ss") + ".txt");
|
||||
}
|
||||
|
||||
// B2022-026 RO Memory Reduction code - moved the call to UpdateROFst() to before we call RefreshROFst
|
||||
// so that we used the correct ROFstInfo which as the needed event methods set when updated RO Table types
|
||||
public static ROFst RefreshROFst(DocVersion docver, ROFstInfo origROFst, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus)
|
||||
{
|
||||
ROFst rofst = null;
|
||||
|
||||
rofst = docver.DocVersionAssociations[0].MyROFst;
|
||||
|
||||
DocVersionInfo dvi = DocVersionInfo.Get(docver.VersionID);
|
||||
|
||||
SetAssociationLastCompleted(docver, string.Empty);
|
||||
int fixedROs = RefreshROFst(dvi, myProgressBarRefresh, tbStatus, origROFst);
|
||||
SetAssociationLastCompleted(docver, DateTime.Now.ToString()); // RO Update completed successfully and un-interrupted, save the date/time to the Doc Version Association config
|
||||
|
||||
myProgressBarRefresh(100, 100, "RO Update Complete"); // update the progress bar
|
||||
System.Windows.Forms.Application.DoEvents();
|
||||
|
||||
// pop up a message window telling the user the RO Update has completed and how many ROs were updated
|
||||
// If we are updating RO from the Admin Tools (from the V button) and we are updating more than on procedure set, then just append the "RO Update Complete" text
|
||||
// To the MessageList. Once completed will all procedure sets, Admin Tools will display one message box with all the results in it.
|
||||
if (MessageList == null)
|
||||
FlexibleMessageBox.Show(fixedROs == 0 ? "No ROs Required Updating" : string.Format("{0} ROs Updated for {1}", fixedROs, dvi.MyFolder.Name), "RO Update Complete");
|
||||
else
|
||||
MessageList.AppendLine((fixedROs == 0 ? "No ROs Required Updating for " : string.Format("{0} ROs Updated for ", fixedROs)) + dvi.MyFolder.Name);
|
||||
|
||||
return rofst;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates an ro.fst into a sql database.
|
||||
/// </summary>
|
||||
@@ -655,6 +670,187 @@ namespace VEPROMS.CSLA.Library
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static void UpdateROValuesText(ROFstInfo origROFstInfo, ROFst newROFst, DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, List<string> MyChangedFigureROIDs)
|
||||
{
|
||||
if (myProgressBarRefresh != null) myProgressBarRefresh(0, 100, "Update Ro Values");
|
||||
|
||||
string versionList = dvi.VersionID.ToString();
|
||||
|
||||
ROFSTLookup origLookup = new ROFSTLookup(origROFstInfo.ROFstID, dvi);
|
||||
ROFSTLookup newLookup = new ROFSTLookup(newROFst.ROFstID, dvi);
|
||||
|
||||
List<string> delList = new List<string>();
|
||||
List<string> chgList = newLookup.GetValueDifferences(origROFstInfo.ROFstID, ref delList);
|
||||
|
||||
// Any figures which have been changed will be included in the list of values that have changed.
|
||||
if (MyChangedFigureROIDs != null)
|
||||
{
|
||||
foreach (string roid in MyChangedFigureROIDs)
|
||||
{
|
||||
if (!chgList.Contains(roid)) chgList.Add(roid);
|
||||
}
|
||||
}
|
||||
|
||||
string RoidList = GetRoidList(newROFst.RODbID, chgList);
|
||||
|
||||
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Getting List of ROs Used");
|
||||
List<string> activeRoids = BuildActiveROIDsForRoUsages12(RoidList, versionList);
|
||||
|
||||
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Updating RO Values");
|
||||
int iCount = 0;
|
||||
|
||||
if (activeRoids.Count > 0)
|
||||
{
|
||||
foreach (string chg in chgList)
|
||||
{
|
||||
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Updating RO Values");
|
||||
if (activeRoids.Contains(chg.Substring(0, 12)))
|
||||
{
|
||||
ROFSTLookup.rochild roch = newLookup.GetRoChild(chg);
|
||||
string desc = string.Format("Change in RO Values: Old value = {0}, New value = {1}", origLookup.GetRoChild(chg).value, roch.value);
|
||||
|
||||
// roid's are stored in database as 16 characters long in the RoUsages table. They may be stored as 12 characters in the ro.fst.
|
||||
// string padroid = chg.Length <= 12 ? chg + "0000" : chg;
|
||||
// B2022-088: Find Doc Ro button not working in Word Sections
|
||||
string padroid = ROFSTLookup.FormatRoidKey(chg, true);
|
||||
|
||||
using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid, desc, "Changed", versionList))
|
||||
{
|
||||
foreach (RoUsageInfo roUsg in affected)
|
||||
{
|
||||
using (Content content = Content.Get(roUsg.MyContent.ContentID))
|
||||
{
|
||||
foreach (ItemInfo ii in roUsg.MyContent.ContentItems)
|
||||
{
|
||||
string val = newLookup.GetTranslatedRoValue(padroid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, ii.ActiveFormat.PlantFormat.FormatData.SectData.UseTildaPoundCharsForSuperSubScriptInROValues, false, ii);
|
||||
content.FixContentText(roUsg, val, roch.type, origROFstInfo, true);
|
||||
|
||||
if (content.IsDirty)
|
||||
{
|
||||
// Update UserID and DTS when RO Value is updated.
|
||||
content.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
content.DTS = DateTime.Now;
|
||||
content.Save();
|
||||
|
||||
if (content.MyGrid != null)
|
||||
{
|
||||
GridInfo.Refresh(content.MyGrid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Getting List of ROs Used");
|
||||
List<string> activeDRoids = BuildActiveROIDsForDRoUsages12(RoidList, versionList);
|
||||
iCount = 0;
|
||||
|
||||
if (activeDRoids.Count > 0)
|
||||
{
|
||||
foreach (string chg in chgList)
|
||||
{
|
||||
// B2022-088: Find Doc Ro button not working in Word Sections
|
||||
// string padroid = chg.Length <= 12 ? chg + "0000" : chg;
|
||||
string padroid = ROFSTLookup.FormatRoidKey(chg, true);
|
||||
|
||||
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Updating RO Values");
|
||||
|
||||
if (activeDRoids.Contains(chg.Substring(0, 12)))
|
||||
{
|
||||
ROFSTLookup.rochild roch = newLookup.GetRoChild(chg);
|
||||
|
||||
string desc = string.Format("Change in RO Values: Old value = {0}, New value = {1}", origLookup.GetRoChild(chg).value, roch.value);
|
||||
|
||||
// roid's are stored in database as 16 characters long in the rousages table. They may be stored as 12 characters in the ro.fst.
|
||||
using (DROUsageInfoList affected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid, desc, "Changed", versionList))
|
||||
{
|
||||
foreach (DROUsageInfo droUsg in affected)
|
||||
{
|
||||
Pdf.DeleteAll(droUsg.DocID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
iCount = 0;
|
||||
string RoidDelList = GetRoidList(newROFst.RODbID, delList);
|
||||
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Getting List of ROs Used");
|
||||
activeRoids = BuildActiveROIDsForRoUsages12(RoidDelList, versionList);
|
||||
|
||||
if (activeRoids.Count > 0)
|
||||
{
|
||||
foreach (string del in delList)
|
||||
{
|
||||
// B2022-088: Find Doc Ro button not working in Word Sections
|
||||
//string padroiddel = del.Length <= 12 ? del + "0000" : del;
|
||||
string padroiddel = ROFSTLookup.FormatRoidKey(del, true);
|
||||
|
||||
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values");
|
||||
string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoChild(del).value);
|
||||
|
||||
if (activeRoids.Contains(del.Substring(0, 12).ToUpper()))
|
||||
{
|
||||
using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroiddel, desc, "Deleted", versionList))
|
||||
{
|
||||
foreach (RoUsageInfo roUsg in affected)
|
||||
{
|
||||
using (Content content = Content.Get(roUsg.MyContent.ContentID))
|
||||
{
|
||||
content.FixContentText(roUsg, "?", 0, origROFstInfo);
|
||||
if (content.IsDirty)
|
||||
{
|
||||
// Update UserID and DTS when RO Value is updated.
|
||||
content.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
content.DTS = DateTime.Now;
|
||||
content.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (myProgressBarRefresh != null) myProgressBarRefresh(0, chgList.Count, "Getting List of ROs Used");
|
||||
activeDRoids = BuildActiveROIDsForDRoUsages12(RoidDelList, versionList);
|
||||
iCount = 0;
|
||||
|
||||
if (activeDRoids.Count > 0)
|
||||
{
|
||||
foreach (string del in delList)
|
||||
{
|
||||
|
||||
// B2022-088: Find Doc Ro button not working in Word Sections
|
||||
string padroiddel = ROFSTLookup.FormatRoidKey(del, true);
|
||||
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values");
|
||||
|
||||
string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoChild(del).value);
|
||||
|
||||
// If there's an issue then maybe try getting the RoChild with the Padded roid instead
|
||||
//string desc = string.Format("Deleted RO: Value = {0}", origLookup.GetRoChild(padroiddel).value);
|
||||
|
||||
if (activeDRoids.Contains(del.Substring(0, 12).ToUpper()))
|
||||
{
|
||||
using (DROUsageInfoList Daffected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroiddel, desc, "Deleted", versionList))
|
||||
{
|
||||
foreach (DROUsageInfo droUsg in Daffected)
|
||||
{
|
||||
if (myProgressBarRefresh != null) myProgressBarRefresh(++iCount, chgList.Count, "Removing Old RO Values");
|
||||
Pdf.DeleteAll(droUsg.DocID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (myProgressBarRefresh != null) myProgressBarRefresh(100, 100, "RO Values Updated");
|
||||
}
|
||||
|
||||
private static DateTime ShowDuration(DateTime dtLast, string message)
|
||||
{
|
||||
DateTime dtNext = DateTime.Now;
|
||||
|
||||
@@ -23,7 +23,6 @@ namespace Volian.Controls.Library
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
@@ -34,7 +33,6 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
this.gpMode = new DevComponents.DotNetBar.Controls.GroupPanel();
|
||||
this.gpItem = new DevComponents.DotNetBar.Controls.GroupPanel();
|
||||
this.btnApplicabilitychg2 = new DevComponents.DotNetBar.ButtonItem();
|
||||
this.btnApplicabilitychg = new DevComponents.DotNetBar.ButtonX();
|
||||
this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip();
|
||||
this.gpItem.SuspendLayout();
|
||||
@@ -42,14 +40,14 @@ namespace Volian.Controls.Library
|
||||
//
|
||||
// btnApplicabilitychg
|
||||
//
|
||||
this.btnApplicabilitychg.Location = new System.Drawing.Point(60, 8);
|
||||
this.btnApplicabilitychg.Location = new System.Drawing.Point(90, 8);
|
||||
this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.btnApplicabilitychg.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.btnApplicabilitychg.Name = "btnApplicabilitychg";
|
||||
this.btnApplicabilitychg.Size = new System.Drawing.Size(80, 22);
|
||||
this.btnApplicabilitychg.Size = new System.Drawing.Size(87, 22);
|
||||
this.btnApplicabilitychg.Margin = new System.Windows.Forms.Padding(2);
|
||||
this.btnApplicabilitychg.RightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Change applicability settings - All At Level", "", "When clicked, all steps at the level of the current step will have their applicability settings changed. Note that for two column procedures, the left column and right column are handled separately.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray));
|
||||
this.superTooltip1.SetSuperTooltip(this.btnApplicabilitychg, new DevComponents.DotNetBar.SuperTooltipInfo("Set All at Level", "", "When clicked, all steps at that level of the current step will be set to the selected applicability. Note that the Set All at Level button is disabled for RNO step types unless they are substeps off of a RNO step.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); // C2026-034 fix tool tip text.
|
||||
this.btnApplicabilitychg.TabIndex = 0;
|
||||
this.btnApplicabilitychg.Text = "Set All at Level";
|
||||
this.btnApplicabilitychg.ColorTable = DevComponents.DotNetBar.eButtonColor.BlueOrb;
|
||||
@@ -106,13 +104,12 @@ namespace Volian.Controls.Library
|
||||
this.gpItem.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.gpItem.CanvasColor = System.Drawing.SystemColors.Control;
|
||||
this.gpItem.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
|
||||
//this.gpItem.Controls.Add(this.btnApplicabilitychg);
|
||||
this.gpItem.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.gpItem.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.gpItem.Location = new System.Drawing.Point(0, 49);
|
||||
this.gpItem.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.gpItem.Name = "gpItem";
|
||||
this.gpItem.Padding = new System.Windows.Forms.Padding(13, 12, 13, 37);
|
||||
this.gpItem.Padding = new System.Windows.Forms.Padding(0, 20, 0, 0);
|
||||
this.gpItem.Size = new System.Drawing.Size(432, 85);
|
||||
//
|
||||
//
|
||||
@@ -169,9 +166,9 @@ namespace Volian.Controls.Library
|
||||
|
||||
private DevComponents.DotNetBar.Controls.GroupPanel gpMode;
|
||||
private DevComponents.DotNetBar.Controls.GroupPanel gpItem;
|
||||
private DevComponents.DotNetBar.ButtonItem btnApplicabilitychg2;
|
||||
private DevComponents.DotNetBar.ButtonX btnApplicabilitychg;
|
||||
private DevComponents.DotNetBar.SuperTooltip superTooltip1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace Volian.Controls.Library
|
||||
if (ApplicabilityViewModeChanged != null)
|
||||
ApplicabilityViewModeChanged(this, new EventArgs());
|
||||
}
|
||||
|
||||
private DisplayTabItem _MyDisplayTabItem = null;
|
||||
public DisplayTabItem MyDisplayTabItem
|
||||
{
|
||||
@@ -34,6 +35,9 @@ namespace Volian.Controls.Library
|
||||
MyCheckBoxes.Clear();
|
||||
if (_MyDisplayTabItem != null)
|
||||
{
|
||||
//B2026-043 Fix "Set All At Level" button.
|
||||
DevComponents.DotNetBar.Controls.GroupPanel gpSubItem = InitializegpSubItem();
|
||||
|
||||
DocVersionConfig dcfg = _MyDisplayTabItem.MyItemInfo.MyDocVersion.MyConfig as DocVersionConfig;
|
||||
List<string> names = new List<string>();
|
||||
for (int n = 1; n <= dcfg.Unit_Count; n++)
|
||||
@@ -42,7 +46,7 @@ namespace Volian.Controls.Library
|
||||
names.Add(dcfg.Unit_Name);
|
||||
}
|
||||
dcfg.SelectedSlave = 0;
|
||||
// string[] names = dcfg.Unit_Name.Split(',');
|
||||
// string[] names = dcfg.Unit_Name.Split(',');
|
||||
int apple = -1;
|
||||
if(_MyDisplayTabItem.MyStepTabPanel != null)
|
||||
apple = _MyDisplayTabItem.MyStepTabPanel.MyStepPanel.ApplDisplayMode;
|
||||
@@ -54,11 +58,13 @@ namespace Volian.Controls.Library
|
||||
AddViewMode(name.Trim(), i.ToString(), apple == i);
|
||||
}
|
||||
|
||||
AddItemMode("All", "-1");
|
||||
AddItemMode("All", "-1", ref gpSubItem);
|
||||
i = 0;
|
||||
foreach (string name in names)
|
||||
AddItemMode(name.Trim(), (++i).ToString());
|
||||
AddItemMode("None", "0");
|
||||
AddItemMode(name.Trim(), (++i).ToString(), ref gpSubItem);
|
||||
AddItemMode("None", "0", ref gpSubItem);
|
||||
gpItem.Controls.Add(gpSubItem);
|
||||
gpSubItem.BringToFront();
|
||||
gpItem.Controls.Add(btnApplicabilitychg);
|
||||
btnApplicabilitychg.BringToFront();
|
||||
if (_MyDisplayTabItem.MyStepTabPanel != null)
|
||||
@@ -85,6 +91,37 @@ namespace Volian.Controls.Library
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
private DevComponents.DotNetBar.Controls.GroupPanel InitializegpSubItem() //B2026-043 Fix "Set All At Level" button.
|
||||
{
|
||||
DevComponents.DotNetBar.Controls.GroupPanel gpSubItem;
|
||||
gpSubItem = new DevComponents.DotNetBar.Controls.GroupPanel
|
||||
{
|
||||
//
|
||||
// gpSubItem
|
||||
//
|
||||
AutoSize = true,
|
||||
AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink,
|
||||
CanvasColor = System.Drawing.SystemColors.Control,
|
||||
ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007,
|
||||
DisabledBackColor = System.Drawing.Color.Empty,
|
||||
Dock = System.Windows.Forms.DockStyle.Top,
|
||||
Location = new System.Drawing.Point(0, 49),
|
||||
Margin = new System.Windows.Forms.Padding(4),
|
||||
Name = "gpSubItem",
|
||||
Padding = new System.Windows.Forms.Padding(13, 12, 13, 37)
|
||||
};
|
||||
gpSubItem.BackColor = Color.Transparent;
|
||||
gpSubItem.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;
|
||||
gpSubItem.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
|
||||
gpSubItem.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;
|
||||
gpSubItem.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
gpSubItem.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square;
|
||||
gpSubItem.TabIndex = 1;
|
||||
gpSubItem.Text = "";
|
||||
gpSubItem.Location = new System.Drawing.Point(0, 49);
|
||||
gpSubItem.Size = new System.Drawing.Size(400, 250);
|
||||
return gpSubItem;
|
||||
}
|
||||
private Dictionary<int, CheckBox> MyCheckBoxes = new Dictionary<int, CheckBox>();
|
||||
private string _MyApplicability = string.Empty;
|
||||
public string MyApplicability
|
||||
@@ -128,20 +165,25 @@ namespace Volian.Controls.Library
|
||||
// }
|
||||
//}
|
||||
//}
|
||||
private void AddItemMode(string name, string value)
|
||||
private void AddItemMode(string name, string value, ref DevComponents.DotNetBar.Controls.GroupPanel gpSubItem)
|
||||
{
|
||||
CheckBox cb = new CheckBox();
|
||||
cb.BackColor = Color.Transparent;
|
||||
cb.Height = 24;
|
||||
cb.Width = 75;
|
||||
cb.AutoSize = true;
|
||||
cb.Text = name;
|
||||
cb.Tag = value;
|
||||
cb.Dock = DockStyle.Top;
|
||||
gpItem.Controls.Add(cb);
|
||||
gpSubItem.Controls.Add(cb);
|
||||
cb.BringToFront();
|
||||
cb.CheckedChanged += new EventHandler(cb_CheckedChanged);
|
||||
MyCheckBoxes.Add(value == null ? -1 : int.Parse(value), cb);
|
||||
}
|
||||
private void cb_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
EditItem ei = MyDisplayTabItem.MyStepTabPanel.SelectedEditItem;
|
||||
ei.SaveCurrentAndContents(); // C2026-035 save unsaved step text.
|
||||
UnwireCheckboxes(false);
|
||||
CheckBox cb = sender as CheckBox;
|
||||
CheckState cs = cb.CheckState;
|
||||
@@ -287,6 +329,10 @@ namespace Volian.Controls.Library
|
||||
MasterSlave_ApplicabilityTmp = sc.MasterSlave_Applicability;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
EditItem ei = MyDisplayTabItem.MyStepTabPanel.SelectedEditItem;
|
||||
ei.SaveCurrentAndContents(); // C2026-035 save unsaved step text.
|
||||
|
||||
|
||||
|
||||
ItemInfo startitm = MyItemInfo.FirstSibling;
|
||||
while (startitm != null)
|
||||
@@ -394,6 +440,14 @@ namespace Volian.Controls.Library
|
||||
if (_MyItemInfo != null)
|
||||
{
|
||||
if (this.Visible == false) return;
|
||||
if (_MyItemInfo.IsRNOPart == true) // Check if step is an RNO disable "Set All To Level" button.
|
||||
{
|
||||
btnApplicabilitychg.Enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
btnApplicabilitychg.Enabled = true;
|
||||
}
|
||||
IItemConfig cfg = _MyItemInfo.MyConfig as IItemConfig;
|
||||
List<int> apples = cfg.MasterSlave_Applicability.GetFlags();
|
||||
UnwireCheckboxes(true);
|
||||
@@ -489,7 +543,7 @@ namespace Volian.Controls.Library
|
||||
|
||||
public DisplayApplicability()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitializeComponent(); //B2026-043 Fix "Set All At Level" button.
|
||||
this.VisibleChanged += new EventHandler(DisplayApplicability_VisibleChanged);
|
||||
}
|
||||
|
||||
@@ -500,3 +554,4 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,9 +89,6 @@ namespace Volian.Controls.Library
|
||||
(_myRTB != null && (_myRTB.IsRoTable != lastRTBwasROTable || _myRTB.IsRoFigure != lastRTBwasROFigure)); }
|
||||
}
|
||||
|
||||
//This flag will be set when the docversion gets updated to let it know that the full tree needs a refresh
|
||||
private bool changedDocVersion = false;
|
||||
|
||||
public ROFstInfo MyROFST
|
||||
{
|
||||
get { return _myROFST; }
|
||||
@@ -131,12 +128,6 @@ namespace Volian.Controls.Library
|
||||
// B2022-135 Submitted for Admin Tools (Check RO Links tool)
|
||||
if (_docVersionInfo == null || _docVersionInfo != value || _docVersionInfo.VersionID != value.VersionID)
|
||||
{
|
||||
//Set flag for modified the docversion - should check for new ROs
|
||||
if (_docVersionInfo?.VersionID != value?.VersionID)
|
||||
{
|
||||
changedDocVersion = true;
|
||||
}
|
||||
|
||||
_docVersionInfo = value;
|
||||
|
||||
if (_myRTB != null && (_docVersionInfo == null || _docVersionInfo.VersionID != _myRTB.MyDVI.VersionID))
|
||||
@@ -210,10 +201,6 @@ namespace Volian.Controls.Library
|
||||
// B2022-098: [JPR] ROs not being resolved in Word Sections
|
||||
CurROLink = null;
|
||||
_savCurROLink = null;
|
||||
|
||||
//Clear flag for modified the docversion (if should check for new ROs)
|
||||
//clearing this flag here prevents it from checking twice
|
||||
changedDocVersion = false;
|
||||
}
|
||||
else if(_myRTB != value)
|
||||
{
|
||||
@@ -264,8 +251,6 @@ namespace Volian.Controls.Library
|
||||
set { _myUserInfo = value; }
|
||||
}
|
||||
|
||||
public SessionInfo MySessionInfo { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
@@ -292,61 +277,47 @@ namespace Volian.Controls.Library
|
||||
// Initialize the DisplayTags object
|
||||
displayTags = new DisplayTags();
|
||||
|
||||
_progressBar = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Event Handlers
|
||||
|
||||
#region (Progress Bar)
|
||||
|
||||
private string InitialProgressBarMessage
|
||||
private void ProgressBar_Initialize(int max, string desc)
|
||||
{
|
||||
set
|
||||
if (_progressBar != null)
|
||||
{
|
||||
if (ProgressBar == null) return;
|
||||
ProgressBar.Value = 0;
|
||||
ProgressBar.Maximum = 100;
|
||||
ProgressBar.Text = value;
|
||||
Application.DoEvents();
|
||||
_progressBar.Maximum = max;
|
||||
_progressBar.Text = desc;
|
||||
_progressBar.TextVisible = true;
|
||||
}
|
||||
}
|
||||
private string FinalProgressBarMessage
|
||||
|
||||
private void ProgressBar_SetValue(int curval)
|
||||
{
|
||||
set
|
||||
if (_progressBar != null)
|
||||
{
|
||||
if (ProgressBar == null) return;
|
||||
ProgressBar.Value = 100;
|
||||
ProgressBar.Maximum = 100;
|
||||
ProgressBar.Text = value;
|
||||
Application.DoEvents();
|
||||
_progressBar.Value = curval;
|
||||
}
|
||||
}
|
||||
private void DoProgressBarRefresh(int value, int max, string text)
|
||||
|
||||
private void ProgressBar_Clear()
|
||||
{
|
||||
if (ProgressBar == null) return;
|
||||
ProgressBar.Maximum = max;
|
||||
ProgressBar.Value = value;
|
||||
ProgressBar.Text = text;
|
||||
Application.DoEvents();
|
||||
if (_progressBar != null)
|
||||
{
|
||||
_progressBar.Text = string.Empty;
|
||||
_progressBar.Maximum = 0;
|
||||
_progressBar.Value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region (RTB)
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
// DisplayTab was changed
|
||||
// need to clear the RTB selected
|
||||
// without resetting the DVI or FST
|
||||
// (those will be set manually / individually)
|
||||
// this will prevent DVI and FST from changing to null then back again
|
||||
// which will trigger reloads
|
||||
public void ClearRTB()
|
||||
{
|
||||
_myRTB = null;
|
||||
CurROLink = null;
|
||||
_savCurROLink = null;
|
||||
}
|
||||
|
||||
public void MyRTB_LinkChanged(object sender, StepPanelLinkEventArgs args)
|
||||
{
|
||||
CurROLink = null;
|
||||
@@ -604,65 +575,21 @@ namespace Volian.Controls.Library
|
||||
|
||||
#endregion
|
||||
|
||||
#region (ROUpdate)
|
||||
public List<string> roFstInfo_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args)
|
||||
{
|
||||
return VlnFlexGrid.ROTableUpdate(sender, args);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
// changed to return true if the RO FST got updated
|
||||
public bool LoadTree(bool forceReload = false)
|
||||
public void LoadTree(bool forceReload = false)
|
||||
{
|
||||
bool updatedROs = false;
|
||||
|
||||
if (MyROFST == null)
|
||||
{
|
||||
tvROFST.Nodes.Clear();
|
||||
lbFound.Visible = false;
|
||||
return updatedROs;
|
||||
return;
|
||||
}
|
||||
|
||||
if (changedDocVersion || forceReload || RoTreeNeedsReloaded || tvROFST.Nodes == null || tvROFST.Nodes.Count <= 0)
|
||||
if (forceReload || RoTreeNeedsReloaded || tvROFST.Nodes == null || tvROFST.Nodes.Count <= 0)
|
||||
{
|
||||
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||
//check if newer data - if there is, check if user wants to update data
|
||||
int fstid = MyROFSTLookup.GetNewerFSTID();
|
||||
int origfstid = MyROFSTLookup.RofstID;
|
||||
|
||||
if (_docVersionInfo != null && fstid != -1 && fstid != MyROFSTLookup.RofstID)
|
||||
{
|
||||
string message = string.Empty;
|
||||
if (!MySessionInfo.CanCheckOutItem(_docVersionInfo.VersionID, CheckOutType.DocVersion, ref message))
|
||||
{
|
||||
FlexibleMessageBox.Show(this, message, "Working Draft Has Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
FinalProgressBarMessage = "Cannot check-out Working Draft";
|
||||
}
|
||||
else if (changedDocVersion && MessageBox.Show($"There exists a newer ROFST for this RO database that was loaded for other sets.\r\n\r\nDo you want to update this set's ROs to be consistent/use the latest loaded ROFST?", "Load ROs", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||
{
|
||||
|
||||
InitialProgressBarMessage = "Updating ROs";
|
||||
|
||||
ROFstInfo roFstInfo = ROFstInfo.Get(fstid);
|
||||
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||
ROFstInfo.RefreshROFstAtItemLevel(_docVersionInfo, DoProgressBarRefresh, null, roFstInfo, origfstid, fstid);
|
||||
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||
|
||||
Application.DoEvents();
|
||||
|
||||
FinalProgressBarMessage = "ROs values updated";
|
||||
MyROFST = roFstInfo;
|
||||
|
||||
updatedROs = true;
|
||||
}
|
||||
}
|
||||
|
||||
//B2025-008
|
||||
//in cases where a RO table is clicked on
|
||||
//it will refresh the list
|
||||
@@ -670,15 +597,13 @@ namespace Volian.Controls.Library
|
||||
//so can go to it after the refresh
|
||||
string tmpROID = CurROLink?.ROID;
|
||||
|
||||
ROFSTLookup.rodbi[] dbs = MyROFSTLookup?.GetRODatabaseList(true);
|
||||
ROFSTLookup.rodbi[] dbs = MyROFSTLookup.GetRODatabaseList(true);
|
||||
|
||||
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures.
|
||||
// Added optional parameter "forceReload" and cleared out any existing nodes before reloading the tree
|
||||
// the clear nodes code below has to be after the GetRODatabaseList database call because of races conditions in the code
|
||||
tvROFST.Nodes.Clear();
|
||||
ResetSearch(); //B2023-050 need to reset the SaveRO, and any RO info that was selected last time the tree was loaded
|
||||
if (dbs != null)
|
||||
{
|
||||
for (int i = 0; i < dbs.Length; i++)
|
||||
{
|
||||
ROFSTLookup.rodbi db = dbs[i];
|
||||
@@ -688,7 +613,6 @@ namespace Volian.Controls.Library
|
||||
tvROFST.Nodes.Add(tn);
|
||||
|
||||
AddDummyGroup(db, tn);
|
||||
}
|
||||
}
|
||||
|
||||
_currRofstID = (IsRofstValid) ? (int?)_myROFST.ROFstID : null;
|
||||
@@ -697,12 +621,6 @@ namespace Volian.Controls.Library
|
||||
if(_docVersionInfo != null) _currDocVersionID = (int?)_docVersionInfo.VersionID;
|
||||
|
||||
if (tmpROID != null) ExpandNode(ROFSTLookup.FormatRoidKey(tmpROID, true));
|
||||
|
||||
//doc version would have updated (if needed) so reset flag
|
||||
if (_progressBar?.Text != "Cannot check-out Working Draft")
|
||||
{
|
||||
changedDocVersion = false;
|
||||
}
|
||||
}
|
||||
|
||||
var unitInfoNode = tvROFST.Nodes.Cast<TreeNode>().Where(x => x.Text == "Unit Information").FirstOrDefault();
|
||||
@@ -754,8 +672,6 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
|
||||
_curROTypeFilter = _roTypeFilter;
|
||||
|
||||
return updatedROs;
|
||||
}
|
||||
|
||||
public void SetFindDocROButton(bool enabled)
|
||||
|
||||
@@ -3556,9 +3556,6 @@ namespace Volian.Controls.Library
|
||||
MyEditItem.SaveContents();
|
||||
using (DocVersion dv = DocVersion.Get(Mydvi.VersionID))
|
||||
{
|
||||
//must get id before ROFST gets updated so know what to refresh later
|
||||
int origfstid = roFstInfo.ROFstID;
|
||||
|
||||
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(Mydvi));
|
||||
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
|
||||
if (dv.ROfstLoadingFigures || dv.NewerRoFst) // B2017-125 see if loading figures was completed
|
||||
@@ -3569,7 +3566,7 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
|
||||
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, null, roFstInfo, origfstid, roFstInfo.ROFstID);
|
||||
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, null);
|
||||
swROUpdate.Close();
|
||||
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
|
||||
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||
|
||||
@@ -2465,10 +2465,6 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
Cursor = Cursors.WaitCursor; // C2023-002: move wait cursor after check out error
|
||||
int ownerid = MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion);
|
||||
|
||||
//must get id before ROFST gets updated so know what to refresh later
|
||||
int origfstid = roFstInfo.ROFstID;
|
||||
|
||||
using (DocVersion dv = DocVersion.Get(MyDVI.VersionID))
|
||||
{
|
||||
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(MyDVI)); // RO changes placed in file in the Documents\VEPROMS folder
|
||||
@@ -2481,7 +2477,7 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
|
||||
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, null, roFstInfo, origfstid, roFstInfo.ROFstID);
|
||||
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, null);
|
||||
swROUpdate.Close();
|
||||
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
|
||||
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||
|
||||
Reference in New Issue
Block a user