Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 250b3fa406 | |||
| a5a3f16177 | |||
| ffa7e21c18 | |||
| 4608c05df0 | |||
| 56ff5a0213 | |||
| 014fde301c | |||
| 0080a42423 | |||
| 2035a4c855 | |||
| 4dc6a190fa | |||
| e0db322262 | |||
| 8f1bb45e42 | |||
| f39aefd28f | |||
| 2cfc43dbfd | |||
| 768fcc4f05 | |||
| 727491f99b | |||
| c5f1c3a340 | |||
| a78311104a | |||
| 45e78ef184 | |||
| 7f0d39b684 |
@@ -116,12 +116,12 @@ namespace ROEditor
|
|||||||
public uint thisoff;
|
public uint thisoff;
|
||||||
public string title;
|
public string title;
|
||||||
|
|
||||||
public FstTmpSTRC(ushort type, uint offset, string tl)
|
public FstTmpSTRC(ushort type, uint offset, string tl)
|
||||||
{
|
{
|
||||||
thistype = type;
|
thistype = type;
|
||||||
thisoff = offset;
|
thisoff = offset;
|
||||||
title = tl;
|
title = tl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteString(BinaryWriter bw, string str)
|
void WriteString(BinaryWriter bw, string str)
|
||||||
{
|
{
|
||||||
@@ -150,7 +150,7 @@ namespace ROEditor
|
|||||||
bw.Write(thisoff);
|
bw.Write(thisoff);
|
||||||
bw.Write(thistype);
|
bw.Write(thistype);
|
||||||
WriteString(bw,title);
|
WriteString(bw,title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Sorted Array was not sorting via the ASCII value of each character in a given string.
|
// The Sorted Array was not sorting via the ASCII value of each character in a given string.
|
||||||
@@ -565,8 +565,8 @@ namespace ROEditor
|
|||||||
string RecIdStr = elem.GetAttribute("RecID");
|
string RecIdStr = elem.GetAttribute("RecID");
|
||||||
curRecID = System.Convert.ToUInt32(RecIdStr,16);
|
curRecID = System.Convert.ToUInt32(RecIdStr,16);
|
||||||
|
|
||||||
// Get the current node's parent id
|
// Get the current node's parent id
|
||||||
string ParIdStr = elem.GetAttribute("ParentID");
|
string ParIdStr = elem.GetAttribute("ParentID");
|
||||||
elemParentID = Convert.ToUInt32(ParIdStr,16);
|
elemParentID = Convert.ToUInt32(ParIdStr,16);
|
||||||
|
|
||||||
string HasKids = elem.GetAttribute("HasChild");
|
string HasKids = elem.GetAttribute("HasChild");
|
||||||
@@ -771,8 +771,8 @@ namespace ROEditor
|
|||||||
private ushort SaveROToFST(XmlNode RONode,ArrayList InUseList,string RtnValTmplate, string AccPageIDTplate)
|
private ushort SaveROToFST(XmlNode RONode,ArrayList InUseList,string RtnValTmplate, string AccPageIDTplate)
|
||||||
{
|
{
|
||||||
ushort RtnVal;
|
ushort RtnVal;
|
||||||
uint startFST = (uint)fhFST.BaseStream.Position;
|
uint startFST = (uint)fhFST.BaseStream.Position;
|
||||||
uint RORecID;
|
uint RORecID;
|
||||||
uint ParID;
|
uint ParID;
|
||||||
byte nullbyte=0;
|
byte nullbyte=0;
|
||||||
|
|
||||||
@@ -844,8 +844,12 @@ namespace ROEditor
|
|||||||
AccPageID = " ";
|
AccPageID = " ";
|
||||||
WriteString(AccPageID);
|
WriteString(AccPageID);
|
||||||
|
|
||||||
// Save the ID and offset entry for the current ID
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
IdsAndOffsets.Add(RORecID,startFST);
|
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);
|
||||||
|
|
||||||
// Save the RecID and Accessory Page id
|
// Save the RecID and Accessory Page id
|
||||||
IdsAndAccPgIds[AccPageID] = RORecID;
|
IdsAndAccPgIds[AccPageID] = RORecID;
|
||||||
|
|||||||
@@ -322,9 +322,9 @@ namespace RODBInterface
|
|||||||
get { return _PCChildList; }
|
get { return _PCChildList; }
|
||||||
set { _PCChildList = value; }
|
set { _PCChildList = value; }
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region abstracts // need these for each method that must be defined for each database type
|
#region abstracts // need these for each method that must be defined for each database type
|
||||||
public abstract string RODB_GetNextGroupTable();
|
public abstract string RODB_GetNextGroupTable();
|
||||||
public abstract string RODB_GetNextRecId(string table);
|
public abstract string RODB_GetNextRecId(string table);
|
||||||
public abstract bool RODB_GetRootGroups(VlnXmlElement root);
|
public abstract bool RODB_GetRootGroups(VlnXmlElement root);
|
||||||
public abstract bool RODB_DeleteGroup(XmlNode group, string tbname, string toprecid);
|
public abstract bool RODB_DeleteGroup(XmlNode group, string tbname, string toprecid);
|
||||||
@@ -355,9 +355,10 @@ namespace RODBInterface
|
|||||||
public abstract string RODB_GetDBServerForAbout();
|
public abstract string RODB_GetDBServerForAbout();
|
||||||
public abstract string RODB_HasBeenConverted();
|
public abstract string RODB_HasBeenConverted();
|
||||||
public abstract bool RODB_WriteSqlConnectToAccess(string newConectStr);
|
public abstract bool RODB_WriteSqlConnectToAccess(string newConectStr);
|
||||||
#endregion
|
public abstract string RODB_GetModDateTime(string Recid, string table);
|
||||||
|
#endregion
|
||||||
|
|
||||||
public RODB()
|
public RODB()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2382,9 +2383,9 @@ namespace RODBInterface
|
|||||||
RecID = DBE.GetString(0);
|
RecID = DBE.GetString(0);
|
||||||
MyRecID = RecID;
|
MyRecID = RecID;
|
||||||
Info = DBE.GetString(1);
|
Info = DBE.GetString(1);
|
||||||
// it's defined in the local table if the first character is "<" which starts
|
// it's defined in the local table if the first character is "<" which starts
|
||||||
// the schema definition string.
|
// the schema definition string.
|
||||||
if ("<" == Info.Substring(0, 1))
|
if ("<" == Info.Substring(0, 1))
|
||||||
{
|
{
|
||||||
name = ParseEleName(Info);
|
name = ParseEleName(Info);
|
||||||
if (name != null)
|
if (name != null)
|
||||||
@@ -2425,7 +2426,7 @@ namespace RODBInterface
|
|||||||
return retlist;
|
return retlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string RODB_GetSchemaPiece(string Recid, string table)
|
public override string RODB_GetSchemaPiece(string Recid, string table)
|
||||||
{
|
{
|
||||||
string strGetSchemaPiece;
|
string strGetSchemaPiece;
|
||||||
string Info;
|
string Info;
|
||||||
@@ -3082,7 +3083,28 @@ namespace RODBInterface
|
|||||||
return GrpCnt;
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1803,9 +1803,9 @@ namespace RODBInterface
|
|||||||
RecID = reader.GetString(0);
|
RecID = reader.GetString(0);
|
||||||
MyRecID = RecID;
|
MyRecID = RecID;
|
||||||
Info = reader.GetString(1);
|
Info = reader.GetString(1);
|
||||||
// it's defined in the local table if the first character is "<" which starts
|
// it's defined in the local table if the first character is "<" which starts
|
||||||
// the schema definition string.
|
// the schema definition string.
|
||||||
if ("<" == Info.Substring(0, 1))
|
if ("<" == Info.Substring(0, 1))
|
||||||
{
|
{
|
||||||
name = ParseEleName(Info);
|
name = ParseEleName(Info);
|
||||||
if (name != null)
|
if (name != null)
|
||||||
@@ -1859,9 +1859,9 @@ namespace RODBInterface
|
|||||||
RecID = reader.GetString(0);
|
RecID = reader.GetString(0);
|
||||||
MyRecID = RecID;
|
MyRecID = RecID;
|
||||||
Info = reader.GetString(1);
|
Info = reader.GetString(1);
|
||||||
// it's defined in the local table if the first character is "<" which starts
|
// it's defined in the local table if the first character is "<" which starts
|
||||||
// the schema definition string.
|
// the schema definition string.
|
||||||
if ("<" == Info.Substring(0, 1))
|
if ("<" == Info.Substring(0, 1))
|
||||||
{
|
{
|
||||||
name = ParseEleName(Info);
|
name = ParseEleName(Info);
|
||||||
if (name != null)
|
if (name != null)
|
||||||
@@ -2653,8 +2653,36 @@ namespace RODBInterface
|
|||||||
}
|
}
|
||||||
return GrpCnt;
|
return GrpCnt;
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
public static bool TestConnect(string constring)
|
//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)
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
using (SqlConnection connection = new SqlConnection(constring))
|
using (SqlConnection connection = new SqlConnection(constring))
|
||||||
|
|||||||
@@ -5227,7 +5227,7 @@ CREATE PROCEDURE [dbo].[getRevisionByItemIDandRevisionNumberAndUnitID]
|
|||||||
WITH EXECUTE AS OWNER
|
WITH EXECUTE AS OWNER
|
||||||
AS
|
AS
|
||||||
declare @RevisionID int
|
declare @RevisionID int
|
||||||
set @RevisionID = (select revisionid from revisions rr cross apply rr.config.nodes('//Applicability') t1(r1) where itemid = @itemid and revisionnumber = @RevisionNumber and r1.value('@Index','int') = @UnitID)
|
set @RevisionID = (select top 1 revisionid from revisions rr cross apply rr.config.nodes('//Applicability') t1(r1) where itemid = @itemid and revisionnumber = @RevisionNumber and r1.value('@Index','int') = @UnitID order by revisionid desc)
|
||||||
SELECT
|
SELECT
|
||||||
[RevisionID],
|
[RevisionID],
|
||||||
[ItemID],
|
[ItemID],
|
||||||
@@ -13541,34 +13541,6 @@ IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteAllDocVers
|
|||||||
DROP PROCEDURE [deleteAllDocVersionPdfs];
|
DROP PROCEDURE [deleteAllDocVersionPdfs];
|
||||||
GO
|
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] ******/
|
/****** Object: StoredProcedure [addFiguresByROFstIDandImageIDs] ******/
|
||||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[addFiguresByROFstIDandImageIDs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[addFiguresByROFstIDandImageIDs]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||||
DROP PROCEDURE [addFiguresByROFstIDandImageIDs];
|
DROP PROCEDURE [addFiguresByROFstIDandImageIDs];
|
||||||
@@ -17169,6 +17141,7 @@ GO
|
|||||||
[roid] [varchar](50) NOT NULL,
|
[roid] [varchar](50) NOT NULL,
|
||||||
[appid] [varchar](max) NULL,
|
[appid] [varchar](max) NULL,
|
||||||
[value] [varchar](max) NULL,
|
[value] [varchar](max) NULL,
|
||||||
|
[moddatetime] [datetime] NULL,
|
||||||
CONSTRAINT [PK_RofstChild] PRIMARY KEY CLUSTERED
|
CONSTRAINT [PK_RofstChild] PRIMARY KEY CLUSTERED
|
||||||
(
|
(
|
||||||
[RofstChildID] ASC
|
[RofstChildID] ASC
|
||||||
@@ -17303,6 +17276,23 @@ GO
|
|||||||
End -- Rofst Tables
|
End -- Rofst Tables
|
||||||
Go
|
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
|
||||||
|
|
||||||
/*
|
/*
|
||||||
----------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------
|
||||||
@@ -19705,6 +19695,7 @@ GO
|
|||||||
@roid VarChar(50),
|
@roid VarChar(50),
|
||||||
@appid VarChar(Max) = null,
|
@appid VarChar(Max) = null,
|
||||||
@value VarChar(Max) = null,
|
@value VarChar(Max) = null,
|
||||||
|
@ModDateTime DateTime = null,
|
||||||
@missingDefaultValue VarChar(Max) = null
|
@missingDefaultValue VarChar(Max) = null
|
||||||
)
|
)
|
||||||
With Execute as Owner
|
With Execute as Owner
|
||||||
@@ -19722,8 +19713,8 @@ GO
|
|||||||
Set @missingDefaultValue = '[TBD]';
|
Set @missingDefaultValue = '[TBD]';
|
||||||
|
|
||||||
-- Create Rofst Child/Group Record --> [Roid = (12) Digits]
|
-- Create Rofst Child/Group Record --> [Roid = (12) Digits]
|
||||||
Insert Into RofstChild (RofstID, ID, ParentID, dbiID, [type], title, roid, appid, [value])
|
Insert Into RofstChild (RofstID, ID, ParentID, dbiID, [type], title, roid, appid, moddatetime, [value])
|
||||||
Values (@RofstID, @ID, @ParentID, @dbiID, @type, @title, @roid, @appid, REPLACE(REPLACE(@value, '&123;', '{'), '&125;', '}'));
|
Values (@RofstID, @ID, @ParentID, @dbiID, @type, @title, @roid, @appid, @ModDateTime, REPLACE(REPLACE(@value, '&123;', '{'), '&125;', '}'));
|
||||||
|
|
||||||
|
|
||||||
-- Check for appid, if exists, then insert the default value for each return type if multi-value
|
-- Check for appid, if exists, then insert the default value for each return type if multi-value
|
||||||
@@ -24777,6 +24768,228 @@ IF (@@Error = 0) PRINT 'Procedure Creation: [GetMissingDocsByUnit] Succeeded'
|
|||||||
ELSE PRINT 'Procedure Creation: [GetMissingDocsByUnit] Error on Creation'
|
ELSE PRINT 'Procedure Creation: [GetMissingDocsByUnit] Error on Creation'
|
||||||
GO
|
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
|
||||||
|
|
||||||
|
/****** Object: StoredProcedure [dbo].[getRevisionByItemIDandRevisionNumber] ******/
|
||||||
|
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[getRevisionByItemIDandRevisionNumber]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||||
|
DROP PROCEDURE [dbo].[getRevisionByItemIDandRevisionNumber];
|
||||||
|
GO
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||||
|
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
|
||||||
|
*****************************************************************************/
|
||||||
|
CREATE PROCEDURE [dbo].[getRevisionByItemIDandRevisionNumber]
|
||||||
|
|
||||||
|
(
|
||||||
|
@ItemID int,
|
||||||
|
@RevisionNumber nvarchar(50)
|
||||||
|
)
|
||||||
|
WITH EXECUTE AS OWNER
|
||||||
|
AS
|
||||||
|
declare @RevisionID int
|
||||||
|
set @RevisionID = (select top 1 revisionid from revisions where itemid = @itemid and revisionnumber = @RevisionNumber order by revisionid desc)
|
||||||
|
SELECT
|
||||||
|
[RevisionID],
|
||||||
|
[ItemID],
|
||||||
|
[TypeID],
|
||||||
|
[RevisionNumber],
|
||||||
|
[RevisionDate],
|
||||||
|
[Notes],
|
||||||
|
[Config],
|
||||||
|
[DTS],
|
||||||
|
[UserID],
|
||||||
|
[LastChanged],
|
||||||
|
(SELECT COUNT(*) FROM [Checks] WHERE [Checks].[RevisionID]=[Revisions].[RevisionID]) [CheckCount],
|
||||||
|
(SELECT COUNT(*) FROM [Versions] WHERE [Versions].[RevisionID]=[Revisions].[RevisionID]) [VersionCount]
|
||||||
|
FROM [Revisions]
|
||||||
|
WHERE [RevisionID]=@RevisionID
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
[Checks].[CheckID],
|
||||||
|
[Checks].[RevisionID],
|
||||||
|
[Checks].[StageID],
|
||||||
|
[Checks].[ConsistencyChecks],
|
||||||
|
[Checks].[DTS],
|
||||||
|
[Checks].[UserID],
|
||||||
|
[Checks].[LastChanged],
|
||||||
|
[Stages].[Name] [Stage_Name],
|
||||||
|
[Stages].[Description] [Stage_Description],
|
||||||
|
[Stages].[IsApproved] [Stage_IsApproved],
|
||||||
|
[Stages].[DTS] [Stage_DTS],
|
||||||
|
[Stages].[UserID] [Stage_UserID]
|
||||||
|
FROM [Checks]
|
||||||
|
JOIN [Stages] ON
|
||||||
|
[Stages].[StageID]=[Checks].[StageID]
|
||||||
|
WHERE
|
||||||
|
[Checks].[RevisionID]=@RevisionID
|
||||||
|
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
[Versions].[VersionID],
|
||||||
|
[Versions].[RevisionID],
|
||||||
|
[Versions].[StageID],
|
||||||
|
[Versions].[DTS],
|
||||||
|
[Versions].[UserID],
|
||||||
|
[Versions].[LastChanged],
|
||||||
|
[Versions].[PDF],
|
||||||
|
[Versions].[SummaryPDF],
|
||||||
|
[Stages].[Name] [Stage_Name],
|
||||||
|
[Stages].[Description] [Stage_Description],
|
||||||
|
[Stages].[IsApproved] [Stage_IsApproved],
|
||||||
|
[Stages].[DTS] [Stage_DTS],
|
||||||
|
[Stages].[UserID] [Stage_UserID]
|
||||||
|
FROM [Versions]
|
||||||
|
JOIN [Stages] ON
|
||||||
|
[Stages].[StageID]=[Versions].[StageID]
|
||||||
|
WHERE
|
||||||
|
[Versions].[RevisionID]=@RevisionID
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
|
||||||
|
-- Display the status of Proc creation
|
||||||
|
IF (@@Error = 0) PRINT 'Procedure Creation: getRevisionByItemIDandRevisionNumber Succeeded'
|
||||||
|
ELSE PRINT 'Procedure Creation: getRevisionByItemIDandRevisionNumber Error on Creation'
|
||||||
|
GO
|
||||||
|
|
||||||
/*
|
/*
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
| ADD New Code Before this Block |
|
| ADD New Code Before this Block |
|
||||||
@@ -24810,8 +25023,8 @@ BEGIN TRY -- Try Block
|
|||||||
DECLARE @RevDate varchar(255)
|
DECLARE @RevDate varchar(255)
|
||||||
DECLARE @RevDescription varchar(255)
|
DECLARE @RevDescription varchar(255)
|
||||||
|
|
||||||
set @RevDate = '03/13/2026 7:00 AM'
|
set @RevDate = '05/26/2026 7:00 AM'
|
||||||
set @RevDescription = 'Added Get Missing Docs by Unit for Generating Pdf table'
|
set @RevDescription = 'Get Most Recent Revision when Duplicates'
|
||||||
|
|
||||||
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
|
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
|
||||||
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
|
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
|
||||||
|
|||||||
@@ -1036,8 +1036,11 @@ namespace VEPROMS
|
|||||||
ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst;
|
ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst;
|
||||||
string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst";
|
string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst";
|
||||||
|
|
||||||
//if (!pathExists(rofstPath))
|
//must get id before ROFST gets updated so know what to refresh later
|
||||||
if (!File.Exists(rofstPath))
|
int origfstid = roFstInfo.ROFstID;
|
||||||
|
|
||||||
|
//if (!pathExists(rofstPath))
|
||||||
|
if (!File.Exists(rofstPath))
|
||||||
{
|
{
|
||||||
ProgressBar.ColorTable = eProgressBarItemColor.Error;
|
ProgressBar.ColorTable = eProgressBarItemColor.Error;
|
||||||
FinalProgressBarMessage = "No existing RO.FST";
|
FinalProgressBarMessage = "No existing RO.FST";
|
||||||
@@ -1063,9 +1066,29 @@ namespace VEPROMS
|
|||||||
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
|
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
|
||||||
roFstInfo = dq.DocVersionAssociations[0].MyROFst;
|
roFstInfo = dq.DocVersionAssociations[0].MyROFst;
|
||||||
}
|
}
|
||||||
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
else if (!dv.ROfstLastCompleted && origfstid == roFstInfo.ROFstID)
|
||||||
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, txtProcess);
|
{
|
||||||
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
//Handle issue where load failed without completing update
|
||||||
|
//previous RO FST did not load, get last loaded ID
|
||||||
|
//if none, use -1 which will check all ROs in the Working Draft
|
||||||
|
string cfg = dv.DocVersionAssociations[0].Config;
|
||||||
|
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg);
|
||||||
|
if (dv.DocVersionAssociations[0]?.MyROFst != null)
|
||||||
|
{
|
||||||
|
if (!int.TryParse(ac.ROUpdate_PrevROFSTID, out origfstid))
|
||||||
|
{
|
||||||
|
origfstid = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
origfstid = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||||
|
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, txtProcess, roFstInfo, origfstid, roFstInfo.ROFstID);
|
||||||
|
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
@@ -1316,10 +1339,10 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
if (ProgressBar == null) return;
|
if (ProgressBar == null) return;
|
||||||
|
|
||||||
ProgressBar.Value = 100;
|
ProgressBar.Text = value;
|
||||||
ProgressBar.Maximum = 100;
|
ProgressBar.Maximum = 100;
|
||||||
ProgressBar.Text = value;
|
ProgressBar.Value = 100;
|
||||||
txtProcess.AppendText(value);
|
txtProcess.AppendText(value);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
|
|
||||||
|
|||||||
@@ -246,12 +246,16 @@ namespace VEPROMS
|
|||||||
|
|
||||||
tc.MyCopyStep = myParent.tc.MyCopyStep; // copy the copystep info to the child window
|
tc.MyCopyStep = myParent.tc.MyCopyStep; // copy the copystep info to the child window
|
||||||
|
|
||||||
(tv.Nodes[0] as VETreeNode).InChildWindow = true; // tells us this folder's tree nodes are in the child window
|
//B2026 - 048 View Only Mode freezes PROMS if last tab closed
|
||||||
|
tc.EnableDisableStepProperties -= EnableDisableStepProperties;
|
||||||
|
tc.EnableDisableStepProperties += new StepTabRibbonEvent(EnableDisableStepProperties);
|
||||||
|
|
||||||
|
(tv.Nodes[0] as VETreeNode).InChildWindow = true; // tells us this folder's tree nodes are in the child window
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OpenItem(ItemInfo myItemInfo)
|
public void OpenItem(ItemInfo myItemInfo)
|
||||||
{
|
{
|
||||||
tc.OpenItem(myItemInfo);
|
tc.OpenItem(myItemInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RefreshItem(ItemInfo myItemInfo)
|
public void RefreshItem(ItemInfo myItemInfo)
|
||||||
@@ -352,9 +356,10 @@ namespace VEPROMS
|
|||||||
|
|
||||||
displayRO.TabControl = tc; // B2019-043 this was being passed in as a parameter for DisplayRO which caused issues with the Visual Studio designer
|
displayRO.TabControl = tc; // B2019-043 this was being passed in as a parameter for DisplayRO which caused issues with the Visual Studio designer
|
||||||
bottomProgBar.ValueChanged += new EventHandler(bottomProgBar_ValueChanged);
|
bottomProgBar.ValueChanged += new EventHandler(bottomProgBar_ValueChanged);
|
||||||
|
tc.EnableDisableStepProperties += new StepTabRibbonEvent(EnableDisableStepProperties);
|
||||||
|
|
||||||
// When creating an XY Plot, a System.Drawing.Graphics is needed and it requires a form. Use the main form.
|
// When creating an XY Plot, a System.Drawing.Graphics is needed and it requires a form. Use the main form.
|
||||||
if (VlnSettings.DebugMode)
|
if (VlnSettings.DebugMode)
|
||||||
{
|
{
|
||||||
MSWordToPDF.DebugStatus = 1;
|
MSWordToPDF.DebugStatus = 1;
|
||||||
MSWordToPDF.OverrideColor = Color.Red;
|
MSWordToPDF.OverrideColor = Color.Red;
|
||||||
@@ -964,7 +969,18 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
pnl.ApplDisplayMode = displayApplicability.ViewMode;
|
pnl.ApplDisplayMode = displayApplicability.ViewMode;
|
||||||
displayHistory.ApplDisplayMode = pnl.ApplDisplayMode;
|
displayHistory.ApplDisplayMode = pnl.ApplDisplayMode;
|
||||||
|
|
||||||
|
//C2026-021 Expand Functionality of Viewing Mode
|
||||||
|
if (pnl.ApplDisplayMode > 0 && pnl.VwMode != E_ViewMode.View)
|
||||||
|
{
|
||||||
|
pnl.VwMode = E_ViewMode.View;
|
||||||
|
EnableDisableStepProperties(sender, new StepTabRibbonEventArgs(tc.SelectedDisplayTabItem.MyItemInfo, 0, pnl.VwMode));
|
||||||
|
MessageBox.Show("Changing to View Only Mode. Applicability Viewing Mode must be Master to return to Edit Mode. View Mode can be toggled off via the Ribbon->View tab.", "Changing to View Mode", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
|
}
|
||||||
|
|
||||||
|
pnl.MyStepTabPanel.MyStepTabRibbon.RefreshProcedure();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tv_ViewPDF(object sender, vlnTreeViewPdfArgs args)
|
void tv_ViewPDF(object sender, vlnTreeViewPdfArgs args)
|
||||||
@@ -1594,7 +1610,7 @@ namespace VEPROMS
|
|||||||
displayRO.MyROFST = SelectedROFst;
|
displayRO.MyROFST = SelectedROFst;
|
||||||
// B2023-021: force Load of Step Prop/RO panel RO tree by passing in
|
// B2023-021: force Load of Step Prop/RO panel RO tree by passing in
|
||||||
// true to LoadTree
|
// true to LoadTree
|
||||||
displayRO.LoadTree(true);
|
if (!_WeAreExitingPROMS) displayRO.LoadTree(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2395,6 +2411,7 @@ namespace VEPROMS
|
|||||||
tv.MySessionInfo = MySessionInfo;
|
tv.MySessionInfo = MySessionInfo;
|
||||||
tv.MyUserInfo = MyUserInfo;
|
tv.MyUserInfo = MyUserInfo;
|
||||||
StepTabRibbon.MySessionInfo = MySessionInfo;
|
StepTabRibbon.MySessionInfo = MySessionInfo;
|
||||||
|
displayRO.MySessionInfo = MySessionInfo;
|
||||||
|
|
||||||
// Initialize Caption with Server name and Database name.
|
// Initialize Caption with Server name and Database name.
|
||||||
SetCaption(tv.TopNode as VETreeNode);
|
SetCaption(tv.TopNode as VETreeNode);
|
||||||
@@ -4553,6 +4570,15 @@ namespace VEPROMS
|
|||||||
SetCaption(tv.SelectedNode as VETreeNode);
|
SetCaption(tv.SelectedNode as VETreeNode);
|
||||||
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
|
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)
|
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
|
||||||
{
|
{
|
||||||
displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
|
||||||
@@ -4562,9 +4588,24 @@ namespace VEPROMS
|
|||||||
displayRO.MyROFST = null;
|
displayRO.MyROFST = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures. (Added True for the forceLoad parameter)
|
// set the DocVersionInfo so that the FST and docversion are in sync
|
||||||
displayRO.LoadTree(true);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole;
|
lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole;
|
||||||
|
|
||||||
@@ -4765,7 +4806,13 @@ namespace VEPROMS
|
|||||||
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
||||||
displayRO.ProgressBar = bottomProgBar;
|
displayRO.ProgressBar = bottomProgBar;
|
||||||
displayRO.MyRTB = args.MyEditItem.MyStepRTB;
|
displayRO.MyRTB = args.MyEditItem.MyStepRTB;
|
||||||
displayRO.LoadTree();
|
//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;
|
||||||
|
}
|
||||||
|
|
||||||
displayBookMarks.MyEditItem = args.MyEditItem;
|
displayBookMarks.MyEditItem = args.MyEditItem;
|
||||||
displayHistory.MyEditItem = args.MyEditItem;
|
displayHistory.MyEditItem = args.MyEditItem;
|
||||||
@@ -4795,7 +4842,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
||||||
displayRO.SetFindDocROButton(false);
|
displayRO.SetFindDocROButton(false);
|
||||||
displayRO.LoadTree();
|
if (!_WeAreExitingPROMS) displayRO.LoadTree();
|
||||||
|
|
||||||
//C2019-036 View Only mode work with Checked Out Procedures
|
//C2019-036 View Only mode work with Checked Out Procedures
|
||||||
//In View Only Mode - Step Properties should be disabled
|
//In View Only Mode - Step Properties should be disabled
|
||||||
@@ -4836,15 +4883,31 @@ namespace VEPROMS
|
|||||||
//In View Only Mode - Step Properties should be disabled
|
//In View Only Mode - Step Properties should be disabled
|
||||||
public void EnableDisableStepProperties(object sender, StepTabRibbonEventArgs args)
|
public void EnableDisableStepProperties(object sender, StepTabRibbonEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.ViewMode == E_ViewMode.View && (infoTabs.Enabled || infoTabs.SelectedTab != infotabTags))
|
//C2026 - 021 Expand Functionality of Viewing Mode
|
||||||
|
//B2026 - 048 View Only Mode freezes PROMS if last tab closed
|
||||||
|
if (args.ViewMode == E_ViewMode.View && (infotabControlPanelTags.Enabled || (infoTabs.SelectedTab != infotabTags && infoTabs.SelectedTab != infotabApplicability)))
|
||||||
{
|
{
|
||||||
infoTabs.Enabled = true;
|
if (infoTabs.SelectedTab != infotabApplicability)
|
||||||
infoTabs.SelectedTab = infotabTags;
|
{
|
||||||
infoTabs.Enabled = false;
|
infoTabs.SelectedTab = infotabTags;
|
||||||
|
}
|
||||||
|
|
||||||
|
infotabControlPanelTags.Enabled = false;
|
||||||
|
infotabControlPanelRO.Enabled = false;
|
||||||
|
infotabControlPanelTransitions.Enabled = false;
|
||||||
|
tabControlPanel1.Enabled = false;
|
||||||
|
displayApplicability.SetEnableDisableItemSelection(false);
|
||||||
|
tcpFoldoutMaint.Enabled = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (args.ViewMode != E_ViewMode.View && !infoTabs.Enabled)
|
else if (args.ViewMode != E_ViewMode.View && !infotabControlPanelTags.Enabled)
|
||||||
{
|
{
|
||||||
infoTabs.Enabled = true;
|
infotabControlPanelTags.Enabled = true;
|
||||||
|
infotabControlPanelRO.Enabled = true;
|
||||||
|
infotabControlPanelTransitions.Enabled = true;
|
||||||
|
tabControlPanel1.Enabled = true;
|
||||||
|
displayApplicability.SetEnableDisableItemSelection(true);
|
||||||
|
tcpFoldoutMaint.Enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4928,8 +4991,14 @@ namespace VEPROMS
|
|||||||
displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
|
displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
|
||||||
displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo;
|
displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo;
|
||||||
|
|
||||||
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
// B2022-026 RO Memory reduction coding (Jakes Merge)
|
||||||
displayRO.LoadTree();
|
//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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -899,10 +899,10 @@ namespace VEPROMS
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (ProgressBar == null) return;
|
if (ProgressBar == null) return;
|
||||||
ProgressBar.Maximum = 100;
|
ProgressBar.Text = value;
|
||||||
ProgressBar.Value = 100;
|
ProgressBar.Maximum = 100;
|
||||||
ProgressBar.Text = value;
|
ProgressBar.Value = 100;
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1527,8 +1527,11 @@ namespace VEPROMS
|
|||||||
|
|
||||||
Cursor = Cursors.WaitCursor;
|
Cursor = Cursors.WaitCursor;
|
||||||
|
|
||||||
// RO changes placed in file in the Documents\VEPROMS folder
|
//must get id before ROFST gets updated so know what to refresh later
|
||||||
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(_DocVersionConfig.MyDocVersion.MyDocVersionInfo));
|
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;
|
DocVersion dv = _DocVersionConfig.MyDocVersion;
|
||||||
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
|
// 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
|
if (dv.ROfstLoadingFigures || dv.NewerRoFst) // B2017-125 see if loading figures was completed
|
||||||
@@ -1536,13 +1539,32 @@ namespace VEPROMS
|
|||||||
ROFstInfo.UpdateRoFst(SelectedROFst.MyRODb, dv, SelectedROFst, DoProgressBarRefresh);
|
ROFstInfo.UpdateRoFst(SelectedROFst.MyRODb, dv, SelectedROFst, DoProgressBarRefresh);
|
||||||
SelectedROFst = null; // set to null to force getting the updated ROfst
|
SelectedROFst = null; // set to null to force getting the updated ROfst
|
||||||
}
|
}
|
||||||
|
else if (!dv.ROfstLastCompleted && origfstid == SelectedROFst.ROFstID)
|
||||||
|
{
|
||||||
|
//Handle issue where load failed without completing update
|
||||||
|
//previous RO FST did not load, get last loaded ID
|
||||||
|
//if none, use -1 which will check all ROs in the Working Draft
|
||||||
|
string cfg = dv.DocVersionAssociations[0].Config;
|
||||||
|
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg);
|
||||||
|
if (dv.DocVersionAssociations[0]?.MyROFst != null)
|
||||||
|
{
|
||||||
|
if (!int.TryParse(ac.ROUpdate_PrevROFSTID, out origfstid))
|
||||||
|
{
|
||||||
|
origfstid = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
origfstid = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
|
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
|
||||||
SelectedROFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
SelectedROFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||||
|
|
||||||
ROFst newrofst = ROFstInfo.RefreshROFst(_DocVersionConfig.MyDocVersion, SelectedROFst, DoProgressBarRefresh, null);
|
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, null, SelectedROFst, origfstid, SelectedROFst.ROFstID);
|
||||||
|
|
||||||
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
|
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
|
||||||
SelectedROFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
SelectedROFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||||
|
|
||||||
swROUpdate.Close();
|
swROUpdate.Close();
|
||||||
|
|||||||
@@ -124,9 +124,26 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_Xp["ROUpdate", "LoadingFigures"] = value; // save selected value
|
_Xp["ROUpdate", "LoadingFigures"] = value; // save selected value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion // ROUpdate
|
|
||||||
#region ToString
|
[Category("RO Update")]
|
||||||
public override string ToString()
|
[DisplayName("Previous ROFSTID")]
|
||||||
|
[RefreshProperties(RefreshProperties.All)]
|
||||||
|
[Description("Previous ROFSTID")]
|
||||||
|
public string ROUpdate_PrevROFSTID
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string s = _Xp["ROUpdate", "PrevROFSTID"];// get the saved value
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_Xp["ROUpdate", "PrevROFSTID"] = value; // save selected value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion // ROUpdate
|
||||||
|
#region ToString
|
||||||
|
public override string ToString()
|
||||||
{
|
{
|
||||||
string s = _Xp.ToString();
|
string s = _Xp.ToString();
|
||||||
if (s == "<Config/>" || s == "<Config></config>") return string.Empty;
|
if (s == "<Config/>" || s == "<Config></config>") return string.Empty;
|
||||||
|
|||||||
@@ -97,7 +97,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public string appid;
|
public string appid;
|
||||||
public int ID;
|
public int ID;
|
||||||
public int ParentID;
|
public int ParentID;
|
||||||
public rochild[] children;
|
public DateTime? ModDateTime; //C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
|
public rochild[] children;
|
||||||
};
|
};
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@@ -110,7 +111,8 @@ namespace VEPROMS.CSLA.Library
|
|||||||
public string roid; // roid unique identifier
|
public string roid; // roid unique identifier
|
||||||
public string appid; // accessory page id - user specified unique id
|
public string appid; // accessory page id - user specified unique id
|
||||||
public string value; // return value, can be multiple values
|
public string value; // return value, can be multiple values
|
||||||
public rochild[] children;
|
public DateTime? ModDateTime; //C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
|
public rochild[] children;
|
||||||
};
|
};
|
||||||
|
|
||||||
public class RoExtension
|
public class RoExtension
|
||||||
@@ -686,15 +688,19 @@ namespace VEPROMS.CSLA.Library
|
|||||||
//return string.Format("{0,10:#####0.00}", TimeSpan.FromTicks(DateTime.Now.Ticks - dtStart.Ticks).TotalSeconds);
|
//return string.Format("{0,10:#####0.00}", TimeSpan.FromTicks(DateTime.Now.Ticks - dtStart.Ticks).TotalSeconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
//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
|
||||||
|
|
||||||
#region Private Methods
|
#endregion
|
||||||
|
|
||||||
#region (Database Calls)
|
#region Private Methods
|
||||||
|
|
||||||
private bool RofstDataExists(int rofstID)
|
#region (Database Calls)
|
||||||
|
|
||||||
|
private bool RofstDataExists(int rofstID)
|
||||||
{
|
{
|
||||||
int headerStatusID = RofstDataGetHeaderLoadStatus(rofstID);
|
int headerStatusID = RofstDataGetHeaderLoadStatus(rofstID);
|
||||||
|
|
||||||
@@ -888,7 +894,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)
|
private void RofstChildInsert(int rofstID, int id, int parentID, int dbiID, int type, string title, string roid, string appid, string value, DateTime? dt = null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -917,7 +923,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (!string.IsNullOrEmpty(this.RoMissingDefaultValue))
|
if (!string.IsNullOrEmpty(this.RoMissingDefaultValue))
|
||||||
cmd.Parameters.Add(new SqlParameter("@missingDefaultValue", SqlDbType.VarChar)).Value = this.RoMissingDefaultValue;
|
cmd.Parameters.Add(new SqlParameter("@missingDefaultValue", SqlDbType.VarChar)).Value = this.RoMissingDefaultValue;
|
||||||
|
|
||||||
cmd.ExecuteNonQuery();
|
if (dt != null)
|
||||||
|
cmd.Parameters.Add(new SqlParameter("@ModDateTime", SqlDbType.DateTime)).Value = dt;
|
||||||
|
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1299,11 +1308,37 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
//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)";
|
||||||
|
|
||||||
#region (Core/Base logic for RO Values & UnitInfo RO Values)
|
cmd.Parameters.Add(new SqlParameter("@FSTid", SqlDbType.Int)).Value = rofstID;
|
||||||
|
|
||||||
private ROFSTLookup.rochild RofstDataGetChildByRoid(int rofstID, string roid, bool loadChildren = false, bool loadAllChildren = false)
|
return (int) cmd.ExecuteScalar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new DbCslaException("RofstData.RofstGetLatestID", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region (Core/Base logic for RO Values & UnitInfo RO Values)
|
||||||
|
|
||||||
|
private ROFSTLookup.rochild RofstDataGetChildByRoid(int rofstID, string roid, bool loadChildren = false, bool loadAllChildren = false)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -1515,7 +1550,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
myOffset += (7 + slen);
|
myOffset += (7 + slen);
|
||||||
|
|
||||||
ROFSTLookup.rogrp tmpg = LoadGroup(ab, childOffset, tableID);
|
ROFSTLookup.rogrp tmpg = LoadGroup(ab, childOffset, tableID);
|
||||||
|
|
||||||
tmp.ID = tmpg.ID;
|
tmp.ID = tmpg.ID;
|
||||||
tmp.ParentID = tmpg.ParentID;
|
tmp.ParentID = tmpg.ParentID;
|
||||||
@@ -1523,8 +1558,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
tmp.appid = tmpg.appid;
|
tmp.appid = tmpg.appid;
|
||||||
tmp.roid = tableID.ToString("X4") + tmp.ID.ToString("X8");
|
tmp.roid = tableID.ToString("X4") + tmp.ID.ToString("X8");
|
||||||
tmp.children = tmpg.children;
|
tmp.children = tmpg.children;
|
||||||
|
if (tmpg.ModDateTime != null)
|
||||||
|
{
|
||||||
|
tmp.ModDateTime = tmpg.ModDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
for (j = i - 1; j >= 0 && tmp.ID < myGrp.children[j].ID; j--)
|
for (j = i - 1; j >= 0 && tmp.ID < myGrp.children[j].ID; j--)
|
||||||
{
|
{
|
||||||
@@ -1542,7 +1581,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
int slen2 = StringLength(ab, offset + 13 + slen);
|
int slen2 = StringLength(ab, offset + 13 + slen);
|
||||||
myGrp.appid = Encoding.Default.GetString(ab, offset + 13 + slen, slen2);
|
myGrp.appid = Encoding.Default.GetString(ab, offset + 13 + slen, slen2);
|
||||||
|
|
||||||
_dbRoCnt++;
|
//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++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return myGrp;
|
return myGrp;
|
||||||
@@ -1655,7 +1700,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
private void LoadChild(int rofstID, int dbiID, ROFSTLookup.rochild child)
|
private void LoadChild(int rofstID, int dbiID, ROFSTLookup.rochild child)
|
||||||
{
|
{
|
||||||
//Insert Rofst Child
|
//Insert Rofst Child
|
||||||
RofstChildInsert(rofstID, child.ID, child.ParentID, dbiID, child.type, child.title, child.roid, child.appid, child.value);
|
RofstChildInsert(rofstID, child.ID, child.ParentID, dbiID, child.type, child.title, child.roid, child.appid, child.value, child.ModDateTime);
|
||||||
|
|
||||||
//Increment RO Count if RoChild has a return value
|
//Increment RO Count if RoChild has a return value
|
||||||
if (!string.IsNullOrEmpty(child.value)) _curRoCnt++;
|
if (!string.IsNullOrEmpty(child.value)) _curRoCnt++;
|
||||||
|
|||||||
@@ -88,9 +88,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
string itemTitle = Regex.Replace(this.Path, "^..+?\\u0007", "");
|
string itemTitle = Regex.Replace(this.Path, "^..+?\\u0007", "");
|
||||||
itemTitle = itemTitle.Replace("\x11", itemTitle[0] == '\x11' ? "" : " - ").Replace("\\u8209?", "-").Replace(@"\u9586?",@"\");
|
itemTitle = itemTitle.Replace("\x11", itemTitle[0] == '\x11' ? "" : " - ").Replace("\\u8209?", "-").Replace(@"\u9586?",@"\");
|
||||||
return string.Format("{4} item {0} by {1} on {2} @ {3}", this.ActionWhat, this.UserID, this.ActionWhen == DateTime.MinValue ? this.DTS.ToShortDateString() : this.ActionWhen.ToShortDateString(), this.ActionWhen == DateTime.MinValue ? this.DTS.ToShortTimeString() : this.ActionWhen.ToShortTimeString(), itemTitle);
|
return string.Format("{4} item {0} by {1} on {2} @ {3}", this.ActionWhat, this.UserID, this.ActionWhen == DateTime.MinValue ? this.DTS.ToShortDateString() : this.ActionWhen.ToShortDateString(), this.ActionWhen == DateTime.MinValue ? this.DTS.ToString("HH:mm:ss") : this.ActionWhen.ToString("HH:mm:ss"), itemTitle);
|
||||||
//return string.Format("{0} by {1} on {2}", this.DeleteStatus == 0 ? "Changed" : "Deleted", this.UserID, this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"));
|
//return string.Format("{0} by {1} on {2}", this.DeleteStatus == 0 ? "Changed" : "Deleted", this.UserID, this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"));
|
||||||
//return string.Format("{0} - {1} {2}", this.UserID, this.DTS, this.DeleteStatus == 0 ? "" : "Deleted");
|
//return string.Format("{0} - {1} {2}", this.UserID, this.DTS, this.DeleteStatus == 0 ? "" : "Deleted");
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
who = string.Format(" by {0}", this.UserID);
|
who = string.Format(" by {0}", this.UserID);
|
||||||
if (this.DTS != DateTime.Parse("1/1/1980"))
|
if (this.DTS != DateTime.Parse("1/1/1980"))
|
||||||
when = string.Format(" on {0}", this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"));
|
when = string.Format(" on {0}", this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"));
|
||||||
return string.Format("{0}{1}{2}", this.ActionWhat, who, when);
|
return string.Format("{0}{1}{2}", this.ActionWhat, who, when);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return string.Format("{0}{1} deleted by {2} on {3} @ {4}", this.Level == 0 ? "Previous " : this.Level == 1 ? "Next " : "", this.ItemType, this.UserID, this.DTS.ToShortDateString(), this.DTS.ToShortTimeString());
|
return string.Format("{0}{1} deleted by {2} on {3}", this.Level == 0 ? "Previous " : this.Level == 1 ? "Next " : "", this.ItemType, this.UserID, this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"));
|
||||||
// return string.Format("Deleted by {0} on {1} @ {2}", this.UserID, this.DTS.ToShortDateString(), this.DTS.ToShortTimeString());
|
// return string.Format("Deleted by {0} on {1} @ {2}", this.UserID, this.DTS.ToShortDateString(), this.DTS.ToShortTimeString());
|
||||||
// return string.Format("(ItemID: {4}, DeleteID: {5}, {0} by {1} on {2} Level: {3}", this.DeleteStatus == 0 ? "Changed" : "Deleted", this.UserID, this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"), Level.ToString(), this.ItemID.ToString(), this.DeleteStatus.ToString());
|
// return string.Format("(ItemID: {4}, DeleteID: {5}, {0} by {1} on {2} Level: {3}", this.DeleteStatus == 0 ? "Changed" : "Deleted", this.UserID, this.DTS.ToString("MM/dd/yyyy @ HH:mm:ss"), Level.ToString(), this.ItemID.ToString(), this.DeleteStatus.ToString());
|
||||||
// return string.Format("Level: {3}, {0} - {1} {2}", this.UserID, this.DTS, this.DeleteStatus == 0 ? "" : "Deleted", this.Level.ToString());
|
// return string.Format("Level: {3}, {0} - {1} {2}", this.UserID, this.DTS, this.DeleteStatus == 0 ? "" : "Deleted", this.Level.ToString());
|
||||||
|
|||||||
@@ -1093,8 +1093,17 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// B2022-026 RO Memory Reduction code - pass in ROFstInfo
|
|
||||||
internal static void MyRefreshReferenceObjects(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, DocVersionInfo docVersionInfo, ROFstInfo origROFst)
|
//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)
|
||||||
{
|
{
|
||||||
if (itemInfo.MyContent.ContentPartCount > 0)
|
if (itemInfo.MyContent.ContentPartCount > 0)
|
||||||
{
|
{
|
||||||
@@ -1219,31 +1228,47 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Debug Code
|
//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>();
|
||||||
|
|
||||||
//private static void ShowDifference(string oldText, string newText)
|
foreach (DataRow r in Data_GetItemsWithChangedROs(docversionid, origfstid, newfstid).Rows)
|
||||||
//{
|
{
|
||||||
// string nt = newText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
|
using (ItemInfo itm = Get((int)r["ItemID"]))
|
||||||
// string ot = oldText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
|
{
|
||||||
// ShowText("OldText", ot);
|
lst.Add(itm);
|
||||||
// ShowText("NewText", nt);
|
}
|
||||||
//}
|
}
|
||||||
//private static void ShowText(string title, string newText)
|
|
||||||
//{
|
|
||||||
// StringBuilder sb = new StringBuilder();
|
|
||||||
// foreach (char c in newText)
|
|
||||||
// {
|
|
||||||
// if(c<' ' || c> '\x7F')
|
|
||||||
// sb.Append(string.Format("\\x{0:X2}",((int) c)));
|
|
||||||
// else
|
|
||||||
// sb.Append(c);
|
|
||||||
// }
|
|
||||||
// Console.WriteLine("{0}='{1}'",title,sb.ToString());
|
|
||||||
//}
|
|
||||||
|
|
||||||
#endregion // debug
|
return lst;
|
||||||
|
}
|
||||||
|
|
||||||
internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
|
#region Debug Code
|
||||||
|
|
||||||
|
//private static void ShowDifference(string oldText, string newText)
|
||||||
|
//{
|
||||||
|
// string nt = newText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
|
||||||
|
// string ot = oldText.Replace(@"\u8209?", "-").Replace(@"\u160?", " ").Replace("\xA0", " ");
|
||||||
|
// ShowText("OldText", ot);
|
||||||
|
// ShowText("NewText", nt);
|
||||||
|
//}
|
||||||
|
//private static void ShowText(string title, string newText)
|
||||||
|
//{
|
||||||
|
// StringBuilder sb = new StringBuilder();
|
||||||
|
// foreach (char c in newText)
|
||||||
|
// {
|
||||||
|
// if(c<' ' || c> '\x7F')
|
||||||
|
// sb.Append(string.Format("\\x{0:X2}",((int) c)));
|
||||||
|
// else
|
||||||
|
// sb.Append(c);
|
||||||
|
// }
|
||||||
|
// Console.WriteLine("{0}='{1}'",title,sb.ToString());
|
||||||
|
//}
|
||||||
|
|
||||||
|
#endregion // debug
|
||||||
|
|
||||||
|
internal static void SetParentSectionAndDocVersionPageNum(ItemInfo itemInfo, IVEDrillDownReadOnly itemParent, SectionInfo sectionInfo, ProcedureInfo procInfo, DocVersionInfo docVersionInfo, TransitionLookup tranLookup)
|
||||||
{
|
{
|
||||||
if (itemInfo.MyContent.ContentPartCount > 0)
|
if (itemInfo.MyContent.ContentPartCount > 0)
|
||||||
{
|
{
|
||||||
@@ -1890,10 +1915,44 @@ namespace VEPROMS.CSLA.Library
|
|||||||
foreach (ItemInfo itemInfo in partInfo.MyItems)
|
foreach (ItemInfo itemInfo in partInfo.MyItems)
|
||||||
itemInfo.SpinThroughChildren();
|
itemInfo.SpinThroughChildren();
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
#region LoadAtOnce
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
// Method to Get Item and children
|
private static DataTable Data_GetItemsWithChangedROs(int docversionid, int origfstid, int newfstid)
|
||||||
public static ItemInfo GetItemAndChildren(int? itemID, int? parentID)
|
{
|
||||||
|
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
|
||||||
|
public static ItemInfo GetItemAndChildren(int? itemID, int? parentID)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -8064,6 +8123,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
set { _ChangeBarDate = value; }
|
set { _ChangeBarDate = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//C2026-021 Expand Functionality of Viewing Mode
|
||||||
|
public void ResetChangeBar() => _ChangeBarDate = null;
|
||||||
|
|
||||||
public Dictionary<int, ItemInfo> MyLookup = null;
|
public Dictionary<int, ItemInfo> MyLookup = null;
|
||||||
public override void SetupTags()
|
public override void SetupTags()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -61,57 +61,47 @@ namespace VEPROMS.CSLA.Library
|
|||||||
throw new DbCslaException("Pdf.DataPortal_Delete", ex);
|
throw new DbCslaException("Pdf.DataPortal_Delete", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// used to remove word section PDFs to force ROs to be updated when printed or saved
|
|
||||||
public static void DeleteAllDocVersion(int versionID)
|
|
||||||
{
|
|
||||||
if (!CanDeleteObject())
|
|
||||||
throw new System.Security.SecurityException("User not authorized to remove a Pdf");
|
|
||||||
try
|
|
||||||
{
|
|
||||||
DataPortal.Delete(new VersionIDCriteria(versionID));
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
throw new DbCslaException("Error on Pdf.DeleteAllDocVersion", ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
[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)
|
|
||||||
{
|
|
||||||
using (SqlCommand cm = cn.CreateCommand())
|
|
||||||
{
|
|
||||||
cm.CommandType = CommandType.StoredProcedure;
|
|
||||||
cm.CommandTimeout = Database.SQLTimeout;
|
|
||||||
cm.CommandText = "deleteAllDocVersionPdfs";
|
|
||||||
cm.Parameters.AddWithValue("@VersionID", criteria.VersionID);
|
|
||||||
cm.ExecuteNonQuery();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Pdf.DataPortal_Delete", ex);
|
|
||||||
_ErrorMessage = ex.Message;
|
|
||||||
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)
|
||||||
|
{
|
||||||
|
if (!CanDeleteObject())
|
||||||
|
throw new System.Security.SecurityException("User not authorized to remove a Pdf");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DeleteWithNewROs(versionID, origfstid, newfstid);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new DbCslaException("Error on Pdf.DeleteAllDocVersion", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static private void DeleteWithNewROs(int docversionID, int origfstid, int newfstid)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
|
{
|
||||||
|
using (SqlCommand cm = cn.CreateCommand())
|
||||||
|
{
|
||||||
|
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.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (_MyLog.IsErrorEnabled) _MyLog.Error("Pdf.DeleteWithNewROs", ex);
|
||||||
|
throw new DbCslaException("Pdf.DeleteWithNewROs", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public partial class PdfInfo
|
public partial class PdfInfo
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -225,41 +225,62 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// B2022-026 RO Memory Reduction code - pass in the ROFstInfo
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
public static int RefreshROFst(DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus, ROFstInfo origROFst)
|
// Refresh at item level
|
||||||
{
|
public static int RefreshROFstAtItemLevel(DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, System.Windows.Forms.TextBox tbStatus, ROFstInfo localROFst, int origfstid, int newfstid)
|
||||||
int fixedROs = 0;
|
{
|
||||||
|
int fixedROs = 0;
|
||||||
|
|
||||||
if (dvi.DocVersionConfig.SelectedSlave <= 0)
|
if (dvi.DocVersionConfig.SelectedSlave <= 0)
|
||||||
{
|
{
|
||||||
myProgressBarRefresh(1, 100, "Update MS Word ROs");
|
// 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);
|
||||||
|
|
||||||
Pdf.DeleteAllDocVersion(dvi.VersionID); // remove word section PDFs to force update of RO values when printed
|
//Loop Through ROs in this docversion that are different than the previous fst
|
||||||
int i = 0;
|
myProgressBarRefresh(50, 100, "Updating ROs In PROMS Steps In Progress");
|
||||||
|
int i = 0;
|
||||||
|
List<ItemInfo> list = ItemInfo.GetItemInfoWithChangedROs(dvi.VersionID, origfstid, newfstid);
|
||||||
|
foreach (ItemInfo itm in list)
|
||||||
|
{
|
||||||
|
DateTime start = DateTime.Now;
|
||||||
|
|
||||||
foreach (ProcedureInfo proc in dvi.Procedures)
|
ItemInfo.ResetROCounters();
|
||||||
{
|
myProgressBarRefresh(++i, list.Count, string.Format("{0} ({1}/{2} ROs {3})", itm.MyProcedure.DisplayNumber, i, list.Count, fixedROs));
|
||||||
DateTime start = DateTime.Now;
|
ItemInfo.RefreshReferenceObjects(itm, localROFst);
|
||||||
|
fixedROs += ItemInfo.ROFixCount;
|
||||||
|
|
||||||
ProcedureInfo.ResetROCounters();
|
TimeSpan ts = DateTime.Now - start;
|
||||||
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));
|
||||||
|
}
|
||||||
|
|
||||||
if (tbStatus != null)
|
//Update the DocVersion Associations to link to the new RO FST id and current date/time
|
||||||
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));
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return fixedROs;
|
// 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 fixedROs;
|
||||||
|
}
|
||||||
|
|
||||||
//C2022-028 for Admin tool to check for bad RO links
|
//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
|
//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)
|
public static int CheckROLinksInThisProcedure(ProcedureInfo proc, System.Windows.Forms.TextBox tbStatus)
|
||||||
{
|
{
|
||||||
int FoundBadROLinks = 0;
|
int FoundBadROLinks = 0;
|
||||||
DocVersionInfo dvi = DocVersionInfo.Get(proc.MyDocVersion.VersionID);
|
DocVersionInfo dvi = DocVersionInfo.Get(proc.MyDocVersion.VersionID);
|
||||||
@@ -291,34 +312,6 @@ 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");
|
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>
|
/// <summary>
|
||||||
/// Updates an ro.fst into a sql database.
|
/// Updates an ro.fst into a sql database.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -335,7 +328,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
if (myProgressBarRefresh != null) myProgressBarRefresh(0, 100, "Starting Update");
|
if (myProgressBarRefresh != null) myProgressBarRefresh(0, 100, "Starting Update");
|
||||||
|
|
||||||
DirectoryInfo di = new DirectoryInfo(rdi.FolderPath);
|
int origFSTid = origROFst.ROFstID;
|
||||||
|
|
||||||
|
DirectoryInfo di = new DirectoryInfo(rdi.FolderPath);
|
||||||
string rofstfilepath = rdi.FolderPath + @"\ro.fst";
|
string rofstfilepath = rdi.FolderPath + @"\ro.fst";
|
||||||
FileStream fsIn = new FileStream(rofstfilepath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
FileStream fsIn = new FileStream(rofstfilepath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||||
FileInfo rofstFI = new FileInfo(rofstfilepath);
|
FileInfo rofstFI = new FileInfo(rofstfilepath);
|
||||||
@@ -361,8 +356,9 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
docver.DocVersionAssociations[0].MyROFst = rofst;
|
docver.DocVersionAssociations[0].MyROFst = rofst;
|
||||||
SetAssociationLastCompleted(docver, string.Empty);
|
SetAssociationLastCompleted(docver, string.Empty);
|
||||||
|
SetPrevFSTID(docver, origFSTid); // //C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
|
|
||||||
return rofst;
|
return rofst;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read in the rofst & make the rofst record.
|
// Read in the rofst & make the rofst record.
|
||||||
@@ -384,7 +380,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// Keep a list of ROIDs for Images that have changed.
|
// Keep a list of ROIDs for Images that have changed.
|
||||||
List<string> MyChangedFigureROIDs = UpdateROFigures(rdi, myProgressBarRefresh, rofst, rodb, myLookup, docver);
|
List<string> MyChangedFigureROIDs = UpdateROFigures(rdi, myProgressBarRefresh, rofst, rodb, myLookup, docver);
|
||||||
|
|
||||||
return rofst;
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
|
SetPrevFSTID(docver, origFSTid);
|
||||||
|
|
||||||
|
return rofst;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -484,8 +483,22 @@ namespace VEPROMS.CSLA.Library
|
|||||||
docver.Save();
|
docver.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Place the status of loading the RO Figures when updating RO Values
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
private static void SetAssociationROFiguresLoading(DocVersion docver, string value)
|
// Place the previous ROFSTID in the config in case network error or computer crashes while updating RO Values
|
||||||
|
private static void SetPrevFSTID(DocVersion docver, int value)
|
||||||
|
{
|
||||||
|
if (docver.DocVersionAssociations[0]?.MyROFst != null && value != -1)
|
||||||
|
{
|
||||||
|
string cfg = docver.DocVersionAssociations[0].Config;
|
||||||
|
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg);
|
||||||
|
ac.ROUpdate_PrevROFSTID = value.ToString();
|
||||||
|
docver.DocVersionAssociations[0].Config = ac.ToString();
|
||||||
|
docver.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Place the status of loading the RO Figures when updating RO Values
|
||||||
|
private static void SetAssociationROFiguresLoading(DocVersion docver, string value)
|
||||||
{
|
{
|
||||||
string cfg = docver.DocVersionAssociations[0].Config;
|
string cfg = docver.DocVersionAssociations[0].Config;
|
||||||
|
|
||||||
@@ -670,188 +683,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void UpdateROValuesText(ROFstInfo origROFstInfo, ROFst newROFst, DocVersionInfo dvi, ROFstInfoProgressBarRefresh myProgressBarRefresh, List<string> MyChangedFigureROIDs)
|
private static DateTime ShowDuration(DateTime dtLast, string message)
|
||||||
{
|
|
||||||
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;
|
DateTime dtNext = DateTime.Now;
|
||||||
Console.WriteLine("{0,10:#####0.00},'{1}'", TimeSpan.FromTicks(dtNext.Ticks - dtLast.Ticks).TotalSeconds, message);
|
Console.WriteLine("{0,10:#####0.00},'{1}'", TimeSpan.FromTicks(dtNext.Ticks - dtLast.Ticks).TotalSeconds, message);
|
||||||
@@ -1099,10 +931,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ROFstInfoROTableUpdateEventArgs
|
public class ROFstInfoROTableUpdateEventArgs
|
||||||
{
|
{
|
||||||
private string _ROText;
|
private string _ROText;
|
||||||
public string ROText
|
public string ROText
|
||||||
@@ -1252,5 +1084,5 @@ namespace VEPROMS.CSLA.Library
|
|||||||
this.RaiseListChangedEvents = true;
|
this.RaiseListChangedEvents = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ namespace Volian.Controls.Library
|
|||||||
names.Add(dcfg.Unit_Name);
|
names.Add(dcfg.Unit_Name);
|
||||||
}
|
}
|
||||||
dcfg.SelectedSlave = 0;
|
dcfg.SelectedSlave = 0;
|
||||||
// string[] names = dcfg.Unit_Name.Split(',');
|
|
||||||
int apple = -1;
|
int apple = -1;
|
||||||
if(_MyDisplayTabItem.MyStepTabPanel != null)
|
if(_MyDisplayTabItem.MyStepTabPanel != null)
|
||||||
apple = _MyDisplayTabItem.MyStepTabPanel.MyStepPanel.ApplDisplayMode;
|
apple = _MyDisplayTabItem.MyStepTabPanel.MyStepPanel.ApplDisplayMode;
|
||||||
@@ -55,7 +54,7 @@ namespace Volian.Controls.Library
|
|||||||
foreach (string name in names)
|
foreach (string name in names)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
AddViewMode(name.Trim(), i.ToString(), apple == i);
|
AddViewMode($"{name.Trim()} (View Only)", i.ToString(), apple == i);
|
||||||
}
|
}
|
||||||
|
|
||||||
AddItemMode("All", "-1", ref gpSubItem);
|
AddItemMode("All", "-1", ref gpSubItem);
|
||||||
@@ -96,9 +95,6 @@ namespace Volian.Controls.Library
|
|||||||
DevComponents.DotNetBar.Controls.GroupPanel gpSubItem;
|
DevComponents.DotNetBar.Controls.GroupPanel gpSubItem;
|
||||||
gpSubItem = new DevComponents.DotNetBar.Controls.GroupPanel
|
gpSubItem = new DevComponents.DotNetBar.Controls.GroupPanel
|
||||||
{
|
{
|
||||||
//
|
|
||||||
// gpSubItem
|
|
||||||
//
|
|
||||||
AutoSize = true,
|
AutoSize = true,
|
||||||
AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink,
|
AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink,
|
||||||
CanvasColor = System.Drawing.SystemColors.Control,
|
CanvasColor = System.Drawing.SystemColors.Control,
|
||||||
@@ -130,42 +126,11 @@ namespace Volian.Controls.Library
|
|||||||
set { _MyApplicability = value; }
|
set { _MyApplicability = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
//private ProcedureInfo _MyProcedureInfo;
|
//C2026-021 Expand Functionality of Viewing Mode
|
||||||
//public ProcedureInfo MyProcedureInfo
|
public bool ShowItemSelection = true;
|
||||||
//{
|
public void SetEnableDisableItemSelection(bool value) => gpItem.Enabled = ShowItemSelection = value;
|
||||||
//get { return _MyProcedureInfo; }
|
|
||||||
//set
|
private void AddItemMode(string name, string value, ref DevComponents.DotNetBar.Controls.GroupPanel gpSubItem)
|
||||||
//{
|
|
||||||
// _MyProcedureInfo = value;
|
|
||||||
// if (_MyProcedureInfo != null && _MyProcedureInfo.IsProcedure)
|
|
||||||
// {
|
|
||||||
// DocVersionConfig cfg = new DocVersionConfig(_MyProcedureInfo.MyDocVersion);
|
|
||||||
// if (cfg.Unit_Name == string.Empty)
|
|
||||||
// this.Visible = false;
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// string[] names = cfg.Unit_Name.Split(',');
|
|
||||||
// gpMode.Controls.Clear();
|
|
||||||
// gpItem.Controls.Clear();
|
|
||||||
// MyCheckBoxes.Clear();
|
|
||||||
// AddViewMode("Master", "-1", true);
|
|
||||||
// int i = 0;
|
|
||||||
// foreach (string name in names)
|
|
||||||
// {
|
|
||||||
// AddViewMode(name.Trim(), (++i).ToString());
|
|
||||||
// }
|
|
||||||
// AddItemMode("All", "-1");
|
|
||||||
// i = 0;
|
|
||||||
// foreach (string name in names)
|
|
||||||
// AddItemMode(name.Trim(), (++i).ToString());
|
|
||||||
// AddItemMode("None", "0");
|
|
||||||
// //if(!this.Visible)
|
|
||||||
// // this.Visible = true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
private void AddItemMode(string name, string value, ref DevComponents.DotNetBar.Controls.GroupPanel gpSubItem)
|
|
||||||
{
|
{
|
||||||
CheckBox cb = new CheckBox();
|
CheckBox cb = new CheckBox();
|
||||||
cb.BackColor = Color.Transparent;
|
cb.BackColor = Color.Transparent;
|
||||||
@@ -251,18 +216,6 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//IItemConfig cfg = MyItemInfo.MyConfig as IItemConfig;
|
|
||||||
//cfg.MasterSlave_Applicability.SetFlags(MyApplicability);
|
|
||||||
//Content c = Content.Get(MyItemInfo.MyContent.ContentID);
|
|
||||||
//c.Save();
|
|
||||||
//foreach (TransitionInfo ti in MyItemInfo.ItemTransitions_ToID)
|
|
||||||
//{
|
|
||||||
// if (!ti.MyItemToID.IsApplicable(MyApplicability))
|
|
||||||
// {
|
|
||||||
// MessageBox.Show("you can't do this");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
List<InvalidTransition> invalidTrans = WillTransitionsBeValidCommand.Execute(MyItemInfo.ItemID, MyApplicability);
|
List<InvalidTransition> invalidTrans = WillTransitionsBeValidCommand.Execute(MyItemInfo.ItemID, MyApplicability);
|
||||||
// B2021-149: for Procedure level PC/PC, continue processing if all 'invalid' transitions are internal (query used
|
// B2021-149: for Procedure level PC/PC, continue processing if all 'invalid' transitions are internal (query used
|
||||||
// return internal and external for the procedure level)
|
// return internal and external for the procedure level)
|
||||||
@@ -307,20 +260,6 @@ namespace Volian.Controls.Library
|
|||||||
// C2021 - 027: Procedure level PC/PC - checkbox for applicability changed, fix ribbon's menus
|
// C2021 - 027: Procedure level PC/PC - checkbox for applicability changed, fix ribbon's menus
|
||||||
if (MyItemInfo.IsProcedure) _MyDisplayTabItem.MyStepTabPanel.MyStepTabRibbon.SetParentChildCreatePDFButton(MyItemInfo.MyDocVersion.UnitNames, MyItemInfo);
|
if (MyItemInfo.IsProcedure) _MyDisplayTabItem.MyStepTabPanel.MyStepTabRibbon.SetParentChildCreatePDFButton(MyItemInfo.MyDocVersion.UnitNames, MyItemInfo);
|
||||||
|
|
||||||
//using (Content cnt = Content.Get(MyItemInfo.MyContent.ContentID))
|
|
||||||
//{
|
|
||||||
// cnt.DTS = DateTime.Now;
|
|
||||||
// cnt.UserID = Volian.Base.Library.VlnSettings.UserID;
|
|
||||||
// //cnt.Save();
|
|
||||||
//}
|
|
||||||
|
|
||||||
//using (Step s = Step.Get(MyItemInfo.ItemID))
|
|
||||||
//{
|
|
||||||
// IItemConfig cfg = new StepConfig(s);
|
|
||||||
// cfg.MasterSlave_Applicability = new Volian.Base.Library.BigNum(MyApplicability);
|
|
||||||
// s.MyContent.Config = cfg.ToString();
|
|
||||||
// s.Save();
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
private void BtnApplicabilitychg_Click(object sender, System.EventArgs e)
|
private void BtnApplicabilitychg_Click(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -550,7 +489,7 @@ namespace Volian.Controls.Library
|
|||||||
void DisplayApplicability_VisibleChanged(object sender, EventArgs e)
|
void DisplayApplicability_VisibleChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
MyItemInfo = MyItemInfo;
|
MyItemInfo = MyItemInfo;
|
||||||
gpItem.Enabled = UserInfo.CanEdit(MyUserInfo,(MyItemInfo == null) ? null : MyItemInfo.MyDocVersion); //Can Change Applicability
|
gpItem.Enabled = ShowItemSelection && UserInfo.CanEdit(MyUserInfo,(MyItemInfo == null) ? null : MyItemInfo.MyDocVersion); //Can Change Applicability
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,11 +59,11 @@ namespace Volian.Controls.Library
|
|||||||
private DisplayTags displayTags;
|
private DisplayTags displayTags;
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
public ProgressBarItem ProgressBar
|
public ProgressBarItem ProgressBar
|
||||||
{
|
{
|
||||||
get { return _progressBar; }
|
get { return _progressBar; }
|
||||||
set { _progressBar = value; }
|
set { _progressBar = value; }
|
||||||
@@ -89,7 +89,10 @@ namespace Volian.Controls.Library
|
|||||||
(_myRTB != null && (_myRTB.IsRoTable != lastRTBwasROTable || _myRTB.IsRoFigure != lastRTBwasROFigure)); }
|
(_myRTB != null && (_myRTB.IsRoTable != lastRTBwasROTable || _myRTB.IsRoFigure != lastRTBwasROFigure)); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public ROFstInfo MyROFST
|
//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; }
|
get { return _myROFST; }
|
||||||
set
|
set
|
||||||
@@ -128,16 +131,22 @@ namespace Volian.Controls.Library
|
|||||||
// B2022-135 Submitted for Admin Tools (Check RO Links tool)
|
// B2022-135 Submitted for Admin Tools (Check RO Links tool)
|
||||||
if (_docVersionInfo == null || _docVersionInfo != value || _docVersionInfo.VersionID != value.VersionID)
|
if (_docVersionInfo == null || _docVersionInfo != value || _docVersionInfo.VersionID != value.VersionID)
|
||||||
{
|
{
|
||||||
_docVersionInfo = value;
|
//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))
|
if (_myRTB != null && (_docVersionInfo == null || _docVersionInfo.VersionID != _myRTB.MyDVI.VersionID))
|
||||||
{
|
{
|
||||||
_docVersionInfo = _myRTB.MyDVI;
|
_docVersionInfo = _myRTB.MyDVI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures.
|
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures.
|
||||||
_currDocVersionID = (_docVersionInfo != null) ? (int?)_docVersionInfo.VersionID : null;
|
_currDocVersionID = (_docVersionInfo != null) ? (int?)_docVersionInfo.VersionID : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +210,11 @@ namespace Volian.Controls.Library
|
|||||||
// B2022-098: [JPR] ROs not being resolved in Word Sections
|
// B2022-098: [JPR] ROs not being resolved in Word Sections
|
||||||
CurROLink = null;
|
CurROLink = null;
|
||||||
_savCurROLink = 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)
|
else if(_myRTB != value)
|
||||||
{
|
{
|
||||||
if (_myRTB != null)
|
if (_myRTB != null)
|
||||||
@@ -221,9 +234,9 @@ namespace Volian.Controls.Library
|
|||||||
CurROLink = null;
|
CurROLink = null;
|
||||||
_savCurROLink = null;
|
_savCurROLink = null;
|
||||||
}
|
}
|
||||||
// B2023-004 assign the doc version info associated with the current RTB (rich text box)
|
// B2023-004 assign the doc version info associated with the current RTB (rich text box)
|
||||||
// this fixes an issue where unit designators could not be linked in the step edit (BNPP data)
|
// this fixes an issue where unit designators could not be linked in the step edit (BNPP data)
|
||||||
MyDvi = _myRTB.MyItemInfo.MyDocVersion;
|
MyDvi = _myRTB.MyItemInfo.MyDocVersion;
|
||||||
|
|
||||||
MyROFST = (_myRTB.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0) ? _myRTB.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst : null;
|
MyROFST = (_myRTB.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0) ? _myRTB.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst : null;
|
||||||
}
|
}
|
||||||
@@ -251,11 +264,13 @@ namespace Volian.Controls.Library
|
|||||||
set { _myUserInfo = value; }
|
set { _myUserInfo = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
public SessionInfo MySessionInfo { get; set; }
|
||||||
|
|
||||||
#region Constructors
|
#endregion
|
||||||
|
|
||||||
public DisplayRO()
|
#region Constructors
|
||||||
|
|
||||||
|
public DisplayRO()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
@@ -277,48 +292,62 @@ namespace Volian.Controls.Library
|
|||||||
// Initialize the DisplayTags object
|
// Initialize the DisplayTags object
|
||||||
displayTags = new DisplayTags();
|
displayTags = new DisplayTags();
|
||||||
|
|
||||||
_progressBar = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
#region Event Handlers
|
||||||
|
#region (Progress Bar)
|
||||||
|
|
||||||
#region Event Handlers
|
private string InitialProgressBarMessage
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (ProgressBar == null) return;
|
||||||
|
ProgressBar.Value = 0;
|
||||||
|
ProgressBar.Maximum = 100;
|
||||||
|
ProgressBar.Text = value;
|
||||||
|
Application.DoEvents();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private string FinalProgressBarMessage
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (ProgressBar == null) return;
|
||||||
|
ProgressBar.Text = value;
|
||||||
|
ProgressBar.Maximum = 100;
|
||||||
|
ProgressBar.Value = 100;
|
||||||
|
Application.DoEvents();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void DoProgressBarRefresh(int value, int max, string text)
|
||||||
|
{
|
||||||
|
if (ProgressBar == null) return;
|
||||||
|
ProgressBar.Maximum = max;
|
||||||
|
ProgressBar.Value = value;
|
||||||
|
ProgressBar.Text = text;
|
||||||
|
Application.DoEvents();
|
||||||
|
}
|
||||||
|
|
||||||
#region (Progress Bar)
|
#endregion
|
||||||
|
|
||||||
private void ProgressBar_Initialize(int max, string desc)
|
#region (RTB)
|
||||||
{
|
|
||||||
if (_progressBar != null)
|
|
||||||
{
|
|
||||||
_progressBar.Maximum = max;
|
|
||||||
_progressBar.Text = desc;
|
|
||||||
_progressBar.TextVisible = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProgressBar_SetValue(int curval)
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
{
|
// DisplayTab was changed
|
||||||
if (_progressBar != null)
|
// need to clear the RTB selected
|
||||||
{
|
// without resetting the DVI or FST
|
||||||
_progressBar.Value = curval;
|
// (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;
|
||||||
|
}
|
||||||
|
|
||||||
private void ProgressBar_Clear()
|
public void MyRTB_LinkChanged(object sender, StepPanelLinkEventArgs args)
|
||||||
{
|
|
||||||
if (_progressBar != null)
|
|
||||||
{
|
|
||||||
_progressBar.Text = string.Empty;
|
|
||||||
_progressBar.Maximum = 0;
|
|
||||||
_progressBar.Value = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region (RTB)
|
|
||||||
|
|
||||||
public void MyRTB_LinkChanged(object sender, StepPanelLinkEventArgs args)
|
|
||||||
{
|
{
|
||||||
CurROLink = null;
|
CurROLink = null;
|
||||||
if (MyRTB.MyLinkText != null) CurROLink = args.MyLinkText.MyRoUsageInfo;
|
if (MyRTB.MyLinkText != null) CurROLink = args.MyLinkText.MyRoUsageInfo;
|
||||||
@@ -565,55 +594,106 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void lbFound_SelectedValueChanged(object sender, EventArgs e)
|
private void lbFound_SelectedValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (lbFound.Visible && lbFound.SelectedIndex >= 0 && lbFound.SelectedValue != null)
|
||||||
|
{
|
||||||
|
ExpandNode(Convert.ToString(lbFound.SelectedValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#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)
|
||||||
{
|
{
|
||||||
if (lbFound.Visible && lbFound.SelectedIndex >= 0 && lbFound.SelectedValue != null)
|
bool updatedROs = false;
|
||||||
{
|
|
||||||
ExpandNode(Convert.ToString(lbFound.SelectedValue));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Public Methods
|
|
||||||
|
|
||||||
public void LoadTree(bool forceReload = false)
|
|
||||||
{
|
|
||||||
if (MyROFST == null)
|
if (MyROFST == null)
|
||||||
{
|
{
|
||||||
tvROFST.Nodes.Clear();
|
tvROFST.Nodes.Clear();
|
||||||
lbFound.Visible = false;
|
lbFound.Visible = false;
|
||||||
return;
|
return updatedROs;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (forceReload || RoTreeNeedsReloaded || tvROFST.Nodes == null || tvROFST.Nodes.Count <= 0)
|
if (changedDocVersion || forceReload || RoTreeNeedsReloaded || tvROFST.Nodes == null || tvROFST.Nodes.Count <= 0)
|
||||||
{
|
{
|
||||||
//B2025-008
|
//C2026-008 Re-Architect RO.FST to include RO Modification date/time
|
||||||
//in cases where a RO table is clicked on
|
//check if newer data - if there is, check if user wants to update data
|
||||||
//it will refresh the list
|
int fstid = MyROFSTLookup.GetNewerFSTID();
|
||||||
//temp store what the ROID was before the list refreshes
|
int origfstid = MyROFSTLookup.RofstID;
|
||||||
//so can go to it after the refresh
|
|
||||||
string tmpROID = CurROLink?.ROID;
|
|
||||||
|
|
||||||
ROFSTLookup.rodbi[] dbs = MyROFSTLookup.GetRODatabaseList(true);
|
if (_docVersionInfo != null && fstid != -1 && fstid != MyROFSTLookup.RofstID)
|
||||||
|
{
|
||||||
|
string message = string.Empty;
|
||||||
|
if (_progressBar?.Text != "Cannot check-out Working Draft" && !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 (!MySessionInfo.CanCheckOutItem(_docVersionInfo.VersionID, CheckOutType.DocVersion, ref message))
|
||||||
|
{
|
||||||
|
//do nothing - is still checked out
|
||||||
|
}
|
||||||
|
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
|
||||||
|
//temp store what the ROID was before the list refreshes
|
||||||
|
//so can go to it after the refresh
|
||||||
|
string tmpROID = CurROLink?.ROID;
|
||||||
|
|
||||||
|
ROFSTLookup.rodbi[] dbs = MyROFSTLookup?.GetRODatabaseList(true);
|
||||||
|
|
||||||
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures.
|
// 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
|
// 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
|
// the clear nodes code below has to be after the GetRODatabaseList database call because of races conditions in the code
|
||||||
tvROFST.Nodes.Clear();
|
tvROFST.Nodes.Clear();
|
||||||
ResetSearch(); //B2023-050 need to reset the SaveRO, and any RO info that was selected last time the tree was loaded
|
ResetSearch(); //B2023-050 need to reset the SaveRO, and any RO info that was selected last time the tree was loaded
|
||||||
for (int i = 0; i < dbs.Length; i++)
|
if (dbs != null)
|
||||||
{
|
{
|
||||||
ROFSTLookup.rodbi db = dbs[i];
|
for (int i = 0; i < dbs.Length; i++)
|
||||||
|
{
|
||||||
|
ROFSTLookup.rodbi db = dbs[i];
|
||||||
|
|
||||||
TreeNode tn = new TreeNode(db.dbiTitle);
|
TreeNode tn = new TreeNode(db.dbiTitle);
|
||||||
tn.Tag = db;
|
tn.Tag = db;
|
||||||
tvROFST.Nodes.Add(tn);
|
tvROFST.Nodes.Add(tn);
|
||||||
|
|
||||||
AddDummyGroup(db, tn);
|
AddDummyGroup(db, tn);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_currRofstID = (IsRofstValid) ? (int?)_myROFST.ROFstID : null;
|
_currRofstID = (IsRofstValid) ? (int?)_myROFST.ROFstID : null;
|
||||||
_currDocVersionID = null;
|
_currDocVersionID = null;
|
||||||
@@ -621,14 +701,20 @@ namespace Volian.Controls.Library
|
|||||||
if(_docVersionInfo != null) _currDocVersionID = (int?)_docVersionInfo.VersionID;
|
if(_docVersionInfo != null) _currDocVersionID = (int?)_docVersionInfo.VersionID;
|
||||||
|
|
||||||
if (tmpROID != null) ExpandNode(ROFSTLookup.FormatRoidKey(tmpROID, true));
|
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();
|
var unitInfoNode = tvROFST.Nodes.Cast<TreeNode>().Where(x => x.Text == "Unit Information").FirstOrDefault();
|
||||||
|
|
||||||
if ((ROTypeFilter == E_ROValueType.Text || ROTypeFilter == E_ROValueType.All) && this.MyDvi != null && this.MyDvi.MultiUnitCount > 1)
|
if ((ROTypeFilter == E_ROValueType.Text || ROTypeFilter == E_ROValueType.All) && this.MyDvi != null && this.MyDvi.MultiUnitCount > 1)
|
||||||
{
|
{
|
||||||
// Add Unit Information Database if it doesn't exist
|
// Add Unit Information Database if it doesn't exist
|
||||||
if (unitInfoNode == null)
|
if (unitInfoNode == null && MyROFSTLookup != null)
|
||||||
{
|
{
|
||||||
TreeNode tnn = tvROFST.Nodes.Add("Unit Information");
|
TreeNode tnn = tvROFST.Nodes.Add("Unit Information");
|
||||||
TreeNode cn = null;
|
TreeNode cn = null;
|
||||||
@@ -672,7 +758,9 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
|
|
||||||
_curROTypeFilter = _roTypeFilter;
|
_curROTypeFilter = _roTypeFilter;
|
||||||
}
|
|
||||||
|
return updatedROs;
|
||||||
|
}
|
||||||
|
|
||||||
public void SetFindDocROButton(bool enabled)
|
public void SetFindDocROButton(bool enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -145,12 +145,6 @@ namespace Volian.Controls.Library
|
|||||||
return (verIdList.Count > 1);
|
return (verIdList.Count > 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//public event ItemSelectedChangedEvent OpenEnhancedDocument;
|
|
||||||
//public void OnOpenEnhancedDocument(ItemSelectedChangedEventArgs args)
|
|
||||||
//{
|
|
||||||
// if (OpenEnhancedDocument != null)
|
|
||||||
// OpenEnhancedDocument(this, args);
|
|
||||||
//}
|
|
||||||
public event ItemSelectedChangedEvent OpenInSeparateWindow;
|
public event ItemSelectedChangedEvent OpenInSeparateWindow;
|
||||||
public void OnOpenInSeparateWindow(ItemSelectedChangedEventArgs args)
|
public void OnOpenInSeparateWindow(ItemSelectedChangedEventArgs args)
|
||||||
{
|
{
|
||||||
@@ -194,15 +188,15 @@ namespace Volian.Controls.Library
|
|||||||
CopyStepSelected(this, args);
|
CopyStepSelected(this, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is a lookup table for all of the DisplayTabItems that are currently open
|
/// This is a lookup table for all of the DisplayTabItems that are currently open
|
||||||
/// The key is:
|
/// The key is:
|
||||||
/// "Item - " + Procedure ItemID for step pages
|
/// "Item - " + Procedure ItemID for step pages
|
||||||
/// "Doc - " + DocumentID for Word Documents
|
/// "Doc - " + DocumentID for Word Documents
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Dictionary<string, DisplayTabItem> _MyDisplayTabItems;
|
public Dictionary<string, DisplayTabItem> _MyDisplayTabItems;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// When a Tab is closed it is added to this list.
|
/// When a Tab is closed it is added to this list.
|
||||||
@@ -549,7 +543,15 @@ namespace Volian.Controls.Library
|
|||||||
if (((Bar)sender).Items == null) return;
|
if (((Bar)sender).Items == null) return;
|
||||||
if (((Bar)sender).Items.Count == 1)// Remove bar if last item is closed...
|
if (((Bar)sender).Items.Count == 1)// Remove bar if last item is closed...
|
||||||
{
|
{
|
||||||
Bar bar = sender as Bar;
|
//B2026 - 048 View Only Mode freezes PROMS if last tab closed
|
||||||
|
//if last item is closing, need to re-enable Step Properties
|
||||||
|
//so if closing in view only mode will not freeze when re-opening
|
||||||
|
if (MyEditItem != null && MyEditItem.MyStepPanel.VwMode == E_ViewMode.View)
|
||||||
|
{
|
||||||
|
OnEnableDisableStepProperties(new StepTabRibbonEventArgs(MyEditItem.MyItemInfo, 0, E_ViewMode.Edit));
|
||||||
|
}
|
||||||
|
|
||||||
|
Bar bar = sender as Bar;
|
||||||
if (bar != null)
|
if (bar != null)
|
||||||
{
|
{
|
||||||
if (dotNetBarManager1.Bars.Contains(bar.Name))
|
if (dotNetBarManager1.Bars.Contains(bar.Name))
|
||||||
@@ -568,9 +570,16 @@ namespace Volian.Controls.Library
|
|||||||
ActivateRemainingTab((Bar)sender);
|
ActivateRemainingTab((Bar)sender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
#region Public Methods
|
public event StepTabRibbonEvent EnableDisableStepProperties;
|
||||||
public void RefreshItem(ItemInfo myItemInfo)
|
private void OnEnableDisableStepProperties(StepTabRibbonEventArgs args)
|
||||||
|
{
|
||||||
|
if (EnableDisableStepProperties != null)
|
||||||
|
EnableDisableStepProperties(this, args);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region Public Methods
|
||||||
|
public void RefreshItem(ItemInfo myItemInfo)
|
||||||
{
|
{
|
||||||
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
|
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
|
||||||
string key = "Item - " + proc.ItemID.ToString();
|
string key = "Item - " + proc.ItemID.ToString();
|
||||||
@@ -887,9 +896,18 @@ namespace Volian.Controls.Library
|
|||||||
Bar b = myTabItem.ContainerControl as Bar;
|
Bar b = myTabItem.ContainerControl as Bar;
|
||||||
if (b != null)
|
if (b != null)
|
||||||
{
|
{
|
||||||
b.CloseDockTab(myTabItem);
|
try
|
||||||
//b.Items.Remove(myTabItem);
|
{
|
||||||
RemoveItem(myTabItem);
|
b.CloseDockTab(myTabItem);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
//This is to work around a bug inside 3rd party DotNetBar
|
||||||
|
//The bug occurs when events happen out of order and it tries
|
||||||
|
//to remove a TabItem from the Collection the has already been removed
|
||||||
|
}
|
||||||
|
|
||||||
|
RemoveItem(myTabItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -245,6 +245,20 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
protected void MyContent_Changed(object sender)
|
protected void MyContent_Changed(object sender)
|
||||||
{
|
{
|
||||||
|
//C2026-021 Expand Functionality of Viewing Mode
|
||||||
|
if (MyStepPanel.ApplDisplayMode > 0)
|
||||||
|
{
|
||||||
|
MyItemInfo.MyDocVersion.DocVersionConfig.SelectedSlave = MyStepPanel.ApplDisplayMode;
|
||||||
|
MyItemInfo.MyProcedure.ProcedureConfig.SelectedSlave = MyStepPanel.ApplDisplayMode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MyItemInfo.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
|
||||||
|
MyItemInfo.MyProcedure.ProcedureConfig.SelectedSlave = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
MyItemInfo.MyProcedure.ResetChangeBar();
|
||||||
|
|
||||||
// Update the text to reflect the content change
|
// Update the text to reflect the content change
|
||||||
MyItemInfo.RefreshItemAnnotations();
|
MyItemInfo.RefreshItemAnnotations();
|
||||||
ChangeBar = MyItemInfo.HasChangeBar;
|
ChangeBar = MyItemInfo.HasChangeBar;
|
||||||
@@ -4114,7 +4128,14 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//// TIMING: DisplayItem.TimeIt("CSLARTB Parent");
|
//// TIMING: DisplayItem.TimeIt("CSLARTB Parent");
|
||||||
|
|
||||||
|
//C2026-021 Expand Functionality of Viewing Mode
|
||||||
|
if (MyStepPanel.ApplDisplayMode > 0)
|
||||||
|
MyItemInfo.MyDocVersion.DocVersionConfig.SelectedSlave = MyStepPanel.ApplDisplayMode;
|
||||||
|
else
|
||||||
|
MyItemInfo.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
|
||||||
|
|
||||||
SetText();
|
SetText();
|
||||||
if (itemInfo.IsSupInfoPart)
|
if (itemInfo.IsSupInfoPart)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ namespace Volian.Controls.Library
|
|||||||
public delegate void StepRTBLocationEvent(object sender, StepRTBLocationEventArgs args);
|
public delegate void StepRTBLocationEvent(object sender, StepRTBLocationEventArgs args);
|
||||||
public delegate void StepRTBMouseEvent(object sender, MouseEventArgs args);
|
public delegate void StepRTBMouseEvent(object sender, MouseEventArgs args);
|
||||||
public delegate void StepRTBRoEvent(object sender, StepRTBRoEventArgs args);
|
public delegate void StepRTBRoEvent(object sender, StepRTBRoEventArgs args);
|
||||||
//public delegate void StepRTBMouseWheelEvent(object sender, MouseEventArgs args);
|
|
||||||
public partial class StepRTB : RichTextBox // , IStepRTB
|
public partial class StepRTB : RichTextBox // , IStepRTB
|
||||||
{
|
{
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
@@ -177,18 +176,6 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
if (CursorMovement != null) CursorMovement(sender, args);
|
if (CursorMovement != null) CursorMovement(sender, args);
|
||||||
}
|
}
|
||||||
//public event StepRTBModeChangeEvent ModeChange;
|
|
||||||
//private void OnModeChange(object sender, StepRTBModeChangeEventArgs args)
|
|
||||||
//{
|
|
||||||
// //_MyModeChangeEventArgs = args;
|
|
||||||
// if (ModeChange != null) ModeChange(sender, args);
|
|
||||||
// else MessageBox.Show("StepRTB - no mode change defined");
|
|
||||||
//}
|
|
||||||
//public event StepRTBMouseWheelEvent MouseWheel;
|
|
||||||
//private void OnMouseWheel(object sender, MouseEventArgs args)
|
|
||||||
//{
|
|
||||||
// if (MouseWheel != null) MouseWheel(sender, args);
|
|
||||||
//}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This event is not raised during all the in-between changes for link deletions
|
/// This event is not raised during all the in-between changes for link deletions
|
||||||
@@ -292,23 +279,6 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// use newer rich text box....
|
|
||||||
//[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
|
|
||||||
//static extern IntPtr LoadLibrary(string lpFileName);
|
|
||||||
//protected override CreateParams CreateParams
|
|
||||||
//{
|
|
||||||
// get
|
|
||||||
// {
|
|
||||||
// CreateParams prams = base.CreateParams;
|
|
||||||
// if (LoadLibrary("msftedit.dll") != IntPtr.Zero)
|
|
||||||
// {
|
|
||||||
// //prams.ExStyle |= 0x020; // transparent
|
|
||||||
|
|
||||||
// prams.ClassName = "RICHEDIT50W";
|
|
||||||
// }
|
|
||||||
// return prams;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
private E_FieldToEdit _FieldToEdit = E_FieldToEdit.StepText;
|
private E_FieldToEdit _FieldToEdit = E_FieldToEdit.StepText;
|
||||||
public E_FieldToEdit FieldToEdit
|
public E_FieldToEdit FieldToEdit
|
||||||
{
|
{
|
||||||
@@ -321,14 +291,12 @@ namespace Volian.Controls.Library
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
//B2020-100 RHM Use SelectionFont rather than the font from the format file.
|
//B2020-100 RHM Use SelectionFont rather than the font from the format file.
|
||||||
//if (_RtfPrefix == null)
|
StringBuilder selectedRtfSB = new StringBuilder();
|
||||||
//{
|
|
||||||
StringBuilder selectedRtfSB = new StringBuilder();
|
|
||||||
//AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont));
|
|
||||||
// B2021-100: if SelectionFont is null, use the FormatFont
|
// B2021-100: if SelectionFont is null, use the FormatFont
|
||||||
AddFontTable(selectedRtfSB, SelectionFont==null?FormatFont:SelectionFont, FontIsFixed(FormatFont));
|
AddFontTable(selectedRtfSB, SelectionFont==null?FormatFont:SelectionFont, FontIsFixed(FormatFont));
|
||||||
_RtfPrefix = selectedRtfSB.ToString();
|
_RtfPrefix = selectedRtfSB.ToString();
|
||||||
//}
|
|
||||||
return _RtfPrefix + @"\f1\fs" + FormatFont.SizeInPoints * 2 + " ";
|
return _RtfPrefix + @"\f1\fs" + FormatFont.SizeInPoints * 2 + " ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -375,14 +343,6 @@ namespace Volian.Controls.Library
|
|||||||
get { if (_MyClassName == string.Empty)_MyClassName = CreateParams.ClassName; return _MyClassName; }
|
get { if (_MyClassName == string.Empty)_MyClassName = CreateParams.ClassName; return _MyClassName; }
|
||||||
set { _MyClassName = value; }
|
set { _MyClassName = value; }
|
||||||
}
|
}
|
||||||
//private E_EditPrintMode _epMode = E_EditPrintMode.Edit;
|
|
||||||
//public E_EditPrintMode EpMode
|
|
||||||
//{
|
|
||||||
// get { return _epMode; }
|
|
||||||
// set {
|
|
||||||
// if (value == E_EditPrintMode.Print) Console.WriteLine("");
|
|
||||||
// _epMode = value; }
|
|
||||||
//}
|
|
||||||
private E_ViewMode _vwMode = E_ViewMode.Edit;
|
private E_ViewMode _vwMode = E_ViewMode.Edit;
|
||||||
public E_ViewMode VwMode
|
public E_ViewMode VwMode
|
||||||
{
|
{
|
||||||
@@ -490,66 +450,63 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
ActiveMode = activeMode;
|
ActiveMode = activeMode;
|
||||||
OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(true));
|
OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(true));
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 2");
|
|
||||||
_InitializingRTB = true;
|
_InitializingRTB = true;
|
||||||
DisplayText vlntxt = new DisplayText(MyItemInfo, E_EditPrintMode.Edit, VwMode, !ActiveMode, FieldToEdit, true,null, null,false);
|
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 3");
|
//C2026-021 Expand Functionality of Viewing Mode
|
||||||
//if (_origDisplayText != null && vlntxt.StartText == _origDisplayText.StartText)
|
StepPanel pnl = (Parent as RTBItem)?.MyStepPanel;
|
||||||
//{
|
if (pnl?.ApplDisplayMode > 0)
|
||||||
// ReadOnly = !(EpMode == E_EditPrintMode.Edit && VwMode == E_ViewMode.Edit);
|
{
|
||||||
// if (!ReadOnly && !edit) ReadOnly = true;
|
MyItemInfo.MyDocVersion.DocVersionConfig.SelectedSlave = pnl.ApplDisplayMode;
|
||||||
// return;
|
}
|
||||||
//}
|
else
|
||||||
OrigDisplayText = vlntxt;
|
{
|
||||||
|
MyItemInfo.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
DisplayText vlntxt = new DisplayText(MyItemInfo, E_EditPrintMode.Edit, VwMode, !ActiveMode, FieldToEdit, true,null, null,false);
|
||||||
|
if (pnl?.ApplDisplayMode > 0 && MyItemInfo.MyContent.ContentRoUsageCount > 0)
|
||||||
|
{
|
||||||
|
vlntxt.StartText = RefreshROsWithUnitStartText(vlntxt.StartText, pnl.ApplDisplayMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
OrigDisplayText = vlntxt;
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 4");
|
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 4");
|
||||||
|
|
||||||
// RHM 20101201 - Don't reset the text. Calculate the text and compare it with the existing text in AddRTFText
|
// RHM 20101201 - Don't reset the text. Calculate the text and compare it with the existing text in AddRTFText
|
||||||
//Text = ""; // Initialize text before add text
|
//Text = ""; // Initialize text before add text
|
||||||
// IMPORTANT: SetLineSpacing must be set before Links, otherwise it
|
// IMPORTANT: SetLineSpacing must be set before Links, otherwise it
|
||||||
// was confusing the 'handle' of the rtf box.
|
// was confusing the 'handle' of the rtf box.
|
||||||
//Console.WriteLine("'font',{0}", Font);
|
|
||||||
//if(Text == "")SelectionFont = Font; // Initialize SelectionFont
|
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "1");
|
|
||||||
if (FieldToEdit == E_FieldToEdit.StepText)
|
if (FieldToEdit == E_FieldToEdit.StepText)
|
||||||
{
|
{
|
||||||
if (MyItemInfo != null)
|
if (MyItemInfo != null)
|
||||||
{
|
{
|
||||||
//if (MyItemInfo.IsStep) Font = MyFontFamily == null ? MyItemInfo.FormatStepData.Font.WindowsFont : new Font(MyFontFamily, MyItemInfo.FormatStepData.Font.WindowsFont.Size, MyItemInfo.FormatStepData.Font.WindowsFont.Style);
|
|
||||||
//else Font = Font = MyFontFamily == null ? MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont : new Font(MyFontFamily, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Size, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Style);
|
|
||||||
if (MyItemInfo.IsStep)
|
if (MyItemInfo.IsStep)
|
||||||
{
|
{
|
||||||
if (MyFontFamily == null)
|
if (MyFontFamily == null)
|
||||||
{
|
{
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "Before WindowsFont1");
|
|
||||||
System.Drawing.Font fnt = MyItemInfo.FormatStepData.Font.WindowsFont;
|
System.Drawing.Font fnt = MyItemInfo.FormatStepData.Font.WindowsFont;
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "After WindowsFont1a");
|
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
if (FontKey(Font) != FontKey(fnt))
|
if (FontKey(Font) != FontKey(fnt))
|
||||||
Font = fnt;
|
Font = fnt;
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "After WindowsFont1b");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Font = VE_Font.GetWinSysFont(MyFontFamily, MyItemInfo.FormatStepData.Font.WindowsFont.Size, MyItemInfo.FormatStepData.Font.WindowsFont.Style);
|
Font = VE_Font.GetWinSysFont(MyFontFamily, MyItemInfo.FormatStepData.Font.WindowsFont.Size, MyItemInfo.FormatStepData.Font.WindowsFont.Style);
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 4");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (MyFontFamily == null)
|
if (MyFontFamily == null)
|
||||||
{
|
{
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "Before WindowsFont2");
|
|
||||||
Font = MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont;
|
Font = MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont;
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "After WindowsFont2");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Font = VE_Font.GetWinSysFont(MyFontFamily, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Size, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Style);
|
Font = VE_Font.GetWinSysFont(MyFontFamily, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Size, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Style);
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 5");
|
|
||||||
}
|
}
|
||||||
LastRtf = Rtf;
|
LastRtf = Rtf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "StepRTB.RefreshDisplay Before SetLineSpacing");
|
|
||||||
RTBAPI.SetLineSpacing(this, RTBAPI.ParaSpacing.PFS_EXACT);
|
RTBAPI.SetLineSpacing(this, RTBAPI.ParaSpacing.PFS_EXACT);
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "StepRTB.RefreshDisplay After SetLineSpacing");
|
|
||||||
bool readOnlyStep = MyItemInfo == null || MyItemInfo.FormatStepData == null ? false : MyItemInfo.FormatStepData.ReadOnly;
|
bool readOnlyStep = MyItemInfo == null || MyItemInfo.FormatStepData == null ? false : MyItemInfo.FormatStepData.ReadOnly;
|
||||||
if (!readOnlyStep)
|
if (!readOnlyStep)
|
||||||
{
|
{
|
||||||
@@ -557,10 +514,9 @@ namespace Volian.Controls.Library
|
|||||||
if (IsDerived(sc) && !MyItemInfo.EnhAllowMod()) readOnlyStep = true;
|
if (IsDerived(sc) && !MyItemInfo.EnhAllowMod()) readOnlyStep = true;
|
||||||
}
|
}
|
||||||
ReadOnly = readOnlyStep || VwMode == E_ViewMode.View || ActiveMode == false;
|
ReadOnly = readOnlyStep || VwMode == E_ViewMode.View || ActiveMode == false;
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "Before AddRTFText");
|
|
||||||
AddRtfText(vlntxt.StartText);
|
AddRtfText(vlntxt.StartText);
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "After AddRTFText");
|
|
||||||
//AddRtfStyles();
|
|
||||||
// set readonly based on initial modes, however, these may change if
|
// set readonly based on initial modes, however, these may change if
|
||||||
// user selected view mode.
|
// user selected view mode.
|
||||||
ClearUndo();
|
ClearUndo();
|
||||||
@@ -587,10 +543,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
RemoveEventHandlers();
|
RemoveEventHandlers();
|
||||||
OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(false));// View Mode
|
OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(false));// View Mode
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "Before SelectAll");
|
|
||||||
SelectAll();
|
SelectAll();
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "After SelectAll");
|
|
||||||
//if (SelectionHangingIndent !=0) SelectionHangingIndent = 0;
|
|
||||||
int indchar = 0;
|
int indchar = 0;
|
||||||
string indentToken = MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IndentToken;
|
string indentToken = MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IndentToken;
|
||||||
if (indentToken == null || indentToken == "0") indentToken = "\x5";
|
if (indentToken == null || indentToken == "0") indentToken = "\x5";
|
||||||
@@ -598,7 +551,6 @@ namespace Volian.Controls.Library
|
|||||||
// this line of code was moved before the find for the indent so that
|
// this line of code was moved before the find for the indent so that
|
||||||
// the window gets resized if the indent changes the height, i.e. more line(s) in window.
|
// the window gets resized if the indent changes the height, i.e. more line(s) in window.
|
||||||
AddEventHandlers();
|
AddEventHandlers();
|
||||||
//if (MyItemInfo.InList(186722)) Console.WriteLine("here");
|
|
||||||
if ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0)
|
if ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0)
|
||||||
{
|
{
|
||||||
int nindents = 0;
|
int nindents = 0;
|
||||||
@@ -652,11 +604,51 @@ namespace Volian.Controls.Library
|
|||||||
_InitializingRTB = false;
|
_InitializingRTB = false;
|
||||||
|
|
||||||
AdjustSizeForContents(!ActiveMode);
|
AdjustSizeForContents(!ActiveMode);
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "After RefreshDisplay");
|
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsDerived(StepConfig sc)
|
//C2026-021 Expand Functionality of Viewing Mode
|
||||||
|
//regex for finding Referenced object links
|
||||||
|
private static Regex regRefObj = new Regex(@"\#Link\:ReferencedObject:([0-9]*) ([0-9a-zA-Z]*) ([0-9]*)", RegexOptions.Singleline);
|
||||||
|
|
||||||
|
//Replace the Default RO text with Unit Specific RO text
|
||||||
|
private string RefreshROsWithUnitStartText(string startText, int unitID)
|
||||||
|
{
|
||||||
|
ROFSTLookup lookup = MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MyItemInfo.MyDocVersion);
|
||||||
|
|
||||||
|
MatchCollection mc = regRefObj.Matches(startText);
|
||||||
|
|
||||||
|
if (mc.Count == 0)
|
||||||
|
return startText;
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
int lastindex = 0;
|
||||||
|
|
||||||
|
foreach (Match match in mc)
|
||||||
|
{
|
||||||
|
//get where ther default text for the RO starts
|
||||||
|
int indx = startText.LastIndexOf(@"\v <START]\v0", match.Index) + 13;
|
||||||
|
|
||||||
|
//get the RO, value will be the unit related value
|
||||||
|
ROFSTLookup.rochild roc = lookup.GetRoChild(ROFSTLookup.FormatRoidKey(match.Groups[2].Value, true));
|
||||||
|
|
||||||
|
// append before tags up through the <START]\v0
|
||||||
|
//note if multiple tags this will also append the end up the previous tags
|
||||||
|
sb.Append(startText.Substring(lastindex, indx - lastindex));
|
||||||
|
|
||||||
|
//append the unit specific RO value (replacing where the default RO value was)
|
||||||
|
sb.Append($@"\cf1 {roc.value}\cf0\v");
|
||||||
|
|
||||||
|
lastindex = match.Index;
|
||||||
|
}
|
||||||
|
|
||||||
|
//append referenced object tag & text after tag
|
||||||
|
sb.Append(startText.Substring(lastindex));
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool IsDerived(StepConfig sc)
|
||||||
{
|
{
|
||||||
foreach (EnhancedDocument ed in sc.MyEnhancedDocuments)
|
foreach (EnhancedDocument ed in sc.MyEnhancedDocuments)
|
||||||
if (ed.Type == 0) //New Design
|
if (ed.Type == 0) //New Design
|
||||||
@@ -752,8 +744,6 @@ namespace Volian.Controls.Library
|
|||||||
protected override void OnMouseWheel(MouseEventArgs e)
|
protected override void OnMouseWheel(MouseEventArgs e)
|
||||||
{
|
{
|
||||||
OnDoMouseWheel(this, e);
|
OnDoMouseWheel(this, e);
|
||||||
//MyRTBItem.MyStepPanel.MouseWheel(e);
|
|
||||||
//base.OnMouseWheel(e);
|
|
||||||
}
|
}
|
||||||
// When a border style is changed, the richtextbox's handle is 'destroyed', so that the handleDestroyed
|
// When a border style is changed, the richtextbox's handle is 'destroyed', so that the handleDestroyed
|
||||||
// event is done. This was causing the event handlers to be removed (RemoveEventHandler) so that the
|
// event is done. This was causing the event handlers to be removed (RemoveEventHandler) so that the
|
||||||
@@ -896,10 +886,6 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
_MouseDown = false;
|
_MouseDown = false;
|
||||||
}
|
}
|
||||||
//void MyConfig_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
|
||||||
//{
|
|
||||||
// SaveConfig();
|
|
||||||
//}
|
|
||||||
private void StepRTB_Click(object sender, EventArgs e)
|
private void StepRTB_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (ReadOnly) return;
|
if (ReadOnly) return;
|
||||||
@@ -957,44 +943,6 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region ApplicationSupport
|
#region ApplicationSupport
|
||||||
// Used in StepTabRibbon:
|
|
||||||
//public void ToggleEditView(E_ViewMode vwMode)
|
|
||||||
//{
|
|
||||||
// OnDoSaveContents(this, new EventArgs()); // SaveText();
|
|
||||||
// //ItemInfo tmp = MyItemInfo;
|
|
||||||
// //MyItemInfo = null;
|
|
||||||
// //ReadOnly = !ReadOnly;
|
|
||||||
// //EpMode = ReadOnly ? E_EditPrintMode.Print : E_EditPrintMode.Edit;
|
|
||||||
// VwMode = vwMode;
|
|
||||||
// ReadOnly = VwMode == E_ViewMode.View;
|
|
||||||
// ViewRTB = ReadOnly;
|
|
||||||
// Clear();
|
|
||||||
// RefreshDisplay(!ViewRTB);
|
|
||||||
// //MyItemInfo = tmp;
|
|
||||||
// SelectionStart = 0;
|
|
||||||
// SelectionLength = 0;
|
|
||||||
// //OnModeChange(this, new StepRTBModeChangeEventArgs(ViewRTB?E_ViewMode.View:E_ViewMode.Edit));
|
|
||||||
//}
|
|
||||||
//public string InsertSymbolInRO(string val)
|
|
||||||
//{
|
|
||||||
// string retval = val;
|
|
||||||
// C2019-043 convert a "->" to the Right Arrow symbol and a "<-" to the Left Arrow Symbol
|
|
||||||
// note that at the dash character gets convert to a non-breaking hyphen "\u8209?"
|
|
||||||
//if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseDashGreaterLessThenForArrowsInROValue)
|
|
||||||
//{
|
|
||||||
// retval = retval.Replace("\\u8209?>", GetAddSymbolTextForROs(@"\u8594?")); // Right Arrow
|
|
||||||
// retval = retval.Replace("<\\u8209?", GetAddSymbolTextForROs(@"\u8592?")); // Left Arrow
|
|
||||||
//}
|
|
||||||
//// C2022-021 convert a "<=" to a less than or equal symbol, a ">=" to a greather than or equal symbol and +- to a
|
|
||||||
//// plus/minus symbol in ROs
|
|
||||||
//if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertGTELTEPMinROValue)
|
|
||||||
//{
|
|
||||||
// retval = retval.Replace("<=", GetAddSymbolTextForROs(@"\u8804?")); // Less than or Equal
|
|
||||||
// retval = retval.Replace(">=", GetAddSymbolTextForROs(@"\u8805?")); // Greater than or Equal
|
|
||||||
// retval = retval.Replace("+\\u8209?", @"\'b1"); // plus/minus - note - is stored as \u8209 and plus/minus is < 256, i.e. handled differently
|
|
||||||
//}
|
|
||||||
// return retval;
|
|
||||||
//}
|
|
||||||
public void InsertRO(string value, string link)
|
public void InsertRO(string value, string link)
|
||||||
{
|
{
|
||||||
// B2023-037: Remove code that saves the unicode characters for <=, >=, +-, <- and -> into the link text. The characters
|
// B2023-037: Remove code that saves the unicode characters for <=, >=, +-, <- and -> into the link text. The characters
|
||||||
@@ -1172,8 +1120,6 @@ namespace Volian.Controls.Library
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//Console.WriteLine("ItemID:{0}", MyItemInfo.ItemID);
|
//Console.WriteLine("ItemID:{0}", MyItemInfo.ItemID);
|
||||||
//if(MyItemInfo.ItemID==10256)
|
|
||||||
// Volian.Base.Library.vlnStackTrace.ShowStackLocal("ItemID:{0}", MyItemInfo.ItemID.ToString());
|
|
||||||
StringBuilder selectedRtfSB = new StringBuilder();
|
StringBuilder selectedRtfSB = new StringBuilder();
|
||||||
AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont));
|
AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont));
|
||||||
_RtfPrefix = selectedRtfSB.ToString();
|
_RtfPrefix = selectedRtfSB.ToString();
|
||||||
@@ -1197,27 +1143,12 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
// B2017-048, B2017-052, B2017-055 ROs sometimes have two start tokens which make them uneditable.
|
// B2017-048, B2017-052, B2017-055 ROs sometimes have two start tokens which make them uneditable.
|
||||||
newRtf = newRtf.Replace("<START]<START]", "<START]");
|
newRtf = newRtf.Replace("<START]<START]", "<START]");
|
||||||
//Point linkIssues = FindLinkIssues(newRtf);
|
|
||||||
//if (linkIssues.X != linkIssues.Y)
|
|
||||||
// newRtf = FixBadLinks(newRtf,linkIssues);
|
|
||||||
SelectedRtf = _LastRtf = newRtf;
|
SelectedRtf = _LastRtf = newRtf;
|
||||||
_lastReadOnly = ReadOnly;
|
_lastReadOnly = ReadOnly;
|
||||||
}
|
}
|
||||||
FindAllLinks();
|
FindAllLinks();
|
||||||
if (txt == "") SelectionFont = FormatFont;
|
if (txt == "") SelectionFont = FormatFont;
|
||||||
}
|
}
|
||||||
//private string FixBadLinks(string newRtf, Point linkIssues)
|
|
||||||
//{
|
|
||||||
// Console.WriteLine("Bad Link rtf = Starts={0}, Ends={1}, \"{2}\"", linkIssues.X,linkIssues.Y, newRtf);
|
|
||||||
// //Volian.Base.Library.vlnStackTrace.ShowStack();
|
|
||||||
// return newRtf;
|
|
||||||
//}
|
|
||||||
//private static Point FindLinkIssues(string rtf)
|
|
||||||
//{
|
|
||||||
// MatchCollection mcStart = Regex.Matches(rtf, @"\<START\]");
|
|
||||||
// MatchCollection mcEnd = Regex.Matches(rtf, @"\[END\>");
|
|
||||||
// return new Point(mcStart.Count, mcEnd.Count);
|
|
||||||
//}
|
|
||||||
public void SetTableGridCellRTFPrefix(Font myfont)
|
public void SetTableGridCellRTFPrefix(Font myfont)
|
||||||
{
|
{
|
||||||
if (_FormatFont == null)
|
if (_FormatFont == null)
|
||||||
@@ -1282,7 +1213,7 @@ namespace Volian.Controls.Library
|
|||||||
sbbeg.Append(@"\i");
|
sbbeg.Append(@"\i");
|
||||||
sbend.Insert(0, @"\i0");
|
sbend.Insert(0, @"\i0");
|
||||||
}
|
}
|
||||||
selectedRtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + myFont.FontFamily.Name + @";}"); //}\f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}}";
|
selectedRtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + myFont.FontFamily.Name + @";}");
|
||||||
if (!isFixed)
|
if (!isFixed)
|
||||||
selectedRtfSB.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // C2017-036 get best available proportional font for symbols - B2025-039 add Blue for Colored Replace Words
|
selectedRtfSB.Append(@"{\f1\fnil\fcharset0 " + Volian.Base.Library.vlnFont.ProportionalSymbolFont + @";}}{\colortbl ;\red255\green0\blue0;\red0\green0\blue255;}"); // C2017-036 get best available proportional font for symbols - B2025-039 add Blue for Colored Replace Words
|
||||||
else
|
else
|
||||||
@@ -1291,7 +1222,7 @@ namespace Volian.Controls.Library
|
|||||||
// use styles to construct rtf commands to insert into next line (where \b, etc is)
|
// use styles to construct rtf commands to insert into next line (where \b, etc is)
|
||||||
// B2015-134 Hanging Indent with Hard Returns was not being saved- removed \sl-240\slmult0
|
// B2015-134 Hanging Indent with Hard Returns was not being saved- removed \sl-240\slmult0
|
||||||
selectedRtfSB.Append(@"\viewkind4\uc1\pard" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(myFont.SizeInPoints * 2).ToString() + @" "); // \f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}";
|
selectedRtfSB.Append(@"\viewkind4\uc1\pard" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(myFont.SizeInPoints * 2).ToString() + @" "); // \f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}";
|
||||||
//selectedRtfSB.Append(@"\viewkind4\uc1\pard\sl-240\slmult0" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(myFont.SizeInPoints * 2).ToString() + @" "); // \f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool FontIsFixed(Font myFont)
|
private bool FontIsFixed(Font myFont)
|
||||||
@@ -1396,7 +1327,6 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
string fonttab = FontTable;
|
string fonttab = FontTable;
|
||||||
string fontsize = FontSize;
|
string fontsize = FontSize;
|
||||||
//if (this.DetectUrls) this.DetectUrls = false;
|
|
||||||
if (SelectionLength > 0)HandleDeleteKeyWithSelectedText(new KeyEventArgs(Keys.None), null);
|
if (SelectionLength > 0)HandleDeleteKeyWithSelectedText(new KeyEventArgs(Keys.None), null);
|
||||||
int position = SelectionStart;
|
int position = SelectionStart;
|
||||||
SelectionLength = 0;
|
SelectionLength = 0;
|
||||||
@@ -1426,7 +1356,6 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
private void AddLink50(string linkValue, string linkUrl)
|
private void AddLink50(string linkValue, string linkUrl)
|
||||||
{
|
{
|
||||||
//this.DetectUrls = false;
|
|
||||||
int position = SelectionStart;
|
int position = SelectionStart;
|
||||||
SelectionLength = 0;
|
SelectionLength = 0;
|
||||||
SelectedRtf = string.Format(@"{{\rtf\field{{\*\fldinst{{HYPERLINK ""www.volian.com #{0}"" }}}}{{\fldrslt{{\cf2\ul {1}}}}}}}", linkUrl, linkValue);
|
SelectedRtf = string.Format(@"{{\rtf\field{{\*\fldinst{{HYPERLINK ""www.volian.com #{0}"" }}}}{{\fldrslt{{\cf2\ul {1}}}}}}}", linkUrl, linkValue);
|
||||||
@@ -1479,9 +1408,6 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
Size offset = Size - ClientSize;
|
Size offset = Size - ClientSize;
|
||||||
int widthNew = (this is TableCellEditor) ? Width : (ContentsSize.Width + offset.Width + AdjustSize.Width);
|
int widthNew = (this is TableCellEditor) ? Width : (ContentsSize.Width + offset.Width + AdjustSize.Width);
|
||||||
//int widthNew = Width;
|
|
||||||
//if (!(this is TableCellEditor))
|
|
||||||
// widthNew = ContentsSize.Width + offset.Width + AdjustSize.Width;
|
|
||||||
int heightNew = ContentsSize.Height + offset.Height + AdjustSize.Height;
|
int heightNew = ContentsSize.Height + offset.Height + AdjustSize.Height;
|
||||||
// Don't make the window narrower unless it has text - RHM - 20100107
|
// Don't make the window narrower unless it has text - RHM - 20100107
|
||||||
Size szNew = new Size(((Text != "" && adjustWidth) ? widthNew : (widthNew > Width ? widthNew : Width)), heightNew);
|
Size szNew = new Size(((Text != "" && adjustWidth) ? widthNew : (widthNew > Width ? widthNew : Width)), heightNew);
|
||||||
@@ -1619,22 +1545,6 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region ColorSupport - Not currently used.
|
#region ColorSupport - Not currently used.
|
||||||
//private void SetBackGroundColor(ItemInfo itemInfo)
|
|
||||||
//{
|
|
||||||
// string backcolor = null;
|
|
||||||
// int type = (int)itemInfo.MyContent.Type;
|
|
||||||
// FormatInfo formatinfo = itemInfo.ActiveFormat;
|
|
||||||
// if (type == (int)E_FromType.Procedure)
|
|
||||||
// backcolor = formatinfo.PlantFormat.FormatData.ProcData.BackColor;
|
|
||||||
// else if (type == (int)E_FromType.Section)
|
|
||||||
// backcolor = formatinfo.PlantFormat.FormatData.SectData.BackColor;
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// int typindx = (int)itemInfo.MyContent.Type - 20000; // what to do for other types rather than steps
|
|
||||||
// backcolor = formatinfo.PlantFormat.FormatData.StepDataList[typindx].StepLayoutData.BackColor;
|
|
||||||
// }
|
|
||||||
// BackColor = Color.FromName(backcolor);
|
|
||||||
//}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region EventSupport
|
#region EventSupport
|
||||||
#region LinkEvents
|
#region LinkEvents
|
||||||
@@ -1667,8 +1577,6 @@ namespace Volian.Controls.Library
|
|||||||
#region TextAndContentsEvents
|
#region TextAndContentsEvents
|
||||||
void StepRTB_TextChanged(object sender, EventArgs e)
|
void StepRTB_TextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//if (Rtf.Contains("<START]<START]"))
|
|
||||||
// Volian.Base.Library.vlnStackTrace.ShowStackLocal(2, 10, "Start Start ItemID={0}", MyItemInfo.ItemID);
|
|
||||||
if (_InitializingRTB || _IsExperimenting) return;
|
if (_InitializingRTB || _IsExperimenting) return;
|
||||||
// Was setting _IsDirty to true here, but this was getting called from
|
// Was setting _IsDirty to true here, but this was getting called from
|
||||||
// 'dotnetbar' when text was NOT Changed. So _IsDirty was made into
|
// 'dotnetbar' when text was NOT Changed. So _IsDirty was made into
|
||||||
@@ -1704,7 +1612,6 @@ namespace Volian.Controls.Library
|
|||||||
private void HandleLocalSelectionChange()
|
private void HandleLocalSelectionChange()
|
||||||
{
|
{
|
||||||
if (this.MyItemInfo != null && this.MyItemInfo.IsRtfRaw) return; // B2017-023 null reference check for empty workdraft set information dialog
|
if (this.MyItemInfo != null && this.MyItemInfo.IsRtfRaw) return; // B2017-023 null reference check for empty workdraft set information dialog
|
||||||
//if (MyRTBItem != null && MyRTBItem.MyStepPanel.SelectedStepRTB != this)
|
|
||||||
if (OnIsNotCurrentSelection(this, new EventArgs()))
|
if (OnIsNotCurrentSelection(this, new EventArgs()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1720,8 +1627,6 @@ namespace Volian.Controls.Library
|
|||||||
SelectAll();
|
SelectAll();
|
||||||
_HandlingCtrlA = false;
|
_HandlingCtrlA = false;
|
||||||
}
|
}
|
||||||
//HandleOverWrite();
|
|
||||||
//vlnStackTrace.ShowStackLocal("HandleSelectionChangeStack", 1, 10);
|
|
||||||
bool startingValue = _AdjustingSelection;
|
bool startingValue = _AdjustingSelection;
|
||||||
if (_IdentifyingLinks || _ProcessingDelete) return;
|
if (_IdentifyingLinks || _ProcessingDelete) return;
|
||||||
// If the cursor is beyond the end of the line then move the cursor back one character
|
// If the cursor is beyond the end of the line then move the cursor back one character
|
||||||
@@ -1831,14 +1736,6 @@ namespace Volian.Controls.Library
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//private void HandleOverWrite()
|
|
||||||
//{
|
|
||||||
// if (!_OverWrite) return;
|
|
||||||
// if (SelectionLength > 0) return;
|
|
||||||
// if (SelectionStart == TextLength) return;
|
|
||||||
// Console.WriteLine("Handle Overwrite, SelectionStart = {0}, SelectionLength = {1}", SelectionStart, SelectionLength);
|
|
||||||
// SelectionLength = 1;
|
|
||||||
//}
|
|
||||||
private bool _CheckSelection = false;
|
private bool _CheckSelection = false;
|
||||||
#endregion
|
#endregion
|
||||||
#region Delete Handlers
|
#region Delete Handlers
|
||||||
@@ -1857,7 +1754,7 @@ namespace Volian.Controls.Library
|
|||||||
DeleteCurrentSelection(keychars);
|
DeleteCurrentSelection(keychars);
|
||||||
e.SuppressKeyPress = true;
|
e.SuppressKeyPress = true;
|
||||||
break;
|
break;
|
||||||
case RangeStatus.Before_Between: //myRTB1.SelectedText.EndsWith(@"[END><START]")
|
case RangeStatus.Before_Between:
|
||||||
DeleteEndBetweenLinks(keychars);
|
DeleteEndBetweenLinks(keychars);
|
||||||
e.SuppressKeyPress = true;
|
e.SuppressKeyPress = true;
|
||||||
break;
|
break;
|
||||||
@@ -1927,19 +1824,15 @@ namespace Volian.Controls.Library
|
|||||||
/// <param name="setSelect"></param>
|
/// <param name="setSelect"></param>
|
||||||
private void InsertCharBetweenLinks(LinkLocation ll, char charToAdd, bool setSelect)
|
private void InsertCharBetweenLinks(LinkLocation ll, char charToAdd, bool setSelect)
|
||||||
{
|
{
|
||||||
//_InsertingSpaceBetweenLinks = true;
|
|
||||||
DebugPrint("ICBLvvvvvvvvvvvvvvv>>>");
|
DebugPrint("ICBLvvvvvvvvvvvvvvv>>>");
|
||||||
Rtf = Rtf.Substring(0, ll.StartRtf) + @"\v0 " + charToAdd.ToString() + @"\v " + Rtf.Substring(ll.StartRtf);
|
Rtf = Rtf.Substring(0, ll.StartRtf) + @"\v0 " + charToAdd.ToString() + @"\v " + Rtf.Substring(ll.StartRtf);
|
||||||
//_InsertingSpaceBetweenLinks = false;
|
|
||||||
if (setSelect)
|
if (setSelect)
|
||||||
SelectionStart = ll.Start - 6; // account for <START] - 1 for the character typed
|
SelectionStart = ll.Start - 6; // account for <START] - 1 for the character typed
|
||||||
DebugPrint("ICBL^^^^^^^^^^^^^^^>>>");
|
DebugPrint("ICBL^^^^^^^^^^^^^^^>>>");
|
||||||
}
|
}
|
||||||
private void ExpandSelectionToIncludeStart()
|
private void ExpandSelectionToIncludeStart()
|
||||||
{
|
{
|
||||||
//_AdjustingSelection = true;
|
|
||||||
SetSelection(SelectionStart - 7, SelectionLength + 7); // Expand selection to include start
|
SetSelection(SelectionStart - 7, SelectionLength + 7); // Expand selection to include start
|
||||||
//_AdjustingSelection = false;
|
|
||||||
}
|
}
|
||||||
public string GetSelectionForClipBoard()
|
public string GetSelectionForClipBoard()
|
||||||
{
|
{
|
||||||
@@ -1986,7 +1879,6 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
_SendBackSpace = true;
|
_SendBackSpace = true;
|
||||||
RtbSendKeys("{BS}"); // remove X
|
RtbSendKeys("{BS}"); // remove X
|
||||||
//this.ClearUndo(); // undo was redisplay 'X' and then deleted text
|
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
DebugSelection("After BS");
|
DebugSelection("After BS");
|
||||||
}
|
}
|
||||||
@@ -2005,9 +1897,7 @@ namespace Volian.Controls.Library
|
|||||||
int slen = SelectionLength + 1 - 7;
|
int slen = SelectionLength + 1 - 7;
|
||||||
// This puts a space at the link that starts at the end of the selection
|
// This puts a space at the link that starts at the end of the selection
|
||||||
InsertCharBetweenLinks(_RangeEndLink.NextLink);
|
InsertCharBetweenLinks(_RangeEndLink.NextLink);
|
||||||
//_AdjustingSelection = true;
|
|
||||||
DeleteSelection(sstart, slen, keychars);
|
DeleteSelection(sstart, slen, keychars);
|
||||||
//_AdjustingSelection = false;
|
|
||||||
_ProcessingKeys--;
|
_ProcessingKeys--;
|
||||||
}
|
}
|
||||||
private void DeleteStartBetweenLinks(string keychars)
|
private void DeleteStartBetweenLinks(string keychars)
|
||||||
@@ -2016,7 +1906,6 @@ namespace Volian.Controls.Library
|
|||||||
DebugSelection("DeleteStartBetweenLinks");
|
DebugSelection("DeleteStartBetweenLinks");
|
||||||
int slen = SelectionLength + 8;
|
int slen = SelectionLength + 8;
|
||||||
int sstart = SelectionStart - 7;
|
int sstart = SelectionStart - 7;
|
||||||
//LinkLocation ll = FindBetweenLinks(SelectionStart);
|
|
||||||
InsertCharBetweenLinks(_RangeStartLink);
|
InsertCharBetweenLinks(_RangeStartLink);
|
||||||
DeleteSelection(sstart, slen, keychars);
|
DeleteSelection(sstart, slen, keychars);
|
||||||
_ProcessingKeys--;
|
_ProcessingKeys--;
|
||||||
@@ -2027,7 +1916,6 @@ namespace Volian.Controls.Library
|
|||||||
DebugSelection("DeleteFromStartOfBox");
|
DebugSelection("DeleteFromStartOfBox");
|
||||||
int slen = SelectionLength;
|
int slen = SelectionLength;
|
||||||
SetSelection(0, 0);
|
SetSelection(0, 0);
|
||||||
//RtbSendKeys(" "); // open for space between links which separates END/START tokens
|
|
||||||
SelectedText = " ";
|
SelectedText = " ";
|
||||||
DeleteSelection(0, slen + 8, keychars);
|
DeleteSelection(0, slen + 8, keychars);
|
||||||
_ProcessingKeys--;
|
_ProcessingKeys--;
|
||||||
@@ -2038,12 +1926,8 @@ namespace Volian.Controls.Library
|
|||||||
DebugSelection("DeleteFromStartOfBoxEndBetweenLinks");
|
DebugSelection("DeleteFromStartOfBoxEndBetweenLinks");
|
||||||
// This puts a space at the link that starts at the end of the selection
|
// This puts a space at the link that starts at the end of the selection
|
||||||
int sLen = SelectionStart + SelectionLength - 7 + 2;// -7 for <START] + 2 for the spaces that are added
|
int sLen = SelectionStart + SelectionLength - 7 + 2;// -7 for <START] + 2 for the spaces that are added
|
||||||
//LinkLocation ll = FindBetweenLinks(SelectionStart + SelectionLength);
|
|
||||||
InsertCharBetweenLinks(_RangeEndLink.NextLink);
|
InsertCharBetweenLinks(_RangeEndLink.NextLink);
|
||||||
//RtbSendKeys("{RIGHT} "); // open for space between links which separates END/START tokens
|
|
||||||
//int sLen = myRTB1.SelectionStart;
|
|
||||||
SetSelection(0, 0);
|
SetSelection(0, 0);
|
||||||
//RtbSendKeys(" "); // open for space between links which separates END/START tokens
|
|
||||||
SelectedText = " "; // open for space between links which separates END/START tokens
|
SelectedText = " "; // open for space between links which separates END/START tokens
|
||||||
DeleteSelection(0, sLen, keychars);
|
DeleteSelection(0, sLen, keychars);
|
||||||
_ProcessingKeys--;
|
_ProcessingKeys--;
|
||||||
@@ -2150,7 +2034,7 @@ namespace Volian.Controls.Library
|
|||||||
srtb.Rtf = this.SelectedRtf.Replace(@"\u8209?", "-");
|
srtb.Rtf = this.SelectedRtf.Replace(@"\u8209?", "-");
|
||||||
srtb.Rtf = srtb.Rtf.Replace(@"\u9586?", @"\\");
|
srtb.Rtf = srtb.Rtf.Replace(@"\u9586?", @"\\");
|
||||||
string rtnstr = "";
|
string rtnstr = "";
|
||||||
string ctxt = srtb.Text;//this.SelectedText;
|
string ctxt = srtb.Text;
|
||||||
if (ctxt.EndsWith("<START]"))
|
if (ctxt.EndsWith("<START]"))
|
||||||
ctxt = ctxt.Substring(0, ctxt.Length - 7);
|
ctxt = ctxt.Substring(0, ctxt.Length - 7);
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
@@ -2279,7 +2163,6 @@ namespace Volian.Controls.Library
|
|||||||
if (MyItemInfo != null && MyItemInfo.IsRtfRaw && MyItemInfo.FormatStepData.Type.ToUpper().Contains("EQUATION") && !hasEquation)
|
if (MyItemInfo != null && MyItemInfo.IsRtfRaw && MyItemInfo.FormatStepData.Type.ToUpper().Contains("EQUATION") && !hasEquation)
|
||||||
{
|
{
|
||||||
FlexibleMessageBox.Show("Cannot paste non-equation data into an equation step type.", "Invalid data", MessageBoxButtons.OK);
|
FlexibleMessageBox.Show("Cannot paste non-equation data into an equation step type.", "Invalid data", MessageBoxButtons.OK);
|
||||||
//richTextBox1.Dispose();
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2287,7 +2170,6 @@ namespace Volian.Controls.Library
|
|||||||
else if (hasEquation && (MyItemInfo == null || (MyItemInfo != null && !MyItemInfo.IsRtfRaw && !MyItemInfo.FormatStepData.Type.ToUpper().Contains("EQUATION"))))
|
else if (hasEquation && (MyItemInfo == null || (MyItemInfo != null && !MyItemInfo.IsRtfRaw && !MyItemInfo.FormatStepData.Type.ToUpper().Contains("EQUATION"))))
|
||||||
{
|
{
|
||||||
FlexibleMessageBox.Show("Cannot paste equation data into an non-equation step type.", "Invalid data", MessageBoxButtons.OK);
|
FlexibleMessageBox.Show("Cannot paste equation data into an non-equation step type.", "Invalid data", MessageBoxButtons.OK);
|
||||||
//richTextBox1.Dispose();
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2546,16 +2428,6 @@ namespace Volian.Controls.Library
|
|||||||
if (SelectionLength > 0) HandleDeleteKeyWithSelectedText(e, null);
|
if (SelectionLength > 0) HandleDeleteKeyWithSelectedText(e, null);
|
||||||
break;
|
break;
|
||||||
case Keys.Insert:
|
case Keys.Insert:
|
||||||
//_OverWrite = !_OverWrite;
|
|
||||||
//if (_OverWrite)
|
|
||||||
//{
|
|
||||||
// HandleSelectionChange();
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// SelectionLength = 0;
|
|
||||||
// HandleSelectionChange();
|
|
||||||
//}
|
|
||||||
// For now, don't allow for toggling between insert/overwrite mode - see
|
// For now, don't allow for toggling between insert/overwrite mode - see
|
||||||
// comment on _OverWrite
|
// comment on _OverWrite
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
@@ -2569,21 +2441,11 @@ namespace Volian.Controls.Library
|
|||||||
if (e.Shift)
|
if (e.Shift)
|
||||||
{
|
{
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
ItemInfo myCopyStep = (this.Parent.Parent.Parent as StepTabPanel).MyDisplayTabControl.MyCopyStep;
|
ItemInfo myCopyStep = (this.Parent.Parent.Parent as StepTabPanel).MyDisplayTabControl.MyCopyStep;
|
||||||
if (myCopyStep != null)
|
if (myCopyStep != null)
|
||||||
{
|
{
|
||||||
// commented out as part of bug fix B2016-148 to fix the <Shift><F5> not popping up the paste options
|
OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste"));
|
||||||
//if (this.MyItemInfo.IsSection && myCopyStep.IsSection)
|
}
|
||||||
// OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste"));
|
|
||||||
//if (this.MyItemInfo.IsStep && myCopyStep.IsStep)
|
|
||||||
//{
|
|
||||||
// if ((this.MyItemInfo.IsHigh && myCopyStep.IsHigh) || (!this.MyItemInfo.IsHigh && !myCopyStep.IsHigh))
|
|
||||||
// OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste"));
|
|
||||||
//}
|
|
||||||
OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste"));
|
|
||||||
}
|
|
||||||
//if (!OnCheckClipboard(this, new EventArgs())) return; // check if 'clipboard' contains a step.
|
|
||||||
//OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste"));
|
|
||||||
}
|
}
|
||||||
else if (!e.Control && !e.Alt)
|
else if (!e.Control && !e.Alt)
|
||||||
{
|
{
|
||||||
@@ -2788,7 +2650,6 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
if (Text == "" && Parent != null && Parent is VlnFlexGrid)
|
if (Text == "" && Parent != null && Parent is VlnFlexGrid)
|
||||||
{
|
{
|
||||||
//ShowMyParentsFonts();
|
|
||||||
SelectionFont = Parent.Font;
|
SelectionFont = Parent.Font;
|
||||||
}
|
}
|
||||||
// add the character with its font depending on the char....
|
// add the character with its font depending on the char....
|
||||||
@@ -3042,7 +2903,6 @@ namespace Volian.Controls.Library
|
|||||||
_AdjustingSelection = true;
|
_AdjustingSelection = true;
|
||||||
PushSelection();
|
PushSelection();
|
||||||
FindLinks();
|
FindLinks();
|
||||||
//IdentifyLinks();
|
|
||||||
PopSelection();
|
PopSelection();
|
||||||
LinkLocation llx = FindLinkLocation();
|
LinkLocation llx = FindLinkLocation();
|
||||||
if (_CheckSelection)
|
if (_CheckSelection)
|
||||||
@@ -3257,98 +3117,6 @@ namespace Volian.Controls.Library
|
|||||||
Select(locStart, locLength);
|
Select(locStart, locLength);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
//#region FontAndStylesSupport
|
|
||||||
//private void ToggleFontStyle(FontStyle style, bool att_on)
|
|
||||||
//{
|
|
||||||
// int start = SelectionStart;
|
|
||||||
// int len = SelectionLength;
|
|
||||||
// System.Drawing.Font currentFont;
|
|
||||||
// FontStyle fs;
|
|
||||||
// for (int i = 0; i < len; ++i)
|
|
||||||
// {
|
|
||||||
// Select(start + i, 1);
|
|
||||||
// currentFont = SelectionFont;
|
|
||||||
// fs = currentFont.Style;
|
|
||||||
// //add or remove style
|
|
||||||
// if (!att_on)fs = fs | style;
|
|
||||||
// else fs = fs & ~style;
|
|
||||||
|
|
||||||
// SelectionFont = new Font(
|
|
||||||
// currentFont.FontFamily,
|
|
||||||
// currentFont.Size,
|
|
||||||
// fs
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a Font with:
|
|
||||||
/// 1) The font applying to the entire selection, if none is the default font.
|
|
||||||
/// 2) The font size applying to the entire selection, if none is the size of the default font.
|
|
||||||
/// 3) A style containing the attributes that are common to the entire selection, default regular.
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
//public Font GetFontDetails()
|
|
||||||
//{
|
|
||||||
// //This method should handle cases that occur when multiple fonts/styles are selected
|
|
||||||
|
|
||||||
// int start = SelectionStart;
|
|
||||||
// int len = SelectionLength;
|
|
||||||
// int TempStart = 0;
|
|
||||||
|
|
||||||
// if (len <= 1)
|
|
||||||
// {
|
|
||||||
// // Return the selection or default font
|
|
||||||
// if (SelectionFont != null)
|
|
||||||
// return SelectionFont;
|
|
||||||
// else
|
|
||||||
// return Font; // should be default from format.
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Step through the selected text one char at a time
|
|
||||||
// // after setting defaults from first char
|
|
||||||
// _rtbTemp.Rtf = SelectedRtf;
|
|
||||||
|
|
||||||
// //Turn everything on so we can turn it off one by one
|
|
||||||
// FontStyle replystyle =
|
|
||||||
// FontStyle.Bold | FontStyle.Italic | FontStyle.Underline;
|
|
||||||
|
|
||||||
// // Set reply font, size and style to that of first char in selection.
|
|
||||||
// _rtbTemp.Select(TempStart, 1);
|
|
||||||
// string replyfont = _rtbTemp.SelectionFont.Name;
|
|
||||||
// float replyfontsize = _rtbTemp.SelectionFont.Size;
|
|
||||||
// replystyle = replystyle & _rtbTemp.SelectionFont.Style;
|
|
||||||
|
|
||||||
// // Search the rest of the selection
|
|
||||||
// for (int i = 1; i < len; ++i)
|
|
||||||
// {
|
|
||||||
// _rtbTemp.Select(TempStart + i, 1);
|
|
||||||
|
|
||||||
// // Check reply for different style
|
|
||||||
// replystyle = replystyle & _rtbTemp.SelectionFont.Style;
|
|
||||||
|
|
||||||
// // Check font
|
|
||||||
// if (replyfont != _rtbTemp.SelectionFont.FontFamily.Name)
|
|
||||||
// replyfont = "";
|
|
||||||
|
|
||||||
// // Check font size
|
|
||||||
// if (replyfontsize != _rtbTemp.SelectionFont.Size)
|
|
||||||
// replyfontsize = (float)0.0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Now set font and size if more than one font or font size was selected
|
|
||||||
// if (replyfont == "")
|
|
||||||
// replyfont = _rtbTemp.Font.FontFamily.Name;
|
|
||||||
|
|
||||||
// if (replyfontsize == 0.0)
|
|
||||||
// replyfontsize = _rtbTemp.Font.Size;
|
|
||||||
|
|
||||||
// // generate reply font
|
|
||||||
// Font reply
|
|
||||||
// = new Font(replyfont, replyfontsize, replystyle);
|
|
||||||
|
|
||||||
// return reply;
|
|
||||||
//}
|
|
||||||
//#endregion
|
|
||||||
#region EnumsSelectionRange
|
#region EnumsSelectionRange
|
||||||
private enum StartStatus : int
|
private enum StartStatus : int
|
||||||
{
|
{
|
||||||
@@ -3425,12 +3193,6 @@ namespace Volian.Controls.Library
|
|||||||
DebugPrint("SelectionStart {0}, SelectionEnd {1}, TextLength {2}",
|
DebugPrint("SelectionStart {0}, SelectionEnd {1}, TextLength {2}",
|
||||||
SelectionStart, SelectionStart + SelectionLength,
|
SelectionStart, SelectionStart + SelectionLength,
|
||||||
TextLength);
|
TextLength);
|
||||||
//if (_RangeStartLink != null)
|
|
||||||
// _RangeStartLink.Show("startLink");
|
|
||||||
//if (_RangeEndLink != null)
|
|
||||||
// _RangeEndLink.Show("endLink");
|
|
||||||
//if (foundLink != null)
|
|
||||||
// foundLink.Show("foundLink");
|
|
||||||
|
|
||||||
if (foundLink == null)
|
if (foundLink == null)
|
||||||
return RTBRangeStatus = RangeStatus.NoContainedLinks;
|
return RTBRangeStatus = RangeStatus.NoContainedLinks;
|
||||||
@@ -3749,7 +3511,6 @@ namespace Volian.Controls.Library
|
|||||||
static void tsi_Click(object sender, EventArgs e)
|
static void tsi_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
ToolStripMenuItem tsmi = sender as ToolStripMenuItem;
|
ToolStripMenuItem tsmi = sender as ToolStripMenuItem;
|
||||||
//_ContextMenuStepRTB.MyRTBItem.MyStepPanel.MyStepTabPanel.MyStepTabRibbon.OpenContextMenu(tsmi.Owner.Location);
|
|
||||||
_ContextMenuStepRTB.OnOpenContextMenu(sender, new StepRTBLocationEventArgs(tsmi.Owner.Location));
|
_ContextMenuStepRTB.OnOpenContextMenu(sender, new StepRTBLocationEventArgs(tsmi.Owner.Location));
|
||||||
}
|
}
|
||||||
// This is our customized Spell Check dialog
|
// This is our customized Spell Check dialog
|
||||||
@@ -4144,63 +3905,6 @@ namespace Volian.Controls.Library
|
|||||||
if (NextLink != null)
|
if (NextLink != null)
|
||||||
Console.WriteLine("LinkLocation: {0}.NextLink {1}", str, NextLink);
|
Console.WriteLine("LinkLocation: {0}.NextLink {1}", str, NextLink);
|
||||||
}
|
}
|
||||||
// #region ClipboardHandler
|
|
||||||
// private const int WM_CUT = 0x0300;
|
|
||||||
// private const int WM_COPY = 0x0301;
|
|
||||||
// private const int WM_PASTE = 0x0302;
|
|
||||||
|
|
||||||
// public delegate void ClipboardEventHandler(object sender, ClipboardEventArgs e);
|
|
||||||
|
|
||||||
// [Category("Clipboard")]
|
|
||||||
// public event ClipboardEventHandler CutText;
|
|
||||||
// [Category("Clipboard")]
|
|
||||||
// public event ClipboardEventHandler CopiedText;
|
|
||||||
// [Category("Clipboard")]
|
|
||||||
// public event ClipboardEventHandler PastedText;
|
|
||||||
|
|
||||||
// protected override void WndProc(ref Message m)
|
|
||||||
// {
|
|
||||||
// if (m.Msg == WM_CUT)
|
|
||||||
// {
|
|
||||||
// if (CutText != null)
|
|
||||||
// CutText(this, new ClipboardEventArgs(this.SelectedText));
|
|
||||||
// }
|
|
||||||
// else if (m.Msg == WM_COPY)
|
|
||||||
// {
|
|
||||||
// if (CopiedText != null)
|
|
||||||
// CopiedText(this, new ClipboardEventArgs(this.SelectedText));
|
|
||||||
// }
|
|
||||||
// else if (m.Msg == WM_PASTE)
|
|
||||||
// {
|
|
||||||
// if (PastedText != null)
|
|
||||||
// PastedText(this, new ClipboardEventArgs(Clipboard.GetText()));
|
|
||||||
// }
|
|
||||||
|
|
||||||
// base.WndProc(ref m);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//public class ClipboardEventArgs : EventArgs
|
|
||||||
//{
|
|
||||||
// private string clipboardText;
|
|
||||||
// public string ClipboardText
|
|
||||||
// {
|
|
||||||
// get
|
|
||||||
// {
|
|
||||||
// return clipboardText;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// set
|
|
||||||
// {
|
|
||||||
// clipboardText = value;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public ClipboardEventArgs(string clipboardText)
|
|
||||||
// {
|
|
||||||
// this.clipboardText = clipboardText;
|
|
||||||
// }
|
|
||||||
// #endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -3367,7 +3367,14 @@ namespace Volian.Controls.Library
|
|||||||
MessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
MessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (MyEditItem.MyStepPanel.VwMode == E_ViewMode.View)
|
//C2026-021 Expand Functionality of Viewing Mode
|
||||||
|
if (MyEditItem.MyStepPanel.VwMode == E_ViewMode.View && MyEditItem.MyStepPanel.ApplDisplayMode > 0)
|
||||||
|
{
|
||||||
|
//Procedure Viewing Mode is set to a specific Unit - so cannot exit vie only mode
|
||||||
|
MessageBox.Show(this, "Procedures with multiple units are only editable when the Viewing Mode is set to Master. To change out of View Only Mode, first open the Step Propeties panel->Applicability tab and change the Viewing Mode to be Master. Then you can disable View Only Mode.", "Procedure Viewing Mode Incompatiple with Edits", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (MyEditItem.MyStepPanel.VwMode == E_ViewMode.View)
|
||||||
{
|
{
|
||||||
//swapping into edit mode, so check out procedure and Setup Security
|
//swapping into edit mode, so check out procedure and Setup Security
|
||||||
(this.Parent as StepTabPanel).MyDisplayTabItem.OwnerID = MySessionInfo.CheckOutItem(MyEditItem.MyItemInfo.MyProcedure.ItemID, 0);
|
(this.Parent as StepTabPanel).MyDisplayTabItem.OwnerID = MySessionInfo.CheckOutItem(MyEditItem.MyItemInfo.MyProcedure.ItemID, 0);
|
||||||
@@ -3556,7 +3563,10 @@ namespace Volian.Controls.Library
|
|||||||
MyEditItem.SaveContents();
|
MyEditItem.SaveContents();
|
||||||
using (DocVersion dv = DocVersion.Get(Mydvi.VersionID))
|
using (DocVersion dv = DocVersion.Get(Mydvi.VersionID))
|
||||||
{
|
{
|
||||||
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(Mydvi));
|
//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
|
// 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
|
if (dv.ROfstLoadingFigures || dv.NewerRoFst) // B2017-125 see if loading figures was completed
|
||||||
{
|
{
|
||||||
@@ -3564,10 +3574,30 @@ namespace Volian.Controls.Library
|
|||||||
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
|
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
|
||||||
roFstInfo = Mydvi.DocVersionAssociations[0].MyROFst;
|
roFstInfo = Mydvi.DocVersionAssociations[0].MyROFst;
|
||||||
}
|
}
|
||||||
|
else if (!dv.ROfstLastCompleted && origfstid == roFstInfo.ROFstID)
|
||||||
|
{
|
||||||
|
//Handle issue where load failed without completing update
|
||||||
|
//previous RO FST did not load, get last loaded ID
|
||||||
|
//if none, use -1 which will check all ROs in the Working Draft
|
||||||
|
string cfg = dv.DocVersionAssociations[0].Config;
|
||||||
|
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg);
|
||||||
|
if (dv.DocVersionAssociations[0]?.MyROFst != null)
|
||||||
|
{
|
||||||
|
if (!int.TryParse(ac.ROUpdate_PrevROFSTID, out origfstid))
|
||||||
|
{
|
||||||
|
origfstid = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
origfstid = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||||
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
|
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
|
||||||
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, null);
|
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, null, roFstInfo, origfstid, roFstInfo.ROFstID);
|
||||||
swROUpdate.Close();
|
swROUpdate.Close();
|
||||||
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
|
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
|
||||||
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||||
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST");
|
StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST");
|
||||||
@@ -3575,7 +3605,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
Cursor = Cursors.Default;
|
Cursor = Cursors.Default;
|
||||||
FinalProgressBarMessage = "ROs values updated";
|
FinalProgressBarMessage = "ROs values updated";
|
||||||
}
|
}
|
||||||
private System.IO.StreamWriter swROUpdate;
|
private System.IO.StreamWriter swROUpdate;
|
||||||
// write the RO reference changes to a text file, include the old/new text, location, and the itemid of the step element
|
// write the RO reference changes to a text file, include the old/new text, location, and the itemid of the step element
|
||||||
void ContentInfo_StaticContentInfoChange(object sender, StaticContentInfoEventArgs args)
|
void ContentInfo_StaticContentInfoChange(object sender, StaticContentInfoEventArgs args)
|
||||||
@@ -3615,10 +3645,11 @@ namespace Volian.Controls.Library
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (ProgressBar == null) return;
|
if (ProgressBar == null) return;
|
||||||
ProgressBar.Value = 100;
|
|
||||||
ProgressBar.Maximum = 100;
|
ProgressBar.Text = value;
|
||||||
ProgressBar.Text = value;
|
ProgressBar.Maximum = 100;
|
||||||
Application.DoEvents();
|
ProgressBar.Value = 100;
|
||||||
|
Application.DoEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2465,7 +2465,11 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
Cursor = Cursors.WaitCursor; // C2023-002: move wait cursor after check out error
|
Cursor = Cursors.WaitCursor; // C2023-002: move wait cursor after check out error
|
||||||
int ownerid = MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion);
|
int ownerid = MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion);
|
||||||
using (DocVersion dv = DocVersion.Get(MyDVI.VersionID))
|
|
||||||
|
//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
|
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(MyDVI)); // RO changes placed in file in the Documents\VEPROMS folder
|
||||||
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
|
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
|
||||||
@@ -2475,10 +2479,30 @@ namespace Volian.Controls.Library
|
|||||||
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
|
ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv, roFstInfo, DoProgressBarRefresh);
|
||||||
roFstInfo = MyDVI.DocVersionAssociations[0].MyROFst;
|
roFstInfo = MyDVI.DocVersionAssociations[0].MyROFst;
|
||||||
}
|
}
|
||||||
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
else if (!dv.ROfstLastCompleted && origfstid == roFstInfo.ROFstID)
|
||||||
|
{
|
||||||
|
//Handle issue where load failed without completing update
|
||||||
|
//previous RO FST did not load, get last loaded ID
|
||||||
|
//if none, use -1 which will check all ROs in the Working Draft
|
||||||
|
string cfg = dv.DocVersionAssociations[0].Config;
|
||||||
|
AssociationConfig ac = new AssociationConfig((cfg == null || cfg.Length == 0) ? "<Config />" : cfg);
|
||||||
|
if (dv.DocVersionAssociations[0]?.MyROFst != null)
|
||||||
|
{
|
||||||
|
if (!int.TryParse(ac.ROUpdate_PrevROFSTID, out origfstid))
|
||||||
|
{
|
||||||
|
origfstid = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
origfstid = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||||
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
|
ContentInfo.StaticContentInfoChange += ContentInfo_StaticContentInfoChange; // write changes to a text file
|
||||||
ROFst newrofst = ROFstInfo.RefreshROFst(dv, roFstInfo, DoProgressBarRefresh, null);
|
ROFstInfo.RefreshROFstAtItemLevel(DocVersionInfo.Get(dv.VersionID), DoProgressBarRefresh, null, roFstInfo, origfstid, roFstInfo.ROFstID);
|
||||||
swROUpdate.Close();
|
swROUpdate.Close();
|
||||||
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
|
ContentInfo.StaticContentInfoChange -= ContentInfo_StaticContentInfoChange;
|
||||||
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate);
|
||||||
OnTabDisplay(this, new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST"));
|
OnTabDisplay(this, new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST"));
|
||||||
@@ -2526,10 +2550,10 @@ namespace Volian.Controls.Library
|
|||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (ProgressBar == null) return;
|
if (ProgressBar == null) return;
|
||||||
ProgressBar.Value = 100;
|
ProgressBar.Text = value;
|
||||||
ProgressBar.Maximum = 100;
|
ProgressBar.Maximum = 100;
|
||||||
ProgressBar.Text = value;
|
ProgressBar.Value = 100;
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public List<string> roFstInfo_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args)
|
public List<string> roFstInfo_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args)
|
||||||
|
|||||||
Reference in New Issue
Block a user