Compare commits
20 Commits
C2024-004_
...
B2024-046-
Author | SHA1 | Date | |
---|---|---|---|
b3f7633af7 | |||
8f2cbf4081 | |||
![]() |
c25f501909 | ||
![]() |
bf72a6bf78 | ||
![]() |
a1380dbb8a | ||
![]() |
501798a8cb | ||
a240bc2c19 | |||
a804a3866a | |||
069ffb80e9 | |||
![]() |
5255080291 | ||
![]() |
ae35d9f0d7 | ||
afbd653611 | |||
![]() |
9a55111e1e | ||
422a3053b7 | |||
feb74ee09f | |||
7cebb2b7f1 | |||
![]() |
8097c6283c | ||
![]() |
8f08ef5ee4 | ||
![]() |
fd26f16776 | ||
![]() |
21a83df99d |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -22229,14 +22229,16 @@ Go
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
/*
|
||||
==========================================================================================================
|
||||
Begin: C2024-004: KL - Update Copy Replace functionality, (remove ''copy of'')
|
||||
Begin: C2024-004 | B2024-041: KL - Update Copy Replace functionality, (remove ''copy of'')
|
||||
==========================================================================================================
|
||||
*/
|
||||
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[CopyItemAndChildren]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [CopyItemAndChildren];
|
||||
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[ReplaceItemAndChildren]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [ReplaceItemAndChildren];
|
||||
GO
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -22246,11 +22248,22 @@ GO
|
||||
/*
|
||||
==========================================================================================================
|
||||
Author: Kevin Laskey
|
||||
Modified Date: 07/09/2024
|
||||
Description: Copy Item and its Children
|
||||
Create Date: 07/15/2024
|
||||
Description: B2024-041: "Copy of" is no longer being appended for paste before/after
|
||||
==========================================================================================================
|
||||
*/
|
||||
CREATE PROCEDURE [dbo].[CopyItemAndChildren]
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[CopyItemAndChildren] Script Date: 7/15/2024 9:29:21 AM ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
/*****************************************************************************
|
||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
|
||||
*****************************************************************************/
|
||||
CREATE PROCEDURE [dbo].[ReplaceItemAndChildren]
|
||||
(
|
||||
@StartItemID INT,
|
||||
@DestFormatID INT,
|
||||
@@ -22295,7 +22308,6 @@ INSERT INTO @Children SELECT ItemID,ItemID,ContentID,ContentID,FormatID,FormatID
|
||||
-- <<< Copy Contents >>>
|
||||
-- Create new content rows to match the existing rows. Set the type to the Current ContentID temporarily
|
||||
-- so that the new content rows can be associated with the existing content rows.
|
||||
-- Rem 'Copy Of ' + before first [Number] for C2024-004 (KL)
|
||||
INSERT INTO Contents
|
||||
([Number],[Text],[Type],[FormatID],[Config],[DTS],[UserID])
|
||||
select CASE when [ContentID] = @StartContentID and [Type]<20000 then [Number] else [Number] end,
|
||||
@@ -22623,23 +22635,890 @@ BEGIN CATCH -- Catch Block
|
||||
ELSE IF( @@TRANCOUNT > 1 ) COMMIT -- Otherwise commit. Top level will rollback
|
||||
EXEC vlnErrorHandler
|
||||
END CATCH
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[PasteItemReplace]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [PasteItemReplace];
|
||||
GO
|
||||
|
||||
/*****************************************************************************
|
||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
Copyright 2024 - Volian Enterprises, Inc. All rights reserved.
|
||||
*****************************************************************************/
|
||||
/*
|
||||
==========================================================================================================
|
||||
Author: Kevin Laskey
|
||||
Create Date: 07/15/2024
|
||||
Description: B2024-041: "Copy of" is no longer being appended for paste before/after
|
||||
==========================================================================================================
|
||||
*/
|
||||
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
/****** Object: StoredProcedure [dbo].[PasteItemReplace] Script Date: 03/20/2012 16:02:54 ******/
|
||||
/*
|
||||
declare @NewItemID int
|
||||
declare @dts datetime
|
||||
set @newitemid = 0
|
||||
set @dts = getdate()
|
||||
exec PasteItemReplace 398,397,20014,@dts,'bodine',@NewItemID output
|
||||
*/
|
||||
-- ItemID is item to replace
|
||||
-- StartItemID is item to copy
|
||||
/*****************************************************************************
|
||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
|
||||
*****************************************************************************/
|
||||
CREATE PROCEDURE [dbo].[PasteItemReplace]
|
||||
(
|
||||
@ItemID int=null, @StartItemID int=null,
|
||||
@Type int=null, @DTS datetime, @UserID nvarchar(100),
|
||||
@NewItemID int output
|
||||
)
|
||||
WITH EXECUTE AS OWNER
|
||||
AS
|
||||
BEGIN TRY -- Try Block
|
||||
BEGIN TRANSACTION
|
||||
DECLARE @ContentID AS INT
|
||||
DECLARE @NextItemID AS INT
|
||||
DECLARE @PreviousItemID AS INT
|
||||
DECLARE @ExternalChildCount AS INT
|
||||
DECLARE @ExternalCount AS INT
|
||||
DECLARE @Path AS VARCHAR(MAX)
|
||||
DECLARE @Children AS TABLE
|
||||
(
|
||||
ItemID INT PRIMARY KEY,
|
||||
ContentID INT
|
||||
)
|
||||
|
||||
if exists (select * from tblitems where itemid = @ItemID and DeleteStatus !=0)
|
||||
BEGIN
|
||||
RAISERROR ('###Cannot Paste Step###This current step has been deleted in another session',16,1)
|
||||
RETURN
|
||||
END
|
||||
-- First check if the replaced item can be deleted, i.e. it doesn't have transitions
|
||||
-- pointing to it or children.
|
||||
|
||||
DECLARE @ExternalTrans TABLE
|
||||
(
|
||||
[FromItemID] int,
|
||||
[TransitionID] [int] NOT NULL,
|
||||
[FromID] [int] NOT NULL,
|
||||
[ToID] [int] NOT NULL,
|
||||
[RangeID] [int] NOT NULL,
|
||||
[Config] [nvarchar](max) NULL
|
||||
)
|
||||
SET NOCOUNT ON
|
||||
DECLARE @DeleteID int
|
||||
INSERT INTO DeleteLog (UserID) VALUES (@UserID)
|
||||
SELECT @DeleteID = SCOPE_IDENTITY()
|
||||
SELECT @ContentID = ContentID, @PreviousItemID = PreviousID FROM Items WHERE ItemID = @ItemID
|
||||
SELECT @NextItemID = ItemID FROM Items WHERE PreviousID = @ItemID
|
||||
--SELECT @ExternalCount = count(*) FROM vefn_FindExternalTransitions(@ItemID)
|
||||
SELECT @ExternalChildCount = count(*) FROM vefn_FindExternalChildTransitions(@ItemID)
|
||||
SET @Path = [dbo].[ve_GetShortPath](@ItemID)
|
||||
|
||||
--IF @ExternalCount > 0 AND @NextItemID is null
|
||||
--BEGIN
|
||||
-- RAISERROR ('###Cannot Delete Item###Step %d has External Transitions and has no next step - (%s)',16,1,@ItemID,@Path)
|
||||
-- RETURN
|
||||
--END
|
||||
|
||||
IF @ExternalChildCount > 0
|
||||
BEGIN
|
||||
RAISERROR ('###Cannot Delete Item###Step %d has External Transitions to it''s children - (%s)',16,1,@ItemID,@Path)
|
||||
RETURN
|
||||
END
|
||||
|
||||
-- Copy the item, 'NewItemID' represents the new item(s)
|
||||
-- DestFormatID is the formatid for the destination parent's format
|
||||
DECLARE @DestFormatID int
|
||||
SET @DestFormatID = .dbo.vefn_GetInheritedFormat(@ItemID, 0)
|
||||
EXECUTE ReplaceItemAndChildren @StartItemID, @DestFormatID, @UserID, @NewItemID OUTPUT
|
||||
|
||||
-- Adjust the next/previous to point to the new item
|
||||
|
||||
DECLARE @PreviousID int
|
||||
SELECT @PreviousID = [PreviousID]
|
||||
FROM [ITEMS] II
|
||||
WHERE [ItemID]=@ItemID
|
||||
UPDATE [ITEMS] SET [PreviousID]=@PreviousID where [ItemID]=@NewItemID
|
||||
UPDATE [CONTENTS] SET [Type]=@Type
|
||||
FROM [CONTENTS] CC JOIN [ITEMS] ii ON CC.[ContentID]=II.[ContentID]
|
||||
WHERE [ItemID]=@NewItemID
|
||||
UPDATE [ITEMS] SET [PreviousID]=@NewItemID where [PreviousID]=@ItemID
|
||||
UPDATE [PARTS] SET [ItemID]=@NewItemID where [ItemID]=@ItemID
|
||||
|
||||
-- UPDATE DocVersion if this was a procedure
|
||||
UPDATE DocVersions SET ItemID=@NewItemID where ItemID = @ItemID
|
||||
|
||||
-- If there were 'external transitions' that pointed to the original
|
||||
-- top replaced step, adjust them to point to the new top.
|
||||
INSERT INTO @ExternalTrans SELECT * FROM vefn_FindExternalTransitions(@ItemID)
|
||||
OPTION (MAXRECURSION 10000)
|
||||
IF (SELECT COUNT(*) from @ExternalTrans) > 0
|
||||
BEGIN
|
||||
-- Update content records for the transitions
|
||||
Update CC
|
||||
Set Text = DBO.vefn_FixTransitionText(Text,TT.TransitionID,TT.TranType,TT.ToID,TT.RangeID,@ItemID,@NewItemID)
|
||||
From CONTENTS CC
|
||||
JOIN Transitions TT ON TT.FromID = CC.ContentID
|
||||
WHERE TransitionID in(Select TransitionID from @ExternalTrans)
|
||||
-- Update transitions that point to @ItemID to Point to @NextItemID
|
||||
UPDATE TRANSITIONS
|
||||
SET ToID = case when ToID = @ItemID then @NewItemID else ToID END,
|
||||
RangeID = case when RangeID = @ItemID then @NewItemID else RangeID END
|
||||
WHERE TransitionID in(Select TransitionID from @ExternalTrans)
|
||||
|
||||
DECLARE @typeID int -- AnnotationType
|
||||
SELECT @typeID = TypeID from AnnotationTypes where Name = 'Verification Required'
|
||||
IF(@typeID IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [AnnotationTypes] ([Name],[UserID]) VALUES ('Verification Required','Volian')
|
||||
SELECT @typeID = SCOPE_IDENTITY()
|
||||
END
|
||||
-- Add 'Verification Required' annotions for transtions that pointed to top step
|
||||
-- and need to point to
|
||||
INSERT INTO [Annotations] ([ItemID],[TypeID],[SearchText],[UserID])
|
||||
SELECT ItemID, @typeID,'Verify Replaced Step Transition Destination',@UserID
|
||||
FROM Items where ItemID in (SELECT FromItemID FROM @ExternalTrans)
|
||||
|
||||
END
|
||||
-- Remove the old one
|
||||
|
||||
-- Get list of Children
|
||||
INSERT INTO @Children SELECT * FROM vefn_ChildItems(@ItemID)
|
||||
-- Delete Annotations for @ItemID and children
|
||||
DELETE from Annotations where ItemID in(Select ItemID from @Children)
|
||||
-- Delete Details associated with @ContentID and children
|
||||
DELETE from Details where ContentID in(Select ContentID from @Children)
|
||||
-- Delete Grids associated with @ContentID and children
|
||||
DELETE from Grids where ContentID in(Select ContentID from @Children)
|
||||
-- Delete Images associated with @ContentID and children
|
||||
DELETE from Images where ContentID in(Select ContentID from @Children)
|
||||
-- Delete Entries associated with @ContentID and children
|
||||
DELETE from Entries where ContentID in(Select ContentID from @Children)
|
||||
-- Delete ROUsages associated with @ContentID and children
|
||||
DELETE from RoUsages where ContentID in(Select ContentID from @Children)
|
||||
-- Delete ZTransitions records associated with @ContentID and children
|
||||
DELETE FROM ZTransitions where TransitionID
|
||||
in(SELECT TransitionID from Transitions where FromID in(SELECT ContentID FROM @Children) or FromID = @ContentID)
|
||||
-- Delete Transitions associated with @ContentID and children
|
||||
DELETE FROM Transitions where FromID in(SELECT ContentID FROM @Children) or FromID = @ContentID
|
||||
-- Delete Parts associated with @ContentID and children
|
||||
DELETE from Parts where ContentID in(Select ContentID from @Children)
|
||||
-- Delete ZContents associated with @ContentID and children
|
||||
DELETE from ZContents where ContentID in(Select ContentID from @Children)
|
||||
-- Disconnect Items from Each Other
|
||||
DELETE from Items where ItemID in(Select ItemID from @Children) and PreviousID Is Not Null
|
||||
-- Disconnect Items to be deleted from each other
|
||||
Update Items set PreviousID = null where ItemID in (Select ItemID from @Children) and PreviousID Is Not Null
|
||||
-- Delete Item Records
|
||||
DELETE from Items where ItemID in(Select ItemID from @Children)
|
||||
-- DELETE Contents
|
||||
DELETE from Contents where ContentID in(Select ContentID from @Children)
|
||||
--delete from itemaudits where itemid = @newitemid
|
||||
delete from itemaudits where itemid in (select itemid from vefn_ChildItems(@newitemid))
|
||||
--delete from contentaudits where contentid = (select contentid from items where itemid = @newitemid)
|
||||
delete from contentaudits where contentid in (select contentid from vefn_ChildItems(@newitemid))
|
||||
DELETE from DeleteLog where DeleteID = @DeleteID
|
||||
IF( @@TRANCOUNT > 0 ) COMMIT
|
||||
EXECUTE GetItem @NewItemID
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[CopyItemAndChildren]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
|
||||
DROP PROCEDURE [CopyItemAndChildren];
|
||||
GO
|
||||
|
||||
/*****************************************************************************
|
||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
Copyright 2024 - Volian Enterprises, Inc. All rights reserved.
|
||||
*****************************************************************************/
|
||||
/*
|
||||
==========================================================================================================
|
||||
Author: Kevin Laskey
|
||||
Create Date: 07/15/2024
|
||||
Description: B2024-041: "Copy of" is no longer being appended for paste before/after
|
||||
==========================================================================================================
|
||||
*/
|
||||
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[CopyItemAndChildren] Script Date: 7/15/2024 10:01:59 AM ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
/*****************************************************************************
|
||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
Copyright 2012 - Volian Enterprises, Inc. All rights reserved.
|
||||
*****************************************************************************/
|
||||
CREATE PROCEDURE [dbo].[CopyItemAndChildren]
|
||||
(
|
||||
@StartItemID INT,
|
||||
@DestFormatID INT,
|
||||
@UserID NVARCHAR(100),
|
||||
@NewStartItemID int output
|
||||
)
|
||||
WITH EXECUTE AS OWNER
|
||||
AS
|
||||
BEGIN TRY -- Try Block
|
||||
|
||||
--+-----------------------------------------------------------------+
|
||||
--& BEGIN TRANSACTION to make these changes temporary &
|
||||
--+-----------------------------------------------------------------+
|
||||
BEGIN TRANSACTION
|
||||
if exists (select * from tblitems where itemid = @StartItemID and DeleteStatus !=0)
|
||||
BEGIN
|
||||
RAISERROR ('###Cannot Paste Step###This step has been deleted',16,1)
|
||||
RETURN
|
||||
END
|
||||
DECLARE @Children AS TABLE
|
||||
(
|
||||
ItemID INT PRIMARY KEY,
|
||||
NewItemID INT,
|
||||
ContentID INT,
|
||||
NewContentID INT,
|
||||
FormatID INT,
|
||||
NewFormatID INT
|
||||
)
|
||||
DECLARE @NewDocuments AS TABLE
|
||||
(
|
||||
DocID INT PRIMARY KEY,
|
||||
NewDocID INT
|
||||
)
|
||||
-- Locals
|
||||
DECLARE @DTS DATETIME -- DTS of all New Items
|
||||
DECLARE @StartContentID INT
|
||||
Select @StartContentID = ContentID from Items where ItemID = @StartItemID
|
||||
SET @DTS = GETDATE() -- Get the current Date and Time
|
||||
-- Get a list of all of the Items to be copied based upon StartItemID and EndItemID
|
||||
-- If the StartItemID = EndItemID then it is a single item and it's children
|
||||
INSERT INTO @Children SELECT ItemID,ItemID,ContentID,ContentID,FormatID,FormatID FROM vefn_ChildItemsRange(@StartItemID,@StartItemID,null)
|
||||
-- <<< Copy Contents >>>
|
||||
-- Create new content rows to match the existing rows. Set the type to the Current ContentID temporarily
|
||||
-- so that the new content rows can be associated with the existing content rows.
|
||||
INSERT INTO Contents
|
||||
([Number],[Text],[Type],[FormatID],[Config],[DTS],[UserID])
|
||||
select CASE when [ContentID] = @StartContentID and [Type]<20000 then 'Copy Of ' + [Number] else [Number] end,
|
||||
[Text],[ContentID],[FormatID],[Config],@DTS,@UserID
|
||||
from Contents where ContentID in(Select ContentID from @Children)
|
||||
-- Update the @Children with the NewConentIDs
|
||||
--print 'A ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
UPDATE NN set NN.NewContentID = CC.ContentID
|
||||
From Contents CC
|
||||
Join @Children NN on NN.ContentID = CC.Type AND CC.DTS = @DTS and CC.UserID = @UserID
|
||||
-- Reset the Type column in the Contents table with the Type column from the original Records.
|
||||
--print 'B ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
DECLARE @SourceType INT
|
||||
Select @SourceType = Type from Contents where ContentID = @StartContentID
|
||||
if @SourceType = 0
|
||||
BEGIN
|
||||
UPDATE CC set CC.Type = CC2.Type, CC.DTS = CC2.DTS, CC.UserID = CC2.UserID
|
||||
From Contents CC
|
||||
Join @Children NN on NN.NewContentID = CC.ContentID
|
||||
Join Contents CC2 on NN.ContentID = CC2.ContentID
|
||||
END
|
||||
else
|
||||
BEGIN
|
||||
UPDATE CC set CC.Type = CC2.Type
|
||||
From Contents CC
|
||||
Join @Children NN on NN.NewContentID = CC.ContentID
|
||||
Join Contents CC2 on NN.ContentID = CC2.ContentID
|
||||
END
|
||||
--print 'B1 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
-- Contents are done
|
||||
-- SELECT * From Contents where DTS = @DTS and UserID = @UserID
|
||||
-- <<< Copy Grids >>>
|
||||
INSERT INTO [Grids]([ContentID],[Data],[Config],[DTS],[UserID])
|
||||
SELECT NN.[NewContentID],[Data],[Config],@DTS,@UserID
|
||||
FROM [Grids] GG Join @Children NN on GG.ContentID = NN.ContentID
|
||||
-- <<< Copy Images >>>
|
||||
--print 'B2 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
INSERT INTO [Images]([ContentID],[ImageType],[FileName],[Data],[Config],[DTS],[UserID])
|
||||
SELECT NN.[NewContentID],[ImageType],[FileName],[Data],[Config],@DTS,@UserID
|
||||
FROM [Images] II Join @Children NN on II.ContentID = NN.ContentID
|
||||
-- Create new item rows based upon the current item rows and the @Children table, with the NewContentIDs
|
||||
--print 'B3 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
INSERT INTO [Items] ([PreviousID],[ContentID],[DTS],[UserID])
|
||||
SELECT II.[PreviousID], -- Leave the PreviousID as is for now
|
||||
NN.NewContentID, @DTS, @UserID
|
||||
from @Children NN
|
||||
join Items II on II.ContentID = NN.ContentID
|
||||
-- Update the @Children with the NewItemIDs
|
||||
--print 'B4 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
UPDATE NN set NN.NewItemID = II.ItemID
|
||||
From Items II
|
||||
Join @Children NN on NN.NewContentID = II.ContentID AND II.DTS = @DTS and II.UserID = @UserID
|
||||
DECLARE @NewItemID int
|
||||
SELECT @NewItemID = NewItemID
|
||||
FROM @Children
|
||||
WHERE ItemID = @StartItemID
|
||||
--print 'B5 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
UPDATE NN SET NN.[NewFormatID] = CC.[FormatID]
|
||||
FROM @Children NN
|
||||
Join vefn_ChildItemsRange(@NewItemID,@NewItemID,@DestFormatID) CC
|
||||
ON NN.NewItemID = CC.ItemID
|
||||
-- The @Children table is now complete
|
||||
--SELECT * From @Children
|
||||
-- Update the PreviousID in the new Item rows, to the new ItemIDs based upon the old ItemIDs
|
||||
--print 'B6 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
Update II Set II.[PreviousID] = NN.NewItemID
|
||||
from Items II
|
||||
Join @Children NN on NN.ItemID = II.PreviousID AND II.DTS = @DTS and II.UserID = @UserID
|
||||
-- Get the new ItemIDs based upon the old ItemIDs
|
||||
SELECT @NewStartItemID = NewItemID from @Children where ItemID = @StartItemID
|
||||
--SELECT @NewEndItemID = NewItemID from @Children where ItemID = @EndItemID
|
||||
-- Set the PreviousID for the starting Item to null temporarily.
|
||||
-- This will be adjusted based upon where the step is inserted.
|
||||
--print 'B7 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
Update Items Set PreviousID = null where ItemID = @NewStartItemID
|
||||
if @SourceType = 0
|
||||
BEGIN
|
||||
UPDATE II SET II.DTS = II2.DTS, II.UserID = II2.UserID
|
||||
From Items II
|
||||
Join @Children NN on NN.NewItemID = II.ItemID
|
||||
Join Items II2 on NN.ItemID = II2.ItemID
|
||||
WHERE NN.ItemID = @StartItemID
|
||||
END
|
||||
--print 'C ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
-- Items are done
|
||||
--SELECT * From Items where DTS = @DTS and UserID = @UserID
|
||||
-- <<< Copy Parts >>>
|
||||
INSERT INTO [Parts] ([ContentID],[FromType],[ItemID],[DTS],[UserID])
|
||||
Select NNF.NewContentID,[FromType],NNT.NewItemID, @DTS, @UserID from Parts PP
|
||||
JOIN @Children NNF on PP.ContentID = NNF.ContentID
|
||||
JOIN @Children NNT on PP.ItemID = NNT.ItemID
|
||||
--print 'D ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
-- Parts are done
|
||||
-- SELECT * From Parts where DTS = @DTS and UserID = @UserID
|
||||
-- <<< Copy Annotations >>>
|
||||
INSERT INTO [Annotations] ([ItemID],[TypeID],[RtfText],[SearchText],[Config],[DTS],[UserID])
|
||||
Select NewItemID, TypeID, RtfText, SearchText, Config, @DTS, @UserID
|
||||
from Annotations AA Join @Children NN on AA.ItemID = NN.ItemID
|
||||
--print 'E ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
-- Annotations are done
|
||||
-- SELECT * From Annotations where DTS = @DTS and UserID = @UserID
|
||||
-- <<< Copy Documents and Entries>>>
|
||||
-- logic to create Entries for Library Documents
|
||||
INSERT INTO [Entries] ([ContentID],[DocID],[DTS],[UserID])
|
||||
SELECT NN.[NewContentID],EE.[DocID],@DTS,@UserID
|
||||
FROM [Entries] EE JOIN @Children NN on NN.ContentID = EE.ContentID
|
||||
JOIN [Documents] DD on EE.[DocID] = DD.[DocID] and Isnull(LibTitle,'') <> ''
|
||||
-- Logic to create new documents for any documents used that do not have libtitles
|
||||
INSERT INTO [Documents] ([LibTitle],[DocContent],[DocAscii],[Config],[DTS],[UserID],[FileExtension])
|
||||
OUTPUT CAST(INSERTED.[LibTitle] as INT),INSERTED.[DocID] INTO @NewDocuments
|
||||
SELECT str(DD.[DocID]),[DocContent],[DocAscii],[Config],@DTS,@UserID,[FileExtension]
|
||||
FROM [Entries] EE JOIN @Children NN on NN.ContentID = EE.ContentID
|
||||
JOIN [Documents] DD on EE.[DocID] = DD.[DocID] and Isnull(LibTitle,'') = ''
|
||||
UPDATE DD SET LibTitle = ''
|
||||
FROM Documents DD JOIN @NewDocuments ND on DD.[DocID] = ND.[NewDocID]
|
||||
where DTS = @DTS and UserID = @UserID
|
||||
--print 'F ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
-- Documents are Done
|
||||
-- SELECT * From Documents where DTS = @DTS and UserID = @UserID
|
||||
-- Logic to create entries for these newly created documents
|
||||
INSERT INTO [Entries] ([ContentID],[DocID],[DTS],[UserID])
|
||||
SELECT NN.[NewContentID],ND.[NewDocID],@DTS,@UserID
|
||||
FROM [Entries] EE JOIN @Children NN on NN.ContentID = EE.ContentID
|
||||
JOIN @NewDocuments ND on EE.[DocID] = ND.[DocID]
|
||||
-- Logic to Create DROUsages for these newly created documents
|
||||
INSERT INTO [DROUsages] ([DocID],[ROID],[Config],[DTS],[UserID],[RODbID])
|
||||
SELECT ND.[NewDocID],[ROID],[Config],@DTS,@UserID,[RODbID]
|
||||
FROM [DROUsages] RR
|
||||
JOIN @NewDocuments ND on RR.[DocID] = ND.[DocID]
|
||||
|
||||
--print 'G ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
-- Entries are done
|
||||
-- SELECT * From Entries EE JOIN Documents DD on ee.DocID = DD.DocID where EE.DTS = @DTS and EE.UserID = @UserID
|
||||
-- <<< Copy RoUsages >>>
|
||||
INSERT INTO [RoUsages] ([ContentID],[ROID],[Config],[DTS],[UserID],[RODbID])
|
||||
SELECT NN.[NewContentID],CAST([ROUsageID] as nvarchar(16)),[Config],@DTS,@UserID,[RODbID]
|
||||
FROM [RoUsages] RR Join @Children NN on RR.ContentID = NN.ContentID
|
||||
-- Update content records for newly copied records to use correct RO usage ids in the RO tags
|
||||
DECLARE @RowsAffected int
|
||||
SET @RowsAffected=1
|
||||
WHILE @RowsAffected > 0
|
||||
BEGIN
|
||||
UPDATE CC SET [TEXT] = C2.NewText
|
||||
FROM CONTENTS CC
|
||||
JOIN (SELECT C1.ContentID, .dbo.vefn_FixROText(C1.Text, CAST([ROID] as int), [ROUsageID]) NewText
|
||||
FROM CONTENTS C1
|
||||
JOIN @Children NN on C1.ContentID = NN.NewContentID
|
||||
JOIN RoUsages RO on NN.NewContentID = RO.ContentID where Len([ROID]) < 12) C2 ON CC.ContentID = C2.ContentID
|
||||
WHERE [TEXT] <> C2.NewText
|
||||
SET @RowsAffected = @@RowCount
|
||||
END
|
||||
-- Update grid records for newly copied records to use correct RO usage ids in the RO tags
|
||||
SET @RowsAffected=1
|
||||
WHILE @RowsAffected > 0
|
||||
BEGIN
|
||||
UPDATE GG SET [Data] = G2.NewData
|
||||
FROM GRIDS GG
|
||||
JOIN (SELECT G1.ContentID, .dbo.vefn_FixROData(G1.Data, CAST([ROID] as int), [ROUsageID]) NewData
|
||||
FROM GRIDS G1
|
||||
JOIN @Children NN on G1.ContentID = NN.NewContentID
|
||||
JOIN RoUsages RO on NN.NewContentID = RO.ContentID where Len([ROID]) < 12) G2 ON GG.ContentID = G2.ContentID
|
||||
WHERE Cast([Data] as nvarchar(max)) <> cast(G2.NewData as nvarchar(max))
|
||||
SET @RowsAffected = @@RowCount
|
||||
END
|
||||
UPDATE RON SET [ROID] = ROO.[ROID]
|
||||
FROM RoUsages RON
|
||||
JOIN @Children NN on RON.ContentID = NN.NewContentID
|
||||
JOIN RoUsages ROO on CAST(RON.ROID as int) = ROO.RoUsageID
|
||||
where Len(RON.[ROID]) < 12
|
||||
--print 'H ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
-- RoUsages are done
|
||||
-- SELECT * From RoUsages where DTS = @DTS and UserID = @UserID
|
||||
|
||||
-- <<< Copy Transtions >>>
|
||||
-- Note that the inserted record has the 'TranType' field set to old transitionid. This is done
|
||||
-- so that the next step can replace the old transitionid with the new transitionid in the
|
||||
-- content record's transition tokens. The TranType gets reset after the content records are
|
||||
-- updated.
|
||||
-- Also note that the 'toid/rangeid' may need converted to newly copied ids or may not. If it's
|
||||
-- not a range, then it always is converted to new, if there is a new. If it's a range, both
|
||||
-- the toid & the rangeid must be new in order for the conversion to be correct. You cannot
|
||||
-- have part of the range pointing to the new and part of the range pointing to the original
|
||||
-- locations.
|
||||
|
||||
INSERT INTO .[dbo].[Transitions] ([FromID],[ToID],[RangeID],[IsRange],[TranType],[Config],[DTS],[UserID])
|
||||
SELECT NNF.[NewContentID],
|
||||
-- if both toid & range are null, use the original toid & rangeid
|
||||
CASE WHEN NNT.[NewItemID] is null or NNR.[NewItemID] is null THEN [ToID] ELSE NNT.[NewItemID] END,
|
||||
CASE WHEN NNT.[NewItemID] is null or NNR.[NewItemID] is null THEN [RangeID] ELSE NNR.[NewItemID] END,
|
||||
[IsRange],[TransitionID],[Config],@DTS,@UserID
|
||||
FROM .[dbo].[Transitions] TT
|
||||
JOIN @Children NNF on TT.[FromID] = NNF.[ContentID]
|
||||
LEFT JOIN @Children NNT on TT.[ToID] = NNT.[ItemID]
|
||||
LEFT JOIN @Children NNR on TT.[RangeID] = NNR.[ItemID]
|
||||
--print 'H1 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
-- -- Update content records for newly copied records to use correct TransitionIDs in the Transition tags
|
||||
SET @RowsAffected=1
|
||||
WHILE @RowsAffected > 0
|
||||
BEGIN
|
||||
UPDATE CC SET [TEXT] = C2.NewText
|
||||
FROM CONTENTS CC
|
||||
JOIN (SELECT C1.ContentID, .dbo.vefn_FixTransitionTextForCopy(C1.Text, TRO.TransitionID, TRO.TranType, TRO.[ToID], TRO.[RangeID],TR.[TransitionID], TR.[ToID], TR.[RangeID], .dbo.vefn_GetNewTranType(NN.FormatID, NN.NewFormatID, TRO.TranType)) NewText
|
||||
FROM CONTENTS C1
|
||||
JOIN @Children NN on C1.ContentID = NN.NewContentID
|
||||
JOIN Transitions TR on NN.NewContentID = TR.FromID
|
||||
JOIN Transitions TRO on TR.TranType = TRO.TransitionID) C2 ON CC.ContentID = C2.ContentID
|
||||
WHERE [TEXT] <> C2.NewText
|
||||
SET @RowsAffected = @@RowCount
|
||||
END
|
||||
--print 'H2 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
--set nocount off
|
||||
-- -- Update grid records for newly copied records to use correct TransitionIDs in the Transition tags
|
||||
declare @grids table
|
||||
(
|
||||
contentid int primary key,
|
||||
data xml
|
||||
)
|
||||
insert into @grids select gg.contentid,gg.data from GRIDS GG
|
||||
where gg.contentid in (select nn.newcontentid from
|
||||
@Children NN
|
||||
JOIN Transitions TR on NN.NewContentID = TR.FromID
|
||||
JOIN Transitions TRO on TR.TranType = TRO.TransitionID)
|
||||
--print 'H2.1 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
--select * from @grids
|
||||
SET @RowsAffected=1
|
||||
WHILE @RowsAffected > 0
|
||||
BEGIN
|
||||
UPDATE GG SET [DATA] = G2.NewData
|
||||
FROM @GRIDS GG
|
||||
JOIN (SELECT G1.ContentID, .dbo.vefn_FixTransitionDataForCopy(G1.Data, TRO.TransitionID, TRO.TranType, TRO.[ToID], TRO.[RangeID],TR.[TransitionID], TR.[ToID], TR.[RangeID], .dbo.vefn_GetNewTranType(NN.FormatID, NN.NewFormatID, TRO.TranType)) NewData
|
||||
FROM @GRIDS G1
|
||||
JOIN @Children NN on G1.ContentID = NN.NewContentID
|
||||
JOIN Transitions TR on NN.NewContentID = TR.FromID
|
||||
JOIN Transitions TRO on TR.TranType = TRO.TransitionID) G2 ON GG.ContentID = G2.ContentID
|
||||
WHERE Cast([DATA] as nvarchar(max)) <> CAST(G2.NewData as nvarchar(max))
|
||||
SET @RowsAffected = @@RowCount
|
||||
END
|
||||
--print 'H2.2 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
update GG set data = g1.data from Grids gg join @grids g1 on gg.contentid = g1.contentid
|
||||
--print 'H3 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
--set nocount on
|
||||
-- Add 'Verification Required' AnnotationType
|
||||
DECLARE @typeID int
|
||||
SELECT @typeID = TypeID from AnnotationTypes where Name = 'Verification Required'
|
||||
IF(@typeID IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [AnnotationTypes] ([Name],[UserID]) VALUES ('Verification Required','Volian')
|
||||
SELECT @typeID = SCOPE_IDENTITY()
|
||||
END
|
||||
-- Add "Verification Required" Annotation for each Transition whose transition format changes
|
||||
INSERT INTO [Annotations] ([ItemID],[TypeID],[SearchText],[UserID])
|
||||
SELECT NN.NewItemID, @typeID,'Verify Transition Format',@UserID
|
||||
FROM Transitions TR
|
||||
JOIN @Children NN on TR.FromID = NN.NewContentID
|
||||
JOIN Transitions TRO on TR.TranType = TRO.TransitionID
|
||||
WHERE .dbo.vefn_CompareTranFormat(NN.FormatID, NN.NewFormatID, TRO.TranType) <> 0
|
||||
--print 'H4 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
UPDATE TR SET TR.[TranType] = .dbo.vefn_GetNewTranType(NN.FormatID, NN.NewFormatID, TRO.TranType)
|
||||
FROM Transitions TR
|
||||
JOIN @Children NN on TR.FromID = NN.NewContentID
|
||||
JOIN Transitions TRO on TR.TranType = TRO.TransitionID
|
||||
--print 'H5 ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
-- Transitions are done
|
||||
-- SELECT * From Transitions where DTS = @DTS and UserID = @UserID
|
||||
--print 'Z ' + cast(datediff(s,@dts,getdate()) as varchar(100))
|
||||
--foldouts fixing code
|
||||
if exists (select * from contents where contentid in (select newcontentid from @children) and config like '%FloatingFoldout%')
|
||||
begin
|
||||
--insert into #mytemp
|
||||
select cc.contentid,xsteps.value('@FloatingFoldout','int') oldfoldoutid,(select newitemid
|
||||
from @children
|
||||
where itemid = xsteps.value('@FloatingFoldout','int')) newfoldoutid,xconfig
|
||||
into #mytemp
|
||||
from (select *,cast(config as xml) xconfig from contents where contentid in (select newcontentid from @children)) cc
|
||||
cross apply xconfig.nodes('Config/Step') tsteps(xsteps)
|
||||
--build @cmd string
|
||||
declare @cmd nvarchar(max)
|
||||
declare cmds cursor for
|
||||
select distinct 'update #mytemp set xconfig.modify(''replace value of (Config/Step/@FloatingFoldout)[1] with "'
|
||||
+ cast(newfoldoutid as varchar(10))
|
||||
+ '"'') where xconfig.value(''(Config/Step/@FloatingFoldout)[1]'',''int'') = '
|
||||
+ cast(oldfoldoutid as varchar(10))
|
||||
from #mytemp
|
||||
--execute cursor over rows
|
||||
open cmds
|
||||
fetch next from cmds into @cmd
|
||||
while @@fetch_status = 0
|
||||
begin
|
||||
exec sp_executesql @cmd
|
||||
fetch next from cmds into @cmd
|
||||
end
|
||||
close cmds
|
||||
deallocate cmds
|
||||
--actually update contents
|
||||
update cc set config = cast(xconfig as varchar(max)) from contents cc join #mytemp mt on cc.contentid = mt.contentid
|
||||
--get rid of #mytemp
|
||||
drop table #mytemp
|
||||
end
|
||||
--end foldouts fixing code
|
||||
--section start
|
||||
DECLARE @NewContentID int
|
||||
Select @NewContentID = NewContentID from @Children where ItemID = @StartItemID
|
||||
DECLARE @Config varchar(max)
|
||||
DECLARE @XConfig xml
|
||||
select @Config = config from contents where contentid = @NewContentID
|
||||
select @XConfig = cast(@Config as xml)
|
||||
if @Config like '%SectionStart%' begin
|
||||
DECLARE @SectionStart int
|
||||
select @SectionStart = xproc.value('@SectionStart','int') from @xconfig.nodes('Config/Procedure') tproc(xproc)
|
||||
DECLARE @NewSectionStart int
|
||||
select @NewSectionStart = newitemid from @children where itemid = @SectionStart
|
||||
DECLARE @cmd2 nvarchar(max)
|
||||
set @cmd2 = '
|
||||
declare @XConfig xml;
|
||||
set @XConfig = cast(''' + @Config + ''' as xml);
|
||||
set @XConfig.modify(''replace value of (Config/Procedure/@SectionStart)[1] with "' + cast(@NewSectionStart as nvarchar(10)) + '"'');
|
||||
update contents set config = cast(@XConfig as varchar(max)) where contentid = ' + cast(@NewContentID as nvarchar(10)) + ';'
|
||||
exec sp_executesql @cmd2
|
||||
end
|
||||
--end section start
|
||||
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
|
||||
|
||||
IF (@@Error = 0) PRINT 'Procedure Creation: [CopyItemAndChildren] Succeeded'
|
||||
ELSE PRINT 'Procedure Creation: [CopyItemAndChildren] Error on Creation'
|
||||
GO
|
||||
|
||||
/*
|
||||
==========================================================================================================
|
||||
End: C2024-004: KL - Update Copy Replace functionality, (remove ''copy of'')
|
||||
==========================================================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
==========================================================================================================
|
||||
Begin: C2024-005: PRL - SPs to support Admin tool to clean Annotations
|
||||
==========================================================================================================
|
||||
*/
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[deleteAnnotationsDocvByType] Script Date: 7/11/2024 2:39:59 PM ******/
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'deleteAnnotationsDocvByType')
|
||||
DROP PROCEDURE [dbo].[deleteAnnotationsDocvByType]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[deleteAnnotationsDocvByType] Script Date: 7/11/2024 2:39:59 PM ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
/*****************************************************************************
|
||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
Copyright 2024 - Volian Enterprises, Inc. All rights reserved.
|
||||
*****************************************************************************/
|
||||
/*
|
||||
==========================================================================================================
|
||||
Author: Paul Larsen
|
||||
Modified Date: 07/11/2024
|
||||
Description: Delete Annotations in DocVersions by Annotation Type
|
||||
==========================================================================================================
|
||||
*/
|
||||
|
||||
CREATE procedure [dbo].[deleteAnnotationsDocvByType]
|
||||
(
|
||||
@docvList varchar(MAX),
|
||||
@typeid int
|
||||
)
|
||||
AS
|
||||
|
||||
DECLARE @docvs TABLE
|
||||
(
|
||||
RowID INT NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
||||
DocvVersionID int
|
||||
)
|
||||
|
||||
DECLARE @Annotationitems table
|
||||
(
|
||||
RowID int NOT NULL IDENTITY(1,1),
|
||||
AllItemIDs int
|
||||
)
|
||||
|
||||
INSERT INTO @docvs (DocvVersionID) (select id from vefn_SplitInt(@docvList, ','))
|
||||
|
||||
DECLARE @cnt int = 0
|
||||
DECLARE @cnt2 int
|
||||
DECLARE @itemid int
|
||||
DECLARE @i INT
|
||||
SET @i = (SELECT MIN(RowID) FROM @docvs);
|
||||
DECLARE @max INT;
|
||||
SET @max = (SELECT MAX(RowID) FROM @docvs);
|
||||
|
||||
-- add all itemids relateted to requested Annotation cleaning.
|
||||
while (@i <= @max)
|
||||
BEGIN
|
||||
SELECT @itemid = DocvVersionID from @docvs where RowID = @i
|
||||
INSERT INTO @Annotationitems (AllItemIDs)
|
||||
(SELECT cir.itemid FROM [vefn_GetVersionItems](@docvList) cir JOIN Annotations an on an.itemid = cir.itemid where an.typeid = @typeid)
|
||||
--vefn_ChildItemsRange(@itemid,@itemid,null) cir JOIN Annotations an on an.itemid = cir.itemid where an.typeid = @typeid)
|
||||
SET @i = @i + 1;
|
||||
END
|
||||
|
||||
SELECT @i = MIN(RowID) FROM @docvs;
|
||||
SELECT @max = MAX(RowID) FROM @docvs;
|
||||
|
||||
-- Delete Annotations
|
||||
DELETE FROM Ann
|
||||
FROM tblAnnotations Ann INNER JOIN @Annotationitems AI ON Ann.itemid = AI.AllItemIDs WHERE TypeID = @typeid
|
||||
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'deleteAnnotationsProcByType')
|
||||
DROP PROCEDURE [dbo].[deleteAnnotationsProcByType]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[deleteAnnotationsProcByType] Script Date: 7/11/2024 2:46:05 PM ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
/*****************************************************************************
|
||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
Copyright 2024 - Volian Enterprises, Inc. All rights reserved.
|
||||
*****************************************************************************/
|
||||
/*
|
||||
==========================================================================================================
|
||||
Author: Paul Larsen
|
||||
Modified Date: 07/11/2024
|
||||
Description: Delete Annotations in Procedures by Annotation Type
|
||||
==========================================================================================================
|
||||
*/
|
||||
|
||||
CREATE procedure [dbo].[deleteAnnotationsProcByType]
|
||||
(
|
||||
@procList varchar(MAX),
|
||||
@typeid int
|
||||
)
|
||||
AS
|
||||
|
||||
DECLARE @procs TABLE
|
||||
(
|
||||
RowID INT NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
||||
ProcItemIDs int
|
||||
)
|
||||
|
||||
DECLARE @Annotationitems table
|
||||
(
|
||||
RowID int NOT NULL IDENTITY(1,1),
|
||||
AllItemIDs int
|
||||
)
|
||||
|
||||
DECLARE @cnt int = 0
|
||||
DECLARE @cnt2 int
|
||||
DECLARE @itemid int
|
||||
|
||||
INSERT INTO @procs (ProcItemIDs) (select id from vefn_SplitInt(@procList, ','))
|
||||
|
||||
DECLARE @i INT
|
||||
SET @i = (SELECT MIN(RowID) FROM @procs);
|
||||
DECLARE @max INT;
|
||||
SET @max = (SELECT MAX(RowID) FROM @procs);
|
||||
|
||||
-- add all itemids relateted to requested Annotation cleaning.
|
||||
while (@i <= @max)
|
||||
BEGIN
|
||||
SELECT @itemid = ProcItemIDs from @procs where RowID = @i
|
||||
INSERT INTO @Annotationitems (AllItemIDs)
|
||||
(SELECT cir.itemid FROM vefn_ChildItemsRange(@itemid,@itemid,null) cir JOIN Annotations an on an.itemid = cir.itemid where an.typeid = @typeid)
|
||||
SET @i = @i + 1;
|
||||
END
|
||||
|
||||
SELECT @i = MIN(RowID) FROM @procs;
|
||||
SELECT @max = MAX(RowID) FROM @procs;
|
||||
|
||||
-- Delete Annotations
|
||||
DELETE FROM Ann
|
||||
FROM tblAnnotations Ann INNER JOIN @Annotationitems AI ON Ann.itemid = AI.AllItemIDs WHERE TypeID = @typeid
|
||||
GO
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'getAnnotationDocvCount')
|
||||
DROP PROCEDURE [dbo].[getAnnotationDocvCount]
|
||||
GO
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[getAnnotationDocvCount] Script Date: 7/11/2024 2:48:35 PM ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
/*****************************************************************************
|
||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
Copyright 2024 - Volian Enterprises, Inc. All rights reserved.
|
||||
*****************************************************************************/
|
||||
/*
|
||||
==========================================================================================================
|
||||
Author: Paul Larsen
|
||||
Modified Date: 07/11/2024
|
||||
Description: Retrieve the number of Annotations that will be deleted (DocVersions)
|
||||
==========================================================================================================
|
||||
*/
|
||||
|
||||
CREATE procedure [dbo].[getAnnotationDocvCount]
|
||||
(
|
||||
@docvList varchar(MAX),
|
||||
@typeid int
|
||||
)
|
||||
AS
|
||||
|
||||
DECLARE @docvs TABLE
|
||||
(
|
||||
RowID INT NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
||||
itemid int
|
||||
)
|
||||
|
||||
--INSERT INTO @procs from STRING_SPLIT(@procList, ',')
|
||||
|
||||
INSERT INTO @docvs (itemid) (select id from vefn_SplitInt(@docvList, ','))
|
||||
|
||||
DECLARE @cnt int = 0
|
||||
|
||||
SELECT @cnt = count(cir.itemid) FROM [vefn_GetVersionItems](@docvList) cir JOIN Annotations an on an.itemid = cir.itemid where an.typeid = @typeid
|
||||
|
||||
SELECT @cnt AS 'COUNT'
|
||||
|
||||
GO
|
||||
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[getAnnotationProcCount] Script Date: 7/11/2024 3:02:05 PM ******/
|
||||
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'getAnnotationProcCount')
|
||||
DROP PROCEDURE [dbo].[getAnnotationProcCount]
|
||||
GO
|
||||
|
||||
|
||||
/****** Object: StoredProcedure [dbo].[getAnnotationProcCount] Script Date: 7/11/2024 3:02:05 PM ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
|
||||
/*****************************************************************************
|
||||
Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||
Copyright 2024 - Volian Enterprises, Inc. All rights reserved.
|
||||
*****************************************************************************/
|
||||
/*
|
||||
==========================================================================================================
|
||||
Author: Paul Larsen
|
||||
Modified Date: 07/11/2024
|
||||
Description: Retrieve the number of Annotations that will be deleted (Procedures)
|
||||
==========================================================================================================
|
||||
*/
|
||||
|
||||
CREATE procedure [dbo].[getAnnotationProcCount]
|
||||
(
|
||||
@procList varchar(MAX),
|
||||
@typeid int
|
||||
)
|
||||
AS
|
||||
|
||||
DECLARE @procs TABLE
|
||||
(
|
||||
RowID INT NOT NULL IDENTITY(1, 1) PRIMARY KEY,
|
||||
itemid int
|
||||
)
|
||||
|
||||
INSERT INTO @procs (itemid) (select id from vefn_SplitInt(@procList, ','))
|
||||
|
||||
DECLARE @cnt int = 0
|
||||
DECLARE @cnt2 int
|
||||
DECLARE @itemid int
|
||||
DECLARE @i INT
|
||||
SELECT @i = MIN(RowID) FROM @procs;
|
||||
DECLARE @max INT;
|
||||
SELECT @max = MAX(RowID) FROM @procs;
|
||||
|
||||
while (@i <= @max)
|
||||
BEGIN
|
||||
SELECT @itemid = itemid from @procs where RowID = @i
|
||||
SELECT @cnt = @cnt + (SELECT count(cir.itemid) FROM vefn_ChildItemsRange(@itemid,@itemid,null) cir JOIN Annotations an on an.itemid = cir.itemid where an.typeid = @typeid)
|
||||
SET @i = @i + 1;
|
||||
END
|
||||
|
||||
SELECT @cnt AS 'count'
|
||||
|
||||
GO
|
||||
|
||||
|
||||
/*
|
||||
==========================================================================================================
|
||||
End: C2024-005: PRL - SPs to support Admin tool to clean Annotations
|
||||
==========================================================================================================
|
||||
*/
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
/*
|
||||
---------------------------------------------------------------------------
|
||||
| ADD New Code Before this Block |
|
||||
@@ -22673,8 +23552,8 @@ BEGIN TRY -- Try Block
|
||||
DECLARE @RevDate varchar(255)
|
||||
DECLARE @RevDescription varchar(255)
|
||||
|
||||
set @RevDate = '07/09/2024 9:00 AM'
|
||||
set @RevDescription = 'C2024-004: Update Copy Replace functionality'
|
||||
set @RevDate = '07/18/2024 11:24'
|
||||
set @RevDescription = 'C2024-005 Add an Admin tool that can delete a group of annotations.'
|
||||
|
||||
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
|
||||
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
|
||||
@@ -22692,6 +23571,3 @@ ELSE PRINT 'StoredProcedure [vesp_GetSQLCodeRevision] Error on Creation'
|
||||
go
|
||||
|
||||
Exec vesp_GetSQLCodeRevision;
|
||||
|
||||
|
||||
|
||||
|
@@ -99,7 +99,10 @@
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="C1.Win.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=944ae1ea0e47ca04" />
|
||||
<Reference Include="C1.Win.C1Command.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=e808566f358766d8" />
|
||||
<Reference Include="C1.Win.C1FlexGrid.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=79882d576c6336da, processorArchitecture=MSIL" />
|
||||
<Reference Include="C1.Win.C1Input.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=7e7ff60f0c214f9a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Csla">
|
||||
<HintPath>..\..\..\..\3rdPartyLibraries\CSLA\Csla.dll</HintPath>
|
||||
</Reference>
|
||||
@@ -220,6 +223,12 @@
|
||||
<Compile Include="dlgUCFDetail.Designer.cs">
|
||||
<DependentUpon>dlgUCFDetail.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmAnnotationsCleanup.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmAnnotationsCleanup.Designer.cs">
|
||||
<DependentUpon>frmAnnotationsCleanup.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="frmBatchRefresh.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -331,6 +340,9 @@
|
||||
<EmbeddedResource Include="dlgUCFDetail.resx">
|
||||
<DependentUpon>dlgUCFDetail.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmAnnotationsCleanup.resx">
|
||||
<DependentUpon>frmAnnotationsCleanup.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="frmPDFStatusForm.resx">
|
||||
<DependentUpon>frmPDFStatusForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -614,4 +626,4 @@
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>cmd /c "$(ProjectDir)FixRev.bat"</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
132
PROMS/VEPROMS User Interface/frmAnnotationsCleanup.Designer.cs
generated
Normal file
132
PROMS/VEPROMS User Interface/frmAnnotationsCleanup.Designer.cs
generated
Normal file
@@ -0,0 +1,132 @@
|
||||
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Base.Library;
|
||||
namespace VEPROMS
|
||||
{
|
||||
partial class frmAnnotationsCleanup
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.lbAnnotationTypes = new System.Windows.Forms.ListBox();
|
||||
this.itemAnnotationsBindingSource = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.lblAnnotationsList = new System.Windows.Forms.Label();
|
||||
this.btnClean = new System.Windows.Forms.Button();
|
||||
this.lblCountNumber = new System.Windows.Forms.Label();
|
||||
this.lblCount = new System.Windows.Forms.Label();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.itemAnnotationsBindingSource)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lbAnnotationTypes
|
||||
//
|
||||
this.lbAnnotationTypes.DataSource = this.itemAnnotationsBindingSource;
|
||||
this.lbAnnotationTypes.FormattingEnabled = true;
|
||||
this.lbAnnotationTypes.Location = new System.Drawing.Point(25, 48);
|
||||
this.lbAnnotationTypes.Name = "lbAnnotationTypes";
|
||||
this.lbAnnotationTypes.Size = new System.Drawing.Size(295, 433);
|
||||
this.lbAnnotationTypes.TabIndex = 0;
|
||||
//
|
||||
// lblAnnotationsList
|
||||
//
|
||||
this.lblAnnotationsList.AutoSize = true;
|
||||
this.lblAnnotationsList.Location = new System.Drawing.Point(26, 21);
|
||||
this.lblAnnotationsList.Name = "lblAnnotationsList";
|
||||
this.lblAnnotationsList.Size = new System.Drawing.Size(175, 13);
|
||||
this.lblAnnotationsList.TabIndex = 1;
|
||||
this.lblAnnotationsList.Text = "Select an Annotation Type to Clean";
|
||||
//
|
||||
// btnClean
|
||||
//
|
||||
this.btnClean.Location = new System.Drawing.Point(365, 164);
|
||||
this.btnClean.Name = "btnClean";
|
||||
this.btnClean.Size = new System.Drawing.Size(131, 36);
|
||||
this.btnClean.TabIndex = 2;
|
||||
this.btnClean.Text = "Proceed?";
|
||||
this.btnClean.UseVisualStyleBackColor = true;
|
||||
this.btnClean.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// lblCountNumber
|
||||
//
|
||||
this.lblCountNumber.AutoSize = true;
|
||||
this.lblCountNumber.Location = new System.Drawing.Point(395, 100);
|
||||
this.lblCountNumber.Name = "lblCountNumber";
|
||||
this.lblCountNumber.Size = new System.Drawing.Size(69, 13);
|
||||
this.lblCountNumber.TabIndex = 3;
|
||||
this.lblCountNumber.Text = "Delete Count";
|
||||
this.lblCountNumber.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// lblCount
|
||||
//
|
||||
this.lblCount.AutoSize = true;
|
||||
this.lblCount.Location = new System.Drawing.Point(331, 70);
|
||||
this.lblCount.Name = "lblCount";
|
||||
this.lblCount.Size = new System.Drawing.Size(206, 13);
|
||||
this.lblCount.TabIndex = 4;
|
||||
this.lblCount.Text = "Number of Annotations that will be deleted";
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
this.btnClose.Location = new System.Drawing.Point(397, 457);
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnClose.TabIndex = 5;
|
||||
this.btnClose.Text = "Close";
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
//
|
||||
// frmAnnotationsCleanup
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(549, 535);
|
||||
this.Controls.Add(this.btnClose);
|
||||
this.Controls.Add(this.lblCount);
|
||||
this.Controls.Add(this.lblCountNumber);
|
||||
this.Controls.Add(this.btnClean);
|
||||
this.Controls.Add(this.lblAnnotationsList);
|
||||
this.Controls.Add(this.lbAnnotationTypes);
|
||||
this.Name = "frmAnnotationsCleanup";
|
||||
this.Text = "Clean Annotations";
|
||||
((System.ComponentModel.ISupportInitialize)(this.itemAnnotationsBindingSource)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ListBox lbAnnotationTypes;
|
||||
private System.Windows.Forms.Label lblAnnotationsList;
|
||||
private System.Windows.Forms.BindingSource itemAnnotationsBindingSource;
|
||||
private System.Windows.Forms.Button btnClean;
|
||||
private System.Windows.Forms.Label lblCountNumber;
|
||||
private System.Windows.Forms.Label lblCount;
|
||||
private System.Windows.Forms.Button btnClose;
|
||||
}
|
||||
}
|
||||
|
158
PROMS/VEPROMS User Interface/frmAnnotationsCleanup.cs
Normal file
158
PROMS/VEPROMS User Interface/frmAnnotationsCleanup.cs
Normal file
@@ -0,0 +1,158 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using VEPROMS.CSLA.Library;
|
||||
using Volian.Base.Library;
|
||||
//using Volian.Pipe.Library;
|
||||
using System.Xml;
|
||||
using System.Diagnostics;
|
||||
using JR.Utils.GUI.Forms;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
public partial class frmAnnotationsCleanup : Form
|
||||
{
|
||||
Label mylab = new Label();
|
||||
string procList = "";
|
||||
string docvList = "";
|
||||
int AnnotationTyp;
|
||||
List<ProcedureInfo> pil2 = new List<ProcedureInfo>();
|
||||
List<DocVersionInfo> dvil2 = new List<DocVersionInfo>();
|
||||
private frmBatchRefresh mainForm = null;
|
||||
// frmAnnotationsCleanup constructor passes users procedure and docversion selections from frmBatchRefresh
|
||||
public frmAnnotationsCleanup(Form callingForm, List<ProcedureInfo> pil, List<DocVersionInfo> dvil)
|
||||
|
||||
{ // Set up link back to parent form.
|
||||
mainForm = callingForm as frmBatchRefresh;
|
||||
InitializeComponent();
|
||||
|
||||
pil2 = pil;
|
||||
dvil2 = dvil;
|
||||
|
||||
// Get list of annotation types for plant.
|
||||
myAnnotationTypeInfoList = AnnotationTypeInfoList.Get();
|
||||
lbAnnotationTypes.DataSource = myLocalAnnotationTypeInfoList = new LocalAnnotationTypeInfoList(myAnnotationTypeInfoList);
|
||||
|
||||
Dictionary<string, string> AnnotationsList = new Dictionary<string, string>();
|
||||
|
||||
// Add name and type ID to form.
|
||||
foreach (LocalAnnotationTypeInfo lati in myLocalAnnotationTypeInfoList)
|
||||
{
|
||||
AnnotationsList.Add(lati.TypeID.ToString(), lati.Name);
|
||||
//cbAnnotationTypes.Items.Add(new { Name = lati.Name, Value = lati.TypeID });
|
||||
}
|
||||
|
||||
lbAnnotationTypes.DataSource = new BindingSource(AnnotationsList, null);
|
||||
lbAnnotationTypes.DisplayMember = "Value";
|
||||
lbAnnotationTypes.ValueMember = "Key";
|
||||
lbAnnotationTypes.SelectedIndexChanged += lbAnnotationTypes_SelectedIndexChanged;
|
||||
|
||||
}
|
||||
// create comma delimited string of procedures selected by user.
|
||||
private string getAnnotationProcItems(List<ProcedureInfo> pil2)
|
||||
{
|
||||
procList = "";
|
||||
foreach (var p in pil2)
|
||||
{
|
||||
if (p.IsProcedure)
|
||||
{
|
||||
if (procList == "")
|
||||
{
|
||||
procList = procList + p.ItemID.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
procList = procList + "," + p.ItemID.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return procList;
|
||||
}
|
||||
|
||||
// create comma delimited string of doc versions selected by user.
|
||||
private string getAnnotationDocvItems(List<DocVersionInfo> dvil2)
|
||||
{
|
||||
docvList = "";
|
||||
foreach (var d in dvil2)
|
||||
{
|
||||
if (d.IsDocVersion)
|
||||
{
|
||||
if (docvList == "")
|
||||
{
|
||||
docvList = docvList + d.VersionID.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
docvList = docvList + "," + d.VersionID.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return docvList;
|
||||
}
|
||||
|
||||
private AnnotationTypeInfoList myAnnotationTypeInfoList = null;
|
||||
private LocalAnnotationTypeInfoList myLocalAnnotationTypeInfoList = null;
|
||||
|
||||
// Process used to cleanup annotations "(Proceed?" button)
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (var p in pil2)
|
||||
{
|
||||
if (p.IsProcedure)
|
||||
{
|
||||
TextBox frm2 = mainForm.GettxtProcess();
|
||||
frm2.AppendText(p.DisplayNumber + ' ' + p.DisplayText);
|
||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||
Annotation.DeleteAnnotationProcByType(AnnotationTyp, p.ItemID.ToString());
|
||||
lblCountNumber.Text = "0";
|
||||
}
|
||||
|
||||
}
|
||||
foreach (var d in dvil2)
|
||||
{
|
||||
if (d.IsDocVersion)
|
||||
{
|
||||
TextBox frm2 = mainForm.GettxtProcess();
|
||||
frm2.AppendText(d.ActiveParent.ToString());
|
||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||
Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString());
|
||||
lblCountNumber.Text = "0";
|
||||
}
|
||||
}
|
||||
}
|
||||
// Retrieve number of annotations that will be deleted.
|
||||
private void lbAnnotationTypes_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
btnClean.Enabled = false;
|
||||
lblCountNumber.Text = "";
|
||||
int deletecountProc = 0;
|
||||
int deletecountDocv = 0;
|
||||
if (pil2.Count > 0)
|
||||
{
|
||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||
deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, getAnnotationProcItems(pil2));
|
||||
}
|
||||
|
||||
if (dvil2.Count > 0)
|
||||
{
|
||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||
deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, getAnnotationDocvItems(dvil2));
|
||||
}
|
||||
lblCountNumber.Text = (deletecountProc + deletecountDocv).ToString();
|
||||
btnClean.Enabled = true;
|
||||
|
||||
}
|
||||
// Close form.
|
||||
private void btnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
123
PROMS/VEPROMS User Interface/frmAnnotationsCleanup.resx
Normal file
123
PROMS/VEPROMS User Interface/frmAnnotationsCleanup.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="itemAnnotationsBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
985
PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs
generated
985
PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -22,12 +22,25 @@ namespace VEPROMS
|
||||
set { _MySessionInfo = value; }
|
||||
}
|
||||
private bool IsAdministratorUser = false; //C2020-035 used to control what Set Amins can do
|
||||
// C2017-030 - new Admin Tools user interface
|
||||
// pass in session info to constructor
|
||||
// C2017-030 - new Admin Tools user interface
|
||||
// pass in session info to constructor
|
||||
public frmBatchRefresh(SessionInfo sessionInfo)
|
||||
{
|
||||
InitializeComponent();
|
||||
_MySessionInfo = sessionInfo;
|
||||
|
||||
// When opening Admin tools Check tab will be default.
|
||||
this.sideNavItmCheck.Checked = true;
|
||||
|
||||
if (sideNavItmDelete.Checked)
|
||||
{
|
||||
AdminToolType = (E_AdminToolType)4;
|
||||
if (swDeleteFolder.Value)
|
||||
ResetDelTV(true);
|
||||
else
|
||||
ResetDelTV(false);
|
||||
}
|
||||
|
||||
setupProgessSteps1(); // C2017-030 - new Admin Tools user interface
|
||||
UserInfo ui = UserInfo.GetByUserID(MySessionInfo.UserID);
|
||||
IsAdministratorUser = ui.IsAdministrator();
|
||||
@@ -43,18 +56,25 @@ namespace VEPROMS
|
||||
swStandardHypenChars.Enabled = false;
|
||||
}
|
||||
}
|
||||
// Make txtProcess text box available to frmAnnotationsClean form.
|
||||
internal TextBox GettxtProcess()
|
||||
{
|
||||
return txtProcess;
|
||||
}
|
||||
// NOTE: removed the Refresh ROs and Refresh Transitions and ROs options (now only Transitions can be refreshed)
|
||||
// the Update ROs and Refresh ROs logic was merged together. The Update ROs will functionally do both
|
||||
// also annotations will be placed on step elements that have RO changes
|
||||
|
||||
// make all of the hyphen character consistant so they can all be found with the Search function
|
||||
|
||||
|
||||
private void FixHyphens()
|
||||
{
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Standardizing Hyphens");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
int affectedRows = ESP_FixHyphens.Execute("vesp_FixHyphens") / 2;// Two results for each change
|
||||
@@ -65,7 +85,7 @@ namespace VEPROMS
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
@@ -125,6 +145,60 @@ namespace VEPROMS
|
||||
myTV.SelectedNode.Expand();
|
||||
this.Cursor = Cursors.Default;
|
||||
}
|
||||
private void ResetDelTV()
|
||||
{
|
||||
ResetDelTV(false);
|
||||
}
|
||||
private void ResetDelTV(bool noProcs)
|
||||
{
|
||||
btnFixLinks.Enabled = false;
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
myTVdel.Nodes.Clear();
|
||||
myDocVersions.Clear();
|
||||
FolderInfo fi = FolderInfo.GetTop();
|
||||
|
||||
if (fi.ChildFolderCount > 0)
|
||||
{
|
||||
if (noProcs)
|
||||
{
|
||||
LoadBottomLevelFolders(fi, myTVdel);
|
||||
}
|
||||
else
|
||||
{
|
||||
TreeNode tn = new TreeNode(fi.Name);
|
||||
tn.Tag = fi;
|
||||
tn.StateImageIndex = -1; // Hide the checkbox for the root node
|
||||
LoadChildFolders(fi, tn, noProcs);
|
||||
myTVdel.Nodes.Add(tn);
|
||||
}
|
||||
}
|
||||
|
||||
if (myTVdel.SelectedNode != null)
|
||||
myTVdel.SelectedNode.Expand();
|
||||
this.Cursor = Cursors.Default;
|
||||
|
||||
//btnFixLinks.Enabled = false;
|
||||
//this.Cursor = Cursors.WaitCursor;
|
||||
////myTreeNodePath = new List<string>();
|
||||
//myTVdel.Nodes.Clear();
|
||||
//myDocVersions.Clear();
|
||||
//FolderInfo fi = FolderInfo.GetTop();
|
||||
//TreeNode tn = myTVdel.Nodes.Add(fi.Name );
|
||||
//tn.Tag = fi;
|
||||
//if (fi.ChildFolderCount > 0)
|
||||
//{
|
||||
// if (noProcs)
|
||||
// {
|
||||
// LoadBottomLevelFolders(fi, myTVdel);
|
||||
// }
|
||||
// else
|
||||
// LoadChildFolders(fi, tn, noProcs);
|
||||
//}
|
||||
//if (myTVdel.SelectedNode != null)
|
||||
// myTVdel.SelectedNode.Expand();
|
||||
//this.Cursor = Cursors.Default;
|
||||
}
|
||||
|
||||
// B2021-060 Higher level folders where being removed from the tree even if there was a child folder that containe a working draft set
|
||||
private bool LoadChildFolders(FolderInfo fi, TreeNode tn, bool noProcs)
|
||||
{
|
||||
@@ -135,8 +209,8 @@ namespace VEPROMS
|
||||
TreeNode tnc = tn.Nodes.Add(fic.Name);
|
||||
tnc.Tag = fic;
|
||||
if (fic.ChildFolderCount > 0)
|
||||
if(LoadChildFolders(fic, tnc, noProcs))
|
||||
loadedChildWorkingDraft=true;
|
||||
if (LoadChildFolders(fic, tnc, noProcs))
|
||||
loadedChildWorkingDraft = true;
|
||||
// B2020-114 and C2020-035 only show folders the Set Admin can access
|
||||
if (fic.FolderDocVersionCount > 0)
|
||||
{
|
||||
@@ -151,6 +225,34 @@ namespace VEPROMS
|
||||
tn.Remove();
|
||||
return loadedWorkingDraft;
|
||||
}
|
||||
/// <summary>
|
||||
/// Load only bottom layer of folders into treenode.
|
||||
/// </summary>
|
||||
/// <param name="fi"></param>
|
||||
/// <param name="tn"></param>
|
||||
private void LoadBottomLevelFolders(FolderInfo fi, TreeView treeView)
|
||||
{
|
||||
foreach (FolderInfo fic in fi.SortedChildFolders)
|
||||
{
|
||||
if (fic.ChildFolderCount > 0)
|
||||
{
|
||||
// Recursively call for child folders
|
||||
LoadBottomLevelFolders(fic, treeView);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fic.Name != "PROMS")
|
||||
{
|
||||
|
||||
|
||||
|
||||
// If the folder is a bottom-level folder (no child folders), add it directly to the TreeView
|
||||
TreeNode tnc = treeView.Nodes.Add(fic.Name);
|
||||
tnc.Tag = fic;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private bool LoadDocVersions(FolderInfo fic, TreeNode tnc, bool noProcs)
|
||||
{
|
||||
bool rtnval = false;
|
||||
@@ -201,7 +303,7 @@ namespace VEPROMS
|
||||
private void UpdateROValues()
|
||||
{
|
||||
this.Cursor = Cursors.WaitCursor;
|
||||
List<ProcedureInfo> pil = new List<ProcedureInfo>(); // C2023-002: list of checked out procedures, used in frmBatchRefreshCheckedOut dialog
|
||||
List<ProcedureInfo> pil = new List<ProcedureInfo>(); // C2023-002: list of checked out procedures, used in frmBatchRefreshCheckedOut dialog
|
||||
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
|
||||
foreach (TreeNode tn in myDocVersions.Keys)
|
||||
if (tn.Checked)
|
||||
@@ -251,7 +353,7 @@ namespace VEPROMS
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Application.DoEvents();
|
||||
// when processing more than one procedure set, display only one completed message after all are processed
|
||||
if (ROFstInfo.MessageList != null)
|
||||
@@ -273,7 +375,7 @@ namespace VEPROMS
|
||||
sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?");
|
||||
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(1);
|
||||
frmCO.MySessionInfo = MySessionInfo;
|
||||
frmCO.CheckedOutProcedures = pil; // C2023-002: set list of checked out procedures
|
||||
frmCO.CheckedOutProcedures = pil; // C2023-002: set list of checked out procedures
|
||||
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
|
||||
// C2023-002: Allow close of dialog that has list of procedures that are checked out
|
||||
if (frmCO.ShowDialog(this) != DialogResult.Cancel)
|
||||
@@ -412,7 +514,7 @@ namespace VEPROMS
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Refresh Transitions");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtResults.AppendText("Refresh Transitions");
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
@@ -449,19 +551,19 @@ namespace VEPROMS
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
if (numTransFixed == 0 && numTransConverted ==0)
|
||||
if (numTransFixed == 0 && numTransConverted == 0)
|
||||
{
|
||||
txtResults.AppendText("No Transitions Needed Updated.");
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
}
|
||||
ContentInfo.StaticContentInfoChange -= new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange);
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Transitions Checked: {0}",numTransProcessed));
|
||||
txtProcess.AppendText(string.Format("Transitions Checked: {0}", numTransProcessed));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
// B2018-002 - Invalid Transitions - Display Transition Refresh Statistics
|
||||
txtProcess.AppendText(string.Format("Transitions Correct As Is: {0}",numTransProcessed - (numTransConverted + numTransFixed)));
|
||||
txtProcess.AppendText(string.Format("Transitions Correct As Is: {0}", numTransProcessed - (numTransConverted + numTransFixed)));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Transitions Modified: {0}", numTransFixed));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
@@ -490,10 +592,10 @@ namespace VEPROMS
|
||||
}
|
||||
this.Cursor = Cursors.Default;
|
||||
// B2018-002 - Invalid Transitions - Display Transition Refresh Statisitic
|
||||
if (numTransFixed == 0 && numTransConverted ==0)
|
||||
MessageBox.Show(string.Format("{0} Transitions Checked.\n\nNo Transitions Modified.",numTransProcessed), "Refresh Transitions Completed");
|
||||
if (numTransFixed == 0 && numTransConverted == 0)
|
||||
MessageBox.Show(string.Format("{0} Transitions Checked.\n\nNo Transitions Modified.", numTransProcessed), "Refresh Transitions Completed");
|
||||
else
|
||||
MessageBox.Show(string.Format("{0} Transitions Checked.\n\n {1} Correct as is.\n\n {2} Transitions modified.\n\n {3} Transitions converted to text.", numTransProcessed, numTransProcessed - (numTransFixed + numTransConverted),numTransFixed, numTransConverted), "Refresh Transitions Completed");
|
||||
MessageBox.Show(string.Format("{0} Transitions Checked.\n\n {1} Correct as is.\n\n {2} Transitions modified.\n\n {3} Transitions converted to text.", numTransProcessed, numTransProcessed - (numTransFixed + numTransConverted), numTransFixed, numTransConverted), "Refresh Transitions Completed");
|
||||
}
|
||||
|
||||
// C2017-030 - new Admin Tools user interface
|
||||
@@ -506,7 +608,7 @@ namespace VEPROMS
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Refreshing Word Attachments");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
int affectedRows = ESP_DeletePDFs.Execute("vesp_DeletePDFs");
|
||||
@@ -516,7 +618,7 @@ namespace VEPROMS
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
@@ -561,7 +663,7 @@ namespace VEPROMS
|
||||
private int RefreshForSearch()
|
||||
{
|
||||
int cntfix = 0;
|
||||
List<int> gids = GridInfoList.GetIds(); // get all grids in database
|
||||
List<int> gids = GridInfoList.GetIds(); // get all grids in database
|
||||
pbProcess.Minimum = 0;
|
||||
pbProcess.Maximum = gids.Count;
|
||||
pbProcess.Step = 1;
|
||||
@@ -570,7 +672,7 @@ namespace VEPROMS
|
||||
using (Content cc = Content.Get(cid))
|
||||
{
|
||||
StepConfig sc = new StepConfig(cc.Config);
|
||||
if (!sc.Step_FixedTblForSrch) // if not processed through this code already, get searchable text & save
|
||||
if (!sc.Step_FixedTblForSrch) // if not processed through this code already, get searchable text & save
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -588,7 +690,7 @@ namespace VEPROMS
|
||||
cc.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
cc.DTS = DateTime.Now;
|
||||
cc.Text = srchtxt;
|
||||
|
||||
|
||||
}
|
||||
sc.Step_FixedTblForSrch = true;
|
||||
cc.Config = sc.ToString();
|
||||
@@ -615,7 +717,7 @@ namespace VEPROMS
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Identifing Orphan Items");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
int rowCount = ESP_IdentifyDisconnectedItems.Execute("vesp_GetDisconnectedItemsCount");
|
||||
@@ -636,7 +738,7 @@ namespace VEPROMS
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
}
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
@@ -652,7 +754,7 @@ namespace VEPROMS
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Purging Orphan Items");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
int rowCount = ESP_IdentifyDisconnectedItems.Execute("vesp_GetDisconnectedItemsCount");
|
||||
@@ -689,7 +791,7 @@ namespace VEPROMS
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
}
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
@@ -704,7 +806,7 @@ namespace VEPROMS
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Identifing Unused RoFsts and Figures");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
int rowCountRoFst = ESP_GetUnusedRoFsts.Execute("vesp_GetUnusedRoFstsCount");
|
||||
@@ -727,9 +829,9 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
this.Cursor = Cursors.Default;
|
||||
@@ -742,7 +844,7 @@ namespace VEPROMS
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Purging Unused RoFSTs and Figures Items");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
int rowCountRoFst = ESP_GetUnusedRoFsts.Execute("vesp_GetUnusedRoFstsCount");
|
||||
@@ -783,7 +885,7 @@ namespace VEPROMS
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
}
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
@@ -798,7 +900,7 @@ namespace VEPROMS
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Identifing Unused RO Associations");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
int rowCount = ESP_GetROAssoc.Execute("vesp_GetUnusedROAssociationsCount");
|
||||
@@ -817,7 +919,7 @@ namespace VEPROMS
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
}
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
@@ -832,7 +934,7 @@ namespace VEPROMS
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Purging Unused Referenced Object Associations");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
int rowCount = ESP_GetROAssoc.Execute("vesp_GetUnusedROAssociationsCount");
|
||||
@@ -866,7 +968,7 @@ namespace VEPROMS
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
}
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
@@ -881,11 +983,11 @@ namespace VEPROMS
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Identifing Hidden Item Locations");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
List<ItemInfo> myItems = ESP_IdentifyNonEditableItems.Execute("vesp_GetNonEditableItems");
|
||||
txtProcess.AppendText(string.Format("Hidden Items Count: {0}",myItems.Count));
|
||||
txtProcess.AppendText(string.Format("Hidden Items Count: {0}", myItems.Count));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
if (myItems.Count > 0)
|
||||
{
|
||||
@@ -906,7 +1008,7 @@ namespace VEPROMS
|
||||
txtResults.AppendText(Environment.NewLine);
|
||||
}
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
@@ -921,16 +1023,16 @@ namespace VEPROMS
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText("Show Users in PROMS");
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
Application.DoEvents();
|
||||
txtResults.Clear();
|
||||
txtResults.AppendText(ESP_GetDatabaseSessions.Execute("vesp_GetDatabaseSessions"));
|
||||
DateTime pEnd = DateTime.Now;
|
||||
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
|
||||
Application.DoEvents();
|
||||
this.Cursor = Cursors.Default;
|
||||
MessageBox.Show( "Show Users Completed", "Show Users");
|
||||
MessageBox.Show("Show Users Completed", "Show Users");
|
||||
}
|
||||
|
||||
private void ProcessUpdateROValues(DocVersionInfo dq)
|
||||
@@ -1068,7 +1170,7 @@ namespace VEPROMS
|
||||
// show the changes made in the Results pannel, include the ItemId of the step element
|
||||
void ContentInfo_StaticContentInfoChange(object sender, StaticContentInfoEventArgs args)
|
||||
{
|
||||
|
||||
|
||||
if (args.Type == "TX")
|
||||
{
|
||||
myFixesCount++;
|
||||
@@ -1085,7 +1187,7 @@ namespace VEPROMS
|
||||
}
|
||||
else // B2018-002 - Invalid Transitions - Display Transition Cconversion Statistics
|
||||
{
|
||||
myFixes.AppendLine(string.Format("Converted Transition to text for {0}({1})", (sender as ItemInfo).ShortPath, (sender as ItemInfo).ItemID));
|
||||
myFixes.AppendLine(string.Format("Converted Transition to text for {0}({1})", (sender as ItemInfo).ShortPath, (sender as ItemInfo).ItemID));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1121,10 +1223,40 @@ namespace VEPROMS
|
||||
CheckChildNodes(e.Node, e.Node.Checked);
|
||||
}
|
||||
}
|
||||
if (swDeleteAnnotations.Value)
|
||||
{
|
||||
if (e.Node.Checked)
|
||||
{
|
||||
DiselectParentNodes(e.Node.Parent);
|
||||
DiselectChildNodes(e.Node.Nodes);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
btnFixLinks.Enabled = AtLeastOneNodeChecked(); // C2017-030 support for Refresh Transitions/Update RO Values
|
||||
}
|
||||
|
||||
private void DiselectParentNodes(TreeNode parent)
|
||||
{
|
||||
while (parent != null)
|
||||
{
|
||||
if (parent.Checked)
|
||||
parent.Checked = false;
|
||||
parent = parent.Parent;
|
||||
}
|
||||
}
|
||||
|
||||
private void DiselectChildNodes(TreeNodeCollection childes)
|
||||
{
|
||||
foreach (TreeNode oneChild in childes)
|
||||
{
|
||||
if (oneChild.Checked)
|
||||
oneChild.Checked = false;
|
||||
DiselectChildNodes(oneChild.Nodes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void CheckChildNodes(TreeNode treeNode, bool ischecked)
|
||||
{
|
||||
foreach (TreeNode tn in treeNode.Nodes)
|
||||
@@ -1143,9 +1275,9 @@ namespace VEPROMS
|
||||
public ProgressBarItem ProgressBar
|
||||
{
|
||||
get { return _ProgressBar; }
|
||||
set
|
||||
{
|
||||
_ProgressBar = value;
|
||||
set
|
||||
{
|
||||
_ProgressBar = value;
|
||||
_ProgressBar.TextVisible = true;
|
||||
}
|
||||
}
|
||||
@@ -1246,6 +1378,25 @@ namespace VEPROMS
|
||||
this.Close();
|
||||
}
|
||||
|
||||
// new Admin Tools user interface for deletes
|
||||
private void sideNavItmDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
AdminToolType = E_AdminToolType.Delete;
|
||||
lblAdmToolProgressType.Text = "";
|
||||
setupProgessSteps1();
|
||||
|
||||
if (swDeleteFolder.Value)
|
||||
ResetDelTV(true);
|
||||
else
|
||||
ResetDelTV(false);
|
||||
}
|
||||
|
||||
// new Admin Tools user interface for deletes
|
||||
//private void sideNavItmDelete_Click_1(object sender, EventArgs e)
|
||||
//{
|
||||
|
||||
//}
|
||||
|
||||
#region On/Off Swiches
|
||||
|
||||
// C2017-030 new Admin Tools user interface
|
||||
@@ -1254,7 +1405,8 @@ namespace VEPROMS
|
||||
Check = 0,
|
||||
Repair = 1,
|
||||
Links = 2,
|
||||
Users = 3
|
||||
Users = 3,
|
||||
Delete = 4
|
||||
};
|
||||
private E_AdminToolType AdminToolType = 0;
|
||||
|
||||
@@ -1305,6 +1457,11 @@ namespace VEPROMS
|
||||
splitContainer3.Panel2Collapsed = true;
|
||||
progressSteps1.Visible = false;
|
||||
break;
|
||||
|
||||
case E_AdminToolType.Delete:
|
||||
splitContainer3.Panel2Collapsed = true;
|
||||
progressSteps1.Visible = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1500,5 +1657,138 @@ namespace VEPROMS
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//C2024-005 Delete Annotations, Delete Folders
|
||||
private void swDeleteAnnotations_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
swDeleteFolder.Value = !swDeleteAnnotations.Value;
|
||||
if (swDeleteFolder.Value)
|
||||
ResetDelTV(true);
|
||||
else
|
||||
ResetDelTV(false);
|
||||
}
|
||||
|
||||
private void swDeleteFolder_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
swDeleteAnnotations.Value = !swDeleteFolder.Value;
|
||||
if (swDeleteFolder.Value)
|
||||
ResetDelTV(true);
|
||||
else
|
||||
ResetDelTV(false);
|
||||
}
|
||||
|
||||
private void btnDeleteItems_Click(object sender, EventArgs e)
|
||||
{
|
||||
//clear
|
||||
txtResults.Clear();
|
||||
txtProcess.Clear();
|
||||
|
||||
|
||||
if (swDeleteFolder.Value)
|
||||
{
|
||||
//TODO process deletions of folders
|
||||
txtProcess.AppendText("Deleting Folders...");
|
||||
|
||||
//List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
||||
//foreach (TreeNode tn in myProcedures.Keys)
|
||||
// if (tn.Checked)
|
||||
// pil.Add(myProcedures[tn]);
|
||||
|
||||
////Load Selected Folders
|
||||
Dictionary<int, string> folderData = new Dictionary<int, string>();
|
||||
|
||||
//List<FolderInfo> Flist = new List<FolderInfo>();
|
||||
//foreach (TreeNode tn in myDocVersions.Keys)
|
||||
// if (tn.Checked)
|
||||
// Flist.Add();
|
||||
|
||||
//List<DocVersionInfo> dvil = new List<DocVersionInfo>();
|
||||
//foreach (TreeNode tn in myDocVersions.Keys)
|
||||
// if (tn.Checked)
|
||||
// dvil.Add(myDocVersions[tn]);
|
||||
|
||||
//foreach (TreeNode tn in myTVdel.Nodes)
|
||||
//{
|
||||
// if (tn.Checked)
|
||||
// {
|
||||
// var itemInfo = myProcedures[tn];
|
||||
// folderData.Add(itemInfo.ItemID, itemInfo.DisplayText);
|
||||
// }
|
||||
//}
|
||||
|
||||
//ProcessDelete(dvil);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Write progress status
|
||||
txtProcess.AppendText("Deleting Annotations...");
|
||||
|
||||
// Create a list of procedures the user selected
|
||||
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
||||
foreach (TreeNode tn in myProcedures.Keys)
|
||||
if (tn.Checked)
|
||||
pil.Add(myProcedures[tn]);
|
||||
|
||||
// Create a list of doc versions the user selected
|
||||
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
|
||||
foreach (TreeNode tn in myDocVersions.Keys)
|
||||
if (tn.Checked)
|
||||
dvil.Add(myDocVersions[tn]);
|
||||
|
||||
frmAnnotationsCleanup frmAnnoDel = new frmAnnotationsCleanup(this, pil, dvil);
|
||||
|
||||
frmAnnoDel.ShowDialog();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void ProcessDelete(List<DocVersionInfo> foldersToDelete)
|
||||
{
|
||||
DateTime pStart = DateTime.Now;
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm"));
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
|
||||
foreach (var kvp in foldersToDelete)
|
||||
{
|
||||
int itemID = (int)kvp.ItemID;
|
||||
string folderName = kvp.Name;
|
||||
|
||||
// Perform the deletion operation
|
||||
// Assume DeleteFolderByID is a method that deletes the folder by its ItemID
|
||||
bool deletionSuccessful = DeleteFolderByID(itemID);
|
||||
|
||||
// Update txtProcess with the progress
|
||||
if (deletionSuccessful)
|
||||
{
|
||||
txtProcess.AppendText($"Successfully deleted folder: {folderName} (ID: {itemID})");
|
||||
}
|
||||
else
|
||||
{
|
||||
txtProcess.AppendText($"Failed to delete folder: {folderName} (ID: {itemID})");
|
||||
}
|
||||
txtProcess.AppendText(Environment.NewLine);
|
||||
}
|
||||
}
|
||||
// Example deletion method
|
||||
private bool DeleteFolderByID(int itemID)
|
||||
{
|
||||
// Implement your folder deletion logic here
|
||||
// Return true if deletion was successful, false otherwise
|
||||
return true; // Placeholder
|
||||
}
|
||||
|
||||
public List<ProcedureInfo> RetrieveChkAnnotations()
|
||||
{
|
||||
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
||||
foreach (TreeNode tn in myProcedures.Keys)
|
||||
if (tn.Checked)
|
||||
pil.Add(myProcedures[tn]);
|
||||
return pil;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -117,74 +117,43 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="warningBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
|
||||
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
|
||||
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
|
||||
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
|
||||
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
|
||||
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
|
||||
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
|
||||
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
|
||||
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
|
||||
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
|
||||
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
|
||||
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
|
||||
zJwL4b/EAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="swCkObsoleteROData.SuperTooltip" xml:space="preserve">
|
||||
<value>Referenced Objects databases are associated with a procedure set (such as Working Draft).
|
||||
<data name="swDeleteFolder.SuperTooltip" xml:space="preserve">
|
||||
<value>This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode.
|
||||
|
||||
Bad referenced bject links will be identified with an Bad RO Link annotation. Use the PROMS Search tool to list all of the steps that have this annotation.
|
||||
|
||||
Be sure a current backup of the database exists prior performing this function.
|
||||
|
||||
It is recommended that this be done during off hours.
|
||||
|
||||
RO paths, ROFST versions, and the contents of RO figures are stored in the database when referenced. This tool will identify stored RO Paths, ROFST versions, and Figures that are no longer used.
|
||||
</value>
|
||||
</data>
|
||||
<data name="swHiddenDataLocs.SuperTooltip" xml:space="preserve">
|
||||
<value>Typically, a section in PROMS only has sub-sections or steps. When and existing section is divided into sub-sections, the resulting main section might have both.
|
||||
<data name="labelX13.SuperTooltip" xml:space="preserve">
|
||||
<value>This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode.
|
||||
|
||||
When this occurs, the step data in the main section can be marked as non-editable. The user can no longer get to these steps and they can become forgotten as PROMS will ignore these non-editable steps when the procedure is printed.
|
||||
Bad referenced bject links will be identified with an Bad RO Link annotation. Use the PROMS Search tool to list all of the steps that have this annotation.
|
||||
|
||||
This tool will identify if the database has non-editable steps and provide a listing of these steps. The use can then go to these main sections, make them editable via the property page, and delete or move these steps.
|
||||
Be sure a current backup of the database exists prior performing this function.
|
||||
|
||||
This tool may take an extended period of time to execute.
|
||||
It is recommended that this be done during off hours.
|
||||
</value>
|
||||
</data>
|
||||
<data name="labelX3.SuperTooltip" xml:space="preserve">
|
||||
<value>Referenced Objects databases are associated with a procedure set (such as Working Draft).
|
||||
<data name="swDeleteAnnotations.SuperTooltip" xml:space="preserve">
|
||||
<value>This function will refresh transitions in all procedures selected below, whether they were selected individually or as a group via a procedure set.
|
||||
|
||||
RO paths, ROFST versions, and the contents of RO figures are stored in the database when referenced. This tool will identify stored RO Paths, ROFST versions, and Figures that are no longer used.
|
||||
</value>
|
||||
Be sure a current backup of the database exists prior to running this function.
|
||||
|
||||
If more than one procedure is selected, it is recommended that this be performed during off hours.</value>
|
||||
</data>
|
||||
<data name="labelX2.SuperTooltip" xml:space="preserve">
|
||||
<value>Typically, a section in PROMS only has sub-sections or steps. When and existing section is divided into sub-sections, the resulting main section might have both.
|
||||
<data name="labelX14.SuperTooltip" xml:space="preserve">
|
||||
<value>This function will refresh transitions in all procedures selected below, whether they were selected individually or as a group via a procedure set.
|
||||
|
||||
When this occurs, the step data in the main section can be marked as non-editable. The user can no longer get to these steps and they can become forgotten as PROMS will ignore these non-editable steps when the procedure is printed.
|
||||
Be sure a current backup of the database exists prior to running this function.
|
||||
|
||||
This tool will identify if the database has non-editable steps and provide a listing of these steps. The use can then go to these main sections, make them editable via the property page, and delete or move these steps.
|
||||
|
||||
This tool may take an extended period of time to execute.
|
||||
</value>
|
||||
</data>
|
||||
<data name="swCkOrphanDataRecs.SuperTooltip" xml:space="preserve">
|
||||
<value>Everything in PROMS is inter-related. A working draft knows what is its first procedure and a procedure knows what is its first step. Likewise, a procedure knows what procedure is before it and after it.
|
||||
|
||||
Should an item become orphaned (disconnected) from the rest of the data, it will no longer be accessible. This tool detects any orphaned items in the database.
|
||||
|
||||
This tool may take an extended period of time to execute.
|
||||
</value>
|
||||
</data>
|
||||
<data name="labelX1.SuperTooltip" xml:space="preserve">
|
||||
<value>Everything in PROMS is inter-related. A working draft knows what is its first procedure and a procedure knows what is its first step. Likewise, a procedure knows what procedure is before it and after it.
|
||||
|
||||
Should an item become orphaned (disconnected) from the rest of the data, it will no longer be accessible. This tool detects any orphaned items in the database.
|
||||
|
||||
This tool may take an extended period of time to execute.
|
||||
</value>
|
||||
If more than one procedure is selected, it is recommended that this be performed during off hours.</value>
|
||||
</data>
|
||||
<data name="swCheckROLinks.SuperTooltip" xml:space="preserve">
|
||||
<value>This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode.
|
||||
@@ -207,6 +176,7 @@ Be sure a current backup of the database exists prior performing this function.
|
||||
It is recommended that this be done during off hours.
|
||||
</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="warningBox5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
|
||||
@@ -269,6 +239,71 @@ If more than one procedure is selected, it is recommended that this be performed
|
||||
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
|
||||
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
|
||||
zJwL4b/EAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="warningBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
|
||||
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
|
||||
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
|
||||
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
|
||||
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
|
||||
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
|
||||
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
|
||||
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
|
||||
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
|
||||
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
|
||||
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
|
||||
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
|
||||
zJwL4b/EAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="swCkObsoleteROData.SuperTooltip" xml:space="preserve">
|
||||
<value>Referenced Objects databases are associated with a procedure set (such as Working Draft).
|
||||
|
||||
RO paths, ROFST versions, and the contents of RO figures are stored in the database when referenced. This tool will identify stored RO Paths, ROFST versions, and Figures that are no longer used.
|
||||
</value>
|
||||
</data>
|
||||
<data name="swHiddenDataLocs.SuperTooltip" xml:space="preserve">
|
||||
<value>Typically, a section in PROMS only has sub-sections or steps. When and existing section is divided into sub-sections, the resulting main section might have both.
|
||||
|
||||
When this occurs, the step data in the main section can be marked as non-editable. The user can no longer get to these steps and they can become forgotten as PROMS will ignore these non-editable steps when the procedure is printed.
|
||||
|
||||
This tool will identify if the database has non-editable steps and provide a listing of these steps. The use can then go to these main sections, make them editable via the property page, and delete or move these steps.
|
||||
|
||||
This tool may take an extended period of time to execute.
|
||||
</value>
|
||||
</data>
|
||||
<data name="labelX3.SuperTooltip" xml:space="preserve">
|
||||
<value>Referenced Objects databases are associated with a procedure set (such as Working Draft).
|
||||
|
||||
RO paths, ROFST versions, and the contents of RO figures are stored in the database when referenced. This tool will identify stored RO Paths, ROFST versions, and Figures that are no longer used.
|
||||
</value>
|
||||
</data>
|
||||
<data name="labelX2.SuperTooltip" xml:space="preserve">
|
||||
<value>Typically, a section in PROMS only has sub-sections or steps. When and existing section is divided into sub-sections, the resulting main section might have both.
|
||||
|
||||
When this occurs, the step data in the main section can be marked as non-editable. The user can no longer get to these steps and they can become forgotten as PROMS will ignore these non-editable steps when the procedure is printed.
|
||||
|
||||
This tool will identify if the database has non-editable steps and provide a listing of these steps. The use can then go to these main sections, make them editable via the property page, and delete or move these steps.
|
||||
|
||||
This tool may take an extended period of time to execute.
|
||||
</value>
|
||||
</data>
|
||||
<data name="swCkOrphanDataRecs.SuperTooltip" xml:space="preserve">
|
||||
<value>Everything in PROMS is inter-related. A working draft knows what is its first procedure and a procedure knows what is its first step. Likewise, a procedure knows what procedure is before it and after it.
|
||||
|
||||
Should an item become orphaned (disconnected) from the rest of the data, it will no longer be accessible. This tool detects any orphaned items in the database.
|
||||
|
||||
This tool may take an extended period of time to execute.
|
||||
</value>
|
||||
</data>
|
||||
<data name="labelX1.SuperTooltip" xml:space="preserve">
|
||||
<value>Everything in PROMS is inter-related. A working draft knows what is its first procedure and a procedure knows what is its first step. Likewise, a procedure knows what procedure is before it and after it.
|
||||
|
||||
Should an item become orphaned (disconnected) from the rest of the data, it will no longer be accessible. This tool detects any orphaned items in the database.
|
||||
|
||||
This tool may take an extended period of time to execute.
|
||||
</value>
|
||||
</data>
|
||||
<data name="swRefreshTblsForSrch.SuperTooltip" xml:space="preserve">
|
||||
@@ -368,6 +403,6 @@ Should an item become orphaned (disconnected) from the rest of the data, it will
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>38</value>
|
||||
<value>46</value>
|
||||
</metadata>
|
||||
</root>
|
||||
</root>
|
@@ -214,7 +214,7 @@ namespace VEPROMS
|
||||
this.btnSendErrorLog,
|
||||
this.btnShowErrFld,
|
||||
this.btnShowPrtFld,
|
||||
this.btnHelpAbout}); ;
|
||||
this.btnHelpAbout});
|
||||
this.btnHelp.Text = "Help";
|
||||
//
|
||||
// btnHelpManual
|
||||
@@ -1763,3 +1763,4 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -225,6 +225,86 @@ namespace VEPROMS.CSLA.Library
|
||||
throw new DbCslaException("Error on Annotation.Delete", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteAnnotationProcByType(int typID, string procList)
|
||||
{
|
||||
if (!CanDeleteObject())
|
||||
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
|
||||
try
|
||||
{
|
||||
DataPortal.Delete(new DeleteAnnotationProcByTypeCriteria(typID, procList));
|
||||
AnnotationInfo.StaticOnInfoChanged();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Data.SqlClient.SqlException exSQL = SqlException(ex);
|
||||
if (exSQL != null && exSQL.Message.Contains("###Cannot Delete Item###"))
|
||||
throw exSQL;
|
||||
Console.WriteLine("AnnotationExt: Stacktrace = {0}", ex.StackTrace);
|
||||
throw new DbCslaException("Error on Annotation.Delete", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteAnnotationDocvByType(int typID, string versionID)
|
||||
{
|
||||
if (!CanDeleteObject())
|
||||
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
|
||||
try
|
||||
{
|
||||
DataPortal.Delete(new DeleteAnnotationDocvByTypeCriteria(typID, versionID));
|
||||
AnnotationInfo.StaticOnInfoChanged();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Data.SqlClient.SqlException exSQL = SqlException(ex);
|
||||
if (exSQL != null && exSQL.Message.Contains("###Cannot Delete Item###"))
|
||||
throw exSQL;
|
||||
Console.WriteLine("AnnotationExt: Stacktrace = {0}", ex.StackTrace);
|
||||
throw new DbCslaException("Error on Annotation.Delete", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getAnnotationProcCnt(int typID, string procList)
|
||||
{
|
||||
if (!CanGetObject())
|
||||
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
|
||||
try
|
||||
{
|
||||
Annotation ProcCnt = DataPortal.Fetch<Annotation>(new getAnnotationCountProcCriteria(typID, procList));
|
||||
AnnotationInfo.StaticOnInfoChanged();
|
||||
return Annotation.ProcCnt;
|
||||
//return Int32.Parse(ProcCnt);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Data.SqlClient.SqlException exSQL = SqlException(ex);
|
||||
if (exSQL != null && exSQL.Message.Contains("###Cannot retrieve Item###"))
|
||||
throw exSQL;
|
||||
Console.WriteLine("AnnotationExt: Stacktrace = {0}", ex.StackTrace);
|
||||
throw new DbCslaException("Error on getAnnotationCountProcCriteria", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getAnnotationCountDocv(int typID, string procList)
|
||||
{
|
||||
if (!CanGetObject())
|
||||
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
|
||||
try
|
||||
{
|
||||
Annotation DocvCnt = DataPortal.Fetch<Annotation>(new getAnnotationCountDocvCriteria(typID, procList));
|
||||
AnnotationInfo.StaticOnInfoChanged();
|
||||
return Annotation.DocvCnt;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Data.SqlClient.SqlException exSQL = SqlException(ex);
|
||||
if (exSQL != null && exSQL.Message.Contains("###Cannot retrieve Item###"))
|
||||
throw exSQL;
|
||||
Console.WriteLine("AnnotationExt: Stacktrace = {0}", ex.StackTrace);
|
||||
throw new DbCslaException("Error on getAnnotationCountDocvCriteria", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static System.Data.SqlClient.SqlException SqlException(Exception ex)
|
||||
{
|
||||
Type sqlExType = typeof(System.Data.SqlClient.SqlException);
|
||||
@@ -280,12 +360,209 @@ namespace VEPROMS.CSLA.Library
|
||||
throw new DbCslaException("Item.DataPortal_Delete", ex);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable()]
|
||||
protected class DeleteAnnotationProcByTypeCriteria
|
||||
{
|
||||
private int _typeID;
|
||||
public int TypeID
|
||||
{ get { return _typeID; } }
|
||||
|
||||
private string _procList;
|
||||
public string ProcList
|
||||
{ get { return _procList; } }
|
||||
public DeleteAnnotationProcByTypeCriteria(int typeID, string procList)
|
||||
{
|
||||
_typeID = typeID;
|
||||
_procList = procList;
|
||||
}
|
||||
}
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
private void DataPortal_Delete(DeleteAnnotationProcByTypeCriteria criteria)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.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 = "deleteAnnotationsProcByType";
|
||||
cm.Parameters.AddWithValue("@typeid", criteria.TypeID);
|
||||
cm.Parameters.AddWithValue("@procList", criteria.ProcList);
|
||||
cm.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Delete", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Item.DataPortal_Delete Annotations by group", ex);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable()]
|
||||
protected class DeleteAnnotationDocvByTypeCriteria
|
||||
{
|
||||
private int _typeID;
|
||||
public int TypeID
|
||||
{ get { return _typeID; } }
|
||||
|
||||
private string _versionID;
|
||||
public string VersionID
|
||||
{ get { return _versionID; } }
|
||||
public DeleteAnnotationDocvByTypeCriteria(int typeID, string versionID)
|
||||
{
|
||||
_typeID = typeID;
|
||||
_versionID = versionID;
|
||||
}
|
||||
}
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
private void DataPortal_Delete(DeleteAnnotationDocvByTypeCriteria criteria)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Delete Annotations by Type Docv", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandTimeout = Database.SQLTimeout;
|
||||
cm.CommandText = "deleteAnnotationsDocvByType";
|
||||
cm.Parameters.AddWithValue("@typeid", criteria.TypeID);
|
||||
cm.Parameters.AddWithValue("@docvList", criteria.VersionID);
|
||||
cm.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Delete", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Item.DataPortal_Delete Annotations by type Docv", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static int _procCnt;
|
||||
public static int ProcCnt
|
||||
{
|
||||
get { return _procCnt; }
|
||||
set { _procCnt = value; }
|
||||
}
|
||||
|
||||
[Serializable()]
|
||||
protected class getAnnotationCountProcCriteria
|
||||
{
|
||||
private int _procCnt;
|
||||
public int ProcCnt
|
||||
{ get { return _procCnt; }
|
||||
set { _procCnt = value; }
|
||||
}
|
||||
private int _typeID;
|
||||
public int TypeID
|
||||
{ get { return _typeID; } }
|
||||
private string _procList;
|
||||
public string ProcList
|
||||
{ get { return _procList; } }
|
||||
public getAnnotationCountProcCriteria(int typeID, string procList, int procCnt = 0)
|
||||
{
|
||||
_typeID = typeID;
|
||||
_procList = procList;
|
||||
_procCnt = procCnt;
|
||||
}
|
||||
}
|
||||
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
private getAnnotationCountProcCriteria DataPortal_Fetch(getAnnotationCountProcCriteria criteria)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.DataPortal_Fetch", GetHashCode());
|
||||
try
|
||||
{
|
||||
//int ProcCnt;
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandTimeout = Database.SQLTimeout;
|
||||
cm.CommandText = "getAnnotationProcCount";
|
||||
cm.Parameters.AddWithValue("@procList", criteria.ProcList);
|
||||
cm.Parameters.AddWithValue("@typeid", criteria.TypeID);
|
||||
Annotation.ProcCnt = (int)cm.ExecuteScalar();
|
||||
|
||||
}
|
||||
}
|
||||
return criteria; //_procCnt.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.GetAnnotationProcCnt", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Annotation.GetAnnotationProcCnt by group", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static int _docvCnt;
|
||||
public static int DocvCnt
|
||||
{ get { return _docvCnt; }
|
||||
set { _docvCnt = value; }
|
||||
}
|
||||
|
||||
[Serializable()]
|
||||
protected class getAnnotationCountDocvCriteria
|
||||
{
|
||||
private int _docvCnt;
|
||||
public int DocvCnt
|
||||
{ get { return _docvCnt; }
|
||||
set { _docvCnt = value; }
|
||||
}
|
||||
private int _TypeID;
|
||||
public int TypeID
|
||||
{ get { return _TypeID; } }
|
||||
private string _docvList;
|
||||
public string DocvList
|
||||
{ get { return _docvList; } }
|
||||
public getAnnotationCountDocvCriteria(int typeID, string docvList, int docvCnt = 0)
|
||||
{
|
||||
_TypeID = typeID;
|
||||
_docvList = docvList;
|
||||
_docvCnt = docvCnt;
|
||||
}
|
||||
}
|
||||
|
||||
[Transactional(TransactionalTypes.TransactionScope)]
|
||||
private getAnnotationCountDocvCriteria DataPortal_Fetch(getAnnotationCountDocvCriteria criteria)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.DataPortal_Fetch", GetHashCode());
|
||||
try
|
||||
{
|
||||
//int ProcCnt;
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.CommandTimeout = Database.SQLTimeout;
|
||||
cm.CommandText = "getAnnotationDocvCount";
|
||||
cm.Parameters.AddWithValue("@typeid", criteria.TypeID);
|
||||
cm.Parameters.AddWithValue("@DocvList", criteria.DocvList);
|
||||
Annotation.DocvCnt = (int)cm.ExecuteScalar();
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Delete", ex);
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("Item.DataPortal_Delete Annotations by group", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
//public partial class AnnotationTypeAnnotations
|
||||
//{
|
||||
// public static int GetAnnotationID()
|
||||
// {
|
||||
// return AnnotationTypeAnnotat
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1944,54 +1944,6 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
#endregion
|
||||
#region DataPortal
|
||||
private void DataPortal_Fetch(PastingPartEnhancedCriteria criteria)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.DataPortal_Fetch", GetHashCode());
|
||||
try
|
||||
{
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
{
|
||||
Csla.ApplicationContext.LocalContext["cn"] = cn;
|
||||
using (SqlCommand cm = cn.CreateCommand())
|
||||
{
|
||||
cm.CommandType = CommandType.StoredProcedure;
|
||||
cm.Parameters.AddWithValue("@StartItemID", criteria.StartItemID); // copy children
|
||||
cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); //copy to
|
||||
cm.Parameters.AddWithValue("@Type", criteria.Type);
|
||||
cm.Parameters.AddWithValue("@DTS", criteria.DTS);
|
||||
cm.Parameters.AddWithValue("@UserID", criteria.UserID);
|
||||
SqlParameter param_ItemID = new SqlParameter("@NewItemID", SqlDbType.Int);
|
||||
param_ItemID.Direction = ParameterDirection.Output;
|
||||
cm.Parameters.Add(param_ItemID);
|
||||
cm.CommandText = "PasteItemEnhancedReplace";
|
||||
//cm.CommandText = "PasteItemReplace";
|
||||
cm.CommandTimeout = Database.DefaultTimeout;
|
||||
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||
{
|
||||
//int newItemID = (int)cm.Parameters["@NewItemID"].Value;
|
||||
if (!dr.Read())
|
||||
{
|
||||
_ErrorMessage = "No Record Found";
|
||||
return;
|
||||
}
|
||||
ReadData(dr);
|
||||
}
|
||||
}
|
||||
// removing of item only needed for local data portal
|
||||
if (Csla.ApplicationContext.ExecutionLocation == Csla.ApplicationContext.ExecutionLocations.Client)
|
||||
Csla.ApplicationContext.LocalContext.Remove("cn");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (!ex.Message.Contains("This step has been deleted") && !ex.Message.Contains("This current step has been deleted in another session"))
|
||||
{
|
||||
if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.DataPortal_Fetch", ex);
|
||||
}
|
||||
_ErrorMessage = ex.Message;
|
||||
throw new DbCslaException("ItemInfo.DataPortal_Fetch", ex);
|
||||
}
|
||||
}
|
||||
private void DataPortal_Fetch(PastingPartCriteria criteria)
|
||||
{
|
||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.DataPortal_Fetch", GetHashCode());
|
||||
@@ -2114,68 +2066,6 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region PastingPartEnhancedCriteria
|
||||
[Serializable()]
|
||||
public class PastingPartEnhancedCriteria
|
||||
{
|
||||
#region Properties
|
||||
private int _StartItemID;
|
||||
public int StartItemID
|
||||
{
|
||||
get { return _StartItemID; }
|
||||
set { _StartItemID = value; }
|
||||
}
|
||||
private int _ItemID; // paste relative to this itemid
|
||||
public int ItemID
|
||||
{
|
||||
get { return _ItemID; }
|
||||
set { _ItemID = value; }
|
||||
}
|
||||
private EAddpingPart _AddType;
|
||||
public EAddpingPart AddType
|
||||
{
|
||||
get { return _AddType; }
|
||||
set { _AddType = value; }
|
||||
}
|
||||
private int? _FromType = null;
|
||||
public int? FromType
|
||||
{
|
||||
get { return _FromType; }
|
||||
set { _FromType = value; }
|
||||
}
|
||||
private int? _Type = null;
|
||||
public int? Type
|
||||
{
|
||||
get { return _Type; }
|
||||
set { _Type = value; }
|
||||
}
|
||||
private DateTime _DTS;
|
||||
public DateTime DTS
|
||||
{
|
||||
get { return _DTS; }
|
||||
set { _DTS = value; }
|
||||
}
|
||||
private string _UserID;
|
||||
public string UserID
|
||||
{
|
||||
get { return _UserID; }
|
||||
set { _UserID = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Constructor
|
||||
public PastingPartEnhancedCriteria(int startItemid, int itemID, EAddpingPart addType, int? type, int? fromType, DateTime dts, string userID)
|
||||
{
|
||||
_StartItemID = startItemid;
|
||||
_ItemID = itemID;
|
||||
_AddType = addType;
|
||||
_Type = type;
|
||||
_FromType = fromType;
|
||||
_DTS = dts;
|
||||
_UserID = userID;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
#region PastingPartCriteria
|
||||
[Serializable()]
|
||||
public class PastingPartCriteria
|
||||
@@ -2466,17 +2356,6 @@ namespace VEPROMS.CSLA.Library
|
||||
_MyPrevious = null; // Reset list so that the next line gets a new list
|
||||
if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for new value
|
||||
}
|
||||
internal static ItemInfo CopyPasteReplaceEnhancedItemInfoFetch(int copyStartID, ItemInfo itemInfo) // int itemID, int? type, int? fromType)
|
||||
{
|
||||
ItemInfo tmp = null;
|
||||
tmp = DataPortal.Fetch<StepInfo>(new ItemInfo.PastingPartEnhancedCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
||||
if (tmp == null)
|
||||
{
|
||||
tmp = ItemInfo.Get(copyStartID);
|
||||
}
|
||||
AddToCache(tmp);
|
||||
return tmp;
|
||||
}
|
||||
internal static ItemInfo CopyPasteReplaceItemInfoFetch(int copyStartID, ItemInfo itemInfo) // int itemID, int? type, int? fromType)
|
||||
{
|
||||
ItemInfo tmp = null;
|
||||
@@ -2624,18 +2503,10 @@ namespace VEPROMS.CSLA.Library
|
||||
|
||||
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, TreeNode treeNodeReplace)
|
||||
{
|
||||
if (itemInfo.IsEnhancedStep)
|
||||
{
|
||||
// don't replace the step, just remove current children & add new children:
|
||||
if (!CanDeleteObject())
|
||||
throw new System.Security.SecurityException("User not authorized to remove a Item");
|
||||
|
||||
}
|
||||
bool tmp = false;
|
||||
return PasteReplace(itemInfo, copyStartID, chgid, treeNodeReplace, ref tmp);
|
||||
}
|
||||
// B2017-179 return a bool (firstTrans) if we could not replace the step but the user wants to position to the first transition that needs resolved
|
||||
// B2017-179 return a bool (firstTrans) if we could not replace the step but the user wants to position to the first transition that needs resolved
|
||||
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, TreeNode treeNodeReplace, ref bool firstTrans)
|
||||
{
|
||||
firstTrans = false;
|
||||
@@ -2647,17 +2518,8 @@ namespace VEPROMS.CSLA.Library
|
||||
ItemInfo newItemInfo = null;
|
||||
try
|
||||
{
|
||||
// if this item is an enhanced item, do a pastereplace specific to it:
|
||||
if (itemInfo.IsEnhancedStep)
|
||||
{
|
||||
newItemInfo = ItemInfo.CopyPasteReplaceEnhancedItemInfoFetch(copyStartID, itemInfo);
|
||||
if (newItemInfo == null) return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); //itemInfo.ItemID, itemInfo.MyContent.Type, itemInfo.MyContent.Type);
|
||||
if (newItemInfo == null) return null;
|
||||
}
|
||||
newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); //itemInfo.ItemID, itemInfo.MyContent.Type, itemInfo.MyContent.Type);
|
||||
if (newItemInfo == null) return null;
|
||||
}
|
||||
catch (Exception ex1)
|
||||
{
|
||||
@@ -2685,6 +2547,7 @@ namespace VEPROMS.CSLA.Library
|
||||
newItemInfo.UpdateTransitionText();
|
||||
newItemInfo.UpdateROText();
|
||||
newItemInfo.UpdatePastedStepTransitionText();
|
||||
|
||||
// Add to tree
|
||||
if (newItemInfo.NextItem != null)
|
||||
{
|
||||
@@ -2702,14 +2565,10 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
else
|
||||
{
|
||||
//Create tree node for copied procedure when no other procedures exist in the folder
|
||||
VETreeNode vtn = treeNodeReplace as VETreeNode;
|
||||
DocVersionInfo dvi = vtn.VEObject as DocVersionInfo;
|
||||
|
||||
ItemInfo newProc = dvi.PasteChild(copyStartID);
|
||||
VETreeNode tn1 = new VETreeNode(newProc);
|
||||
treeNodeReplace.Nodes.Add(tn1); // add tree node to end of list.
|
||||
treeNodeReplace = tn1;
|
||||
//Create tree node for copied procedure when no other procedures exist in the working draft (treeNodeReplace)
|
||||
VETreeNode tn = null;
|
||||
tn = new VETreeNode(newItemInfo);
|
||||
treeNodeReplace.Nodes.Add(tn);
|
||||
}
|
||||
return newItemInfo;
|
||||
}
|
||||
@@ -2722,23 +2581,23 @@ namespace VEPROMS.CSLA.Library
|
||||
firstTrans = true; // B2017-179 set the firstTrans to true and return the itminfo of the first transition location that needs resolved
|
||||
return iii;
|
||||
}
|
||||
if (!HandleSqlExceptionOnCopy(ex))
|
||||
{
|
||||
if (ex.Message.Contains("has External Transitions and has no next step")
|
||||
|| ex.Message.Contains("has External Transitions to Procedure")
|
||||
|| ex.Message.Contains("has External Transitions to it's children")
|
||||
|| ex.Message.Contains("This step has been deleted")
|
||||
)
|
||||
throw ex;
|
||||
if (!HandleSqlExceptionOnCopy(ex))
|
||||
{
|
||||
if (ex.Message.Contains("has External Transitions and has no next step")
|
||||
|| ex.Message.Contains("has External Transitions to Procedure")
|
||||
|| ex.Message.Contains("has External Transitions to it's children")
|
||||
|| ex.Message.Contains("This step has been deleted")
|
||||
)
|
||||
throw ex;
|
||||
FlexibleMessageBox.Show("Details were written to the Error Log.", "Paste Replace Failed", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
|
||||
return itemInfo;
|
||||
}
|
||||
else
|
||||
return itemInfo;
|
||||
return itemInfo;
|
||||
}
|
||||
else
|
||||
return itemInfo;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
private static bool HandleSqlExceptionOnCopy(Exception ex)
|
||||
private static bool HandleSqlExceptionOnCopy(Exception ex)
|
||||
{
|
||||
if (ex.Message.Contains("This step has been deleted"))
|
||||
{
|
||||
|
@@ -346,10 +346,11 @@ namespace Volian.Controls.Library
|
||||
ch = (ROFSTLookup.rochild)cmboTreeROs.SelectedNode.Tag;
|
||||
chld = ch.children;
|
||||
// build a list of ROs to search
|
||||
return _MyRODbID.ToString() + ":" + GetROsToSearch(chld);
|
||||
//return _MyRODbID.ToString() + ":" + ch.roid + "0000," + GetROsToSearch(chld);
|
||||
//if (strRtnStr.EndsWith(","))
|
||||
// strRtnStr = strRtnStr.Substring(0, strRtnStr.Length - 1);
|
||||
// B2022-118: remove the ending comma otherwise query will fail
|
||||
string strRtnStr = _MyRODbID.ToString() + ":" + GetROsToSearch(chld);
|
||||
if (strRtnStr.EndsWith(","))
|
||||
strRtnStr = strRtnStr.Substring(0, strRtnStr.Length - 1);
|
||||
return strRtnStr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1939,6 +1940,13 @@ namespace Volian.Controls.Library
|
||||
private string GetROsToSearch(ROFSTLookup.rochild[] chld)
|
||||
{
|
||||
string rtnstr = string.Empty;
|
||||
// B2022-118: If the ro has child nodes in tree view but they aren't loaded, load them
|
||||
if ((chld == null || chld.Length <= 0) && (cmboTreeROs.SelectedNode.Nodes != null || cmboTreeROs.SelectedNode.Nodes.Count >= 1))
|
||||
{
|
||||
ROFSTLookup.rochild ro = (ROFSTLookup.rochild)cmboTreeROs.SelectedNode.Tag;
|
||||
MyROFSTLookup.LoadChildren(ref ro);
|
||||
chld = ro.children;
|
||||
}
|
||||
|
||||
// B2022-026 RO Memory Reduction code - check children length
|
||||
if (chld == null || chld.Length <= 0) // get a single ROID
|
||||
@@ -1956,7 +1964,17 @@ namespace Volian.Controls.Library
|
||||
if (roc.children != null && roc.children.Length > 0)
|
||||
rtnstr += GetROsToSearch(roc.children);
|
||||
else
|
||||
rtnstr += ROFSTLookup.FormatRoidKey(roc.roid, false);
|
||||
{
|
||||
// B2022-118: If the ro has child nodes in tree view but they aren't loaded, load them
|
||||
ROFSTLookup.rochild rot = roc;
|
||||
MyROFSTLookup.LoadChildren(ref rot);
|
||||
chld = rot.children;
|
||||
|
||||
if (rot.children != null && rot.children.Length > 0)
|
||||
rtnstr += GetROsToSearch(rot.children);
|
||||
else
|
||||
rtnstr += string.Format("{0},", ROFSTLookup.FormatRoidKey(roc.roid, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -688,14 +688,14 @@ namespace Volian.Controls.Library
|
||||
edtitm.PasteSiblingAfter(copyStartID);
|
||||
break;
|
||||
case ItemInfo.EAddpingPart.Replace:
|
||||
|
||||
|
||||
EditItem ei = edtitm.PasteReplace(copyStartID);
|
||||
if (ei == null)
|
||||
{
|
||||
{
|
||||
CloseTabItem(_MyDisplayTabItems["Item - " + myItemInfo.ItemID.ToString()]); //Grab itemID and set to close open tab.
|
||||
return false; //B2017-179 PasteReplace will return null if was aborted
|
||||
}
|
||||
|
||||
|
||||
if (ei.MyItemInfo.ItemID != edtitm.MyItemInfo.ItemID)
|
||||
{
|
||||
edtitm.Dispose();
|
||||
@@ -713,7 +713,6 @@ namespace Volian.Controls.Library
|
||||
CloseTabItem(_MyDisplayTabItems["Item - " + myItemInfo.ItemID.ToString()]); //Grab itemID and set to close open tab.
|
||||
return false; //B2017-179 PasteReplace will return null if was aborted
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -1825,8 +1825,16 @@ namespace Volian.Controls.Library
|
||||
EditItem newFocus = null;
|
||||
EditItem nextEditItem = MyNextEditItem;
|
||||
EditItem prevEditItem = MyPreviousEditItem;
|
||||
//if (MyStepPanel?.SelectedEditItem?.ActiveParent == null) return null; //Was causing an error// when active parent was null and the replaced proc was opened in the editor.
|
||||
EditItem parentEditItem = MyStepPanel?.SelectedEditItem?.ActiveParent;
|
||||
EditItem parentEditItem = null; // ActiveParent;
|
||||
try
|
||||
{
|
||||
parentEditItem = ActiveParent ?? MyStepPanel?.SelectedEditItem?.ActiveParent;
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
// KL 7/11/2024 - Handle the case where ActiveParent throws a Null Reference Exception
|
||||
parentEditItem = MyStepPanel?.SelectedEditItem?.ActiveParent;
|
||||
}
|
||||
|
||||
StepConfig savOrigPasteConfig = MyItemInfo.MyConfig as StepConfig;
|
||||
int TopMostYBefore = TopMostEditItem.Top;
|
||||
@@ -1936,7 +1944,7 @@ namespace Volian.Controls.Library
|
||||
sia.IdentifyChildren(highlight);
|
||||
}
|
||||
}
|
||||
if (MyBeforeEditItems != null && !MyItemInfo.IsEnhancedStep)
|
||||
if (MyBeforeEditItems != null)
|
||||
{
|
||||
foreach (EditItem sib in MyBeforeEditItems)
|
||||
{
|
||||
|
@@ -1749,9 +1749,9 @@ namespace Volian.Controls.Library
|
||||
EnhancedDocuments eds = MyItemInfo.GetMyEnhancedDocuments();
|
||||
// note in follow if statements, 'setting' == false when in enhanced document:
|
||||
if (setting && MyItemInfo.IsStep && (eds == null || eds.Count == 0)) // this step is in enhanced, but not linked // B2018-112 and is allowed to edit
|
||||
allowDel = true; // allow delete if not linked
|
||||
btnCpyStp.Enabled = MyUserInfo.IsAllowedToEdit(Mydvi); // setting;
|
||||
//B20170-158 Allow a Unlinked Step to be pasted before or after a linked step.
|
||||
allowDel = true; // allow delete if not linked
|
||||
btnCpyStp.Enabled = setting;
|
||||
//B20170-158 Allow a Unlinked Step to be pasted before or after a linked step.
|
||||
StepTabPanel tmp = Parent as StepTabPanel;
|
||||
//B2020-058: crash on null reference
|
||||
if (tmp != null && tmp.MyDisplayTabControl != null && tmp.MyDisplayTabControl.MyCopyStep != null)
|
||||
@@ -1761,10 +1761,6 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
if (MyItemInfo.IsEnhancedStep) btnPasteReplace.Enabled = btnCMPasteReplace.Enabled = false;
|
||||
}
|
||||
else if (tmp.MyDisplayTabControl.MyCopyStep.IsEnhancedStep && tmp.MyDisplayTabControl.MyCopyStep.MyDocVersion.VersionID == MyItemInfo.MyDocVersion.VersionID)
|
||||
{
|
||||
btnPasteBefore.Enabled = btnPasteAfter.Enabled = MyUserInfo.IsAllowedToEdit(Mydvi);
|
||||
}
|
||||
}
|
||||
else
|
||||
btnStepPaste.Enabled = setting;
|
||||
|
Reference in New Issue
Block a user