Compare commits
9 Commits
C2021-058_
...
B2025-049
Author | SHA1 | Date | |
---|---|---|---|
fb2aeb8192 | |||
24c25ab26c | |||
9da91e460f | |||
2634cf7de9 | |||
7417091f3f | |||
f9aad50f46 | |||
535cd5af2e | |||
4a8e469736 | |||
7d89f711fe |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -20588,11 +20588,6 @@ GO
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- Delete All Existing Rofst Table Data
|
||||
Delete From RofstHeader;
|
||||
|
||||
|
||||
/*
|
||||
==========================================================================================================
|
||||
End: B2022-083: Support Conditional RO Values (v2.1)
|
||||
@@ -24293,8 +24288,23 @@ BEGIN
|
||||
Delete from ROFSTs where ROFSTID not in(select rofstid from Associations) and DTS < @dte
|
||||
delete from roimages where rodbid not in(select rodbid from rofsts) and DTS < @dte
|
||||
delete from documents where docid not in(select docid from entries) and DTS < @dte
|
||||
PRINT 'Temporarally storing Items to delete'
|
||||
declare @Items table (ItemID bigint PRIMARY KEY, deletestatus int)
|
||||
INSERT INTO @Items
|
||||
Select Child.ItemID, Child.deletestatus
|
||||
FROM tblItems AS Child
|
||||
INNER JOIN tblContents AS parent
|
||||
ON Parent.ContentID = Child.ContentID
|
||||
AND Parent.deletestatus = Child.deletestatus
|
||||
Where
|
||||
parent.deletestatus != 0 and parent.ActionDTS < @dte
|
||||
PRINT 'Phase 1'
|
||||
delete from tblAnnotations where deletestatus != 0 and DTS < @dte
|
||||
delete tblAnnotations
|
||||
from tblAnnotations
|
||||
INNER JOIN @Items Itms
|
||||
ON Itms.ItemID = tblAnnotations.ItemID AND tblAnnotations.deletestatus != 0
|
||||
|
||||
delete from drousages where docid in(select docid from tbldocuments where deletestatus != 0) and DTS < @dte
|
||||
delete from tblEntries where deletestatus != 0 and DTS < @dte
|
||||
delete from tblDocuments where deletestatus != 0 and DTS < @dte
|
||||
@@ -24302,11 +24312,46 @@ BEGIN
|
||||
delete from tblImages where deletestatus != 0 and DTS < @dte
|
||||
PRINT 'Phase 2'
|
||||
delete from tblROUsages where deletestatus != 0 and DTS < @dte
|
||||
delete from tblTransitions where deletestatus != 0 and DTS < @dte
|
||||
delete from tblParts where deletestatus != 0 and DTS < @dte
|
||||
delete from tblItems where deletestatus != 0 and ItemID Not IN (Select ItemID from Parts) and DTS < @dte
|
||||
PRINT 'Purge Contents'
|
||||
delete from tblContents where deletestatus != 0 and DTS < @dte
|
||||
delete tblROUsages
|
||||
from tblROUsages
|
||||
INNER JOIN tblContents ON tblContents.ContentID = tblROUsages.ContentID
|
||||
AND tblContents.deletestatus = tblROUsages.deletestatus
|
||||
where tblContents.deletestatus != 0 and tblContents.ActionDTS < @dte
|
||||
PRINT 'Deleting Transitions'
|
||||
delete from tblTransitions where deletestatus != 0 and
|
||||
(DTS < @dte
|
||||
OR RangeID in (Select ItemID FROM @Items)
|
||||
OR ToID in (Select ItemID FROM @Items)
|
||||
OR FromID in (Select ContentID from tblContents where deletestatus != 0 and ActionDTS < @dte)
|
||||
)
|
||||
PRINT 'Deleting Items and Parts'
|
||||
delete from tblItems where deletestatus != 0 and DTS < @dte
|
||||
delete from tblParts where deletestatus != 0 and ItemID Not IN (Select ItemID from Items) and DTS < @dte
|
||||
PRINT 'Purging Parts with deleted Contents'
|
||||
DELETE from Child
|
||||
FROM tblParts AS Child
|
||||
INNER JOIN tblItems
|
||||
ON tblItems.ItemID = Child.ItemID
|
||||
AND tblItems.deletestatus = Child.deletestatus
|
||||
INNER JOIN tblContents AS parent
|
||||
ON parent.ContentID = tblItems.ContentID
|
||||
AND parent.deletestatus = tblItems.deletestatus
|
||||
Where
|
||||
parent.deletestatus != 0 and parent.ActionDTS < @dte
|
||||
DELETE FROM tblParts
|
||||
where deletestatus != 0 AND
|
||||
ContentID in
|
||||
(Select ContentID from tblContents where deletestatus != 0 and ActionDTS < @dte)
|
||||
|
||||
PRINT 'Purging Items with deleted Contents'
|
||||
alter table tblItems nocheck constraint FK_Items_Items
|
||||
DELETE tblItems
|
||||
FROM tblItems
|
||||
INNER JOIN @Items Itms
|
||||
ON Itms.ItemID = tblItems.ItemID AND Itms.deletestatus = tblItems.deletestatus
|
||||
alter table tblItems check constraint FK_Items_Items
|
||||
PRINT 'Purging Contents'
|
||||
delete from tblContents where deletestatus != 0 and ActionDTS < @dte
|
||||
PRINT 'Phase 3'
|
||||
delete from AnnotationAudits where DTS < @dte
|
||||
delete from ContentAudits where DTS < @dte
|
||||
|
@@ -614,7 +614,7 @@ namespace Volian.Controls.Library
|
||||
AddDummyGroup(db, tn);
|
||||
}
|
||||
|
||||
_currRofstID = (int?)MyROFST.ROFstID;
|
||||
_currRofstID = (IsRofstValid) ? (int?)_myROFST.ROFstID : null;
|
||||
_currDocVersionID = null;
|
||||
|
||||
if(_docVersionInfo != null) _currDocVersionID = (int?)_docVersionInfo.VersionID;
|
||||
@@ -789,7 +789,7 @@ namespace Volian.Controls.Library
|
||||
|
||||
private void AddDummyGroup(ROFSTLookup.rodbi rodbi, TreeNode tn)
|
||||
{
|
||||
if (MyROFSTLookup.HasChildren(ref rodbi))
|
||||
if (IsRofstValid && MyROFSTLookup.HasChildren(ref rodbi))
|
||||
{
|
||||
TreeNode tmp = new TreeNode(DummyNodeText);
|
||||
tn.Nodes.Add(tmp);
|
||||
|
Reference in New Issue
Block a user