Compare commits

..

23 Commits

Author SHA1 Message Date
Kevin Laskey
c05e493579 C2021-059 Attempting to resolve conflicts try 1 2024-08-01 14:52:38 -04:00
Kevin Laskey
2714973c16 2021-059 - Matchicng Paul's Changes 2024-08-01 14:49:14 -04:00
Kevin Laskey
5f86d8c629 C2021-059 - Update designer to avoid conflict 2024-08-01 14:41:34 -04:00
Kevin Laskey
977ea6f5fc C2021-059 - Update proms sql fixes with correct numbers 2024-08-01 11:01:28 -04:00
Kevin Laskey
a8bbda1281 C2024-005 - Completed some updates for nested folder selection (parent unselect) 2024-08-01 09:23:30 -04:00
Kevin Laskey
da1b061eb1 C2024-005 - Added orphan record clearing progress bar, confirmation message 2024-07-30 08:54:13 -04:00
Kevin Laskey
4644699df0 C20240-005 - Deleting Folder additions 2024-07-29 15:57:54 -04:00
Kevin Laskey
6e6abbd759 C2024-005 - Kevin working on folder retrieval 2024-07-22 09:28:48 -04:00
Kathy Ruffing
501798a8cb Merge pull request 'C2024-005-Annotations-Cleanup-2' (#355) from C2024-005-Annototions-Cleanup-2 into Development
Reviewed-on: #355
Reviewed-by: Kathy Ruffing <kruffing@volian.com>
Code reviewed successfully
2024-07-18 11:39:12 -04:00
a240bc2c19 C2024-005-Annotations-Cleanup-2 2024-07-18 11:31:49 -04:00
a804a3866a C2024-005-Annotations-Cleanup-2 2024-07-18 11:12:30 -04:00
069ffb80e9 C2024-005-Annotations-Cleanup-2 2024-07-17 14:28:24 -04:00
Kevin Laskey
5255080291 Merge pull request 'B2022-118: search of multi value ROs fails' (#354) from B2022-118 into Development
Reviewed-on: #354
2024-07-17 10:56:40 -04:00
Kathy Ruffing
ae35d9f0d7 B2022-118: search of multi value ROs fails 2024-07-17 10:11:43 -04:00
afbd653611 Merge pull request 'B2024-041 - Update PromsFixes SQL file to acocunt for replacing vs pasting procs' (#352) from B2024-041_v2 into Development
good for testing phase
2024-07-16 16:27:35 -04:00
Kevin Laskey
9a55111e1e B2024-041 - Update PromsFixes SQL file to acocunt for replacing vs pasting procs 2024-07-16 16:20:21 -04:00
422a3053b7 Merge pull request 'B2024-039 Customer reported that transitions to standard text get converted to text when the Refresh Transitions is done from the Admin Tools' (#350) from B2024-039_BNPP_StdtxtTrans into Development
format only changes
2024-07-12 14:16:22 -04:00
feb74ee09f B2024-039 Customer reported that transitions to standard text get converted to text when the Refresh Transitions is done from the Admin Tools 2024-07-12 14:14:23 -04:00
7cebb2b7f1 Merge pull request 'B2024-037: Bug fix for copy/replace functionality on procedures and steps.' (#349) from B2024-037 into Development
changes look good. OK for testing phase.
2024-07-11 10:54:10 -04:00
Kevin Laskey
8097c6283c B2024-037 - Update versioning on proms fixes 2024-07-11 10:30:31 -04:00
Kevin Laskey
8f08ef5ee4 B2024-037 - Slight clean up on parentedititme 2024-07-11 08:45:18 -04:00
Kevin Laskey
fd26f16776 B2024-037 Include proms sql fixes for copy replace functionality 2024-07-10 14:53:20 -04:00
Kevin Laskey
21a83df99d B2024-037 - Fixes made for replacing procs and steps via paste/replace functionality. 2024-07-10 12:15:14 -04:00
23 changed files with 2571 additions and 847 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -22230,9 +22230,11 @@ Go
/*
==========================================================================================================
Begin: C2024-004 | B2024-041: KL - Update Copy Replace functionality, (remove ''copy of'')
==========================================================================================================
*/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[ReplaceItemAndChildren]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
@@ -23245,13 +23247,362 @@ BEGIN CATCH -- Catch Block
END CATCH
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
==========================================================================================================
*/
/*
==========================================================================================================
Start: C2021-059: SQL to delete folders using admin tool
==========================================================================================================
*/
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'deleteFolderAdmin')
DROP PROCEDURE [dbo].[deleteFolderAdmin]
GO
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].[deleteFolderAdmin]
(
@FolderID int
)
WITH EXECUTE AS OWNER
AS
BEGIN TRY -- Try Block
BEGIN TRANSACTION
DELETE From Assignments WHERE [FolderID]=@FolderID
DELETE From Associations where VersionID in (select versionid from DocVersions where folderid = @FolderID)
DELETE From DocVersions where VersionID in (select versionid from DocVersions where folderid= @FolderID)
DELETE From DocVersions where [FolderID]=@FolderID
-- Delete from items where ItemID matches
DELETE FROM tblitems
WHERE ItemID IN (
SELECT DISTINCT ItemID
FROM docversions
WHERE folderID = @folderID
);
-- Delete from items where ItemID matches
DELETE FROM tblitems
WHERE ItemID IN (
SELECT DISTINCT ItemID
FROM docversions
WHERE folderID = @folderID
);
-- Delete from tblContents where ContentID matches
DELETE FROM tblContents
WHERE ContentID IN (
SELECT DISTINCT c.ContentID
FROM tblContents c
JOIN items i ON c.ContentID = i.ItemID
WHERE i.ItemID IN (
SELECT DISTINCT ItemID
FROM docversions
WHERE folderID = @folderID
)
);
DELETE From Folders WHERE [ParentID] = @FolderID
DELETE From Folders WHERE [FolderID] = @FolderID
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
/*
==========================================================================================================
End: C2021-059: SQL to delete folders using admin tool
==========================================================================================================
*/
-----------------------------------------------------------------------------
/*
---------------------------------------------------------------------------
| ADD New Code Before this Block |
@@ -23285,8 +23636,8 @@ BEGIN TRY -- Try Block
DECLARE @RevDate varchar(255)
DECLARE @RevDescription varchar(255)
set @RevDate = '07/16/2024 3:37 PM'
set @RevDescription = 'B2024-041: Updates to allow for proper replace vs paste above or below'
set @RevDate = '07/29/2024 11:24'
set @RevDescription = 'C2021-059 Add SQL for Admin tool delete folders.'
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
@@ -23304,6 +23655,3 @@ ELSE PRINT 'StoredProcedure [vesp_GetSQLCodeRevision] Error on Creation'
go
Exec vesp_GetSQLCodeRevision;

View File

@@ -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>

View 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;
}
}

View 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();
}
}
}

View 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>

File diff suppressed because it is too large Load Diff

View File

@@ -24,10 +24,27 @@ namespace VEPROMS
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
public frmBatchRefresh(SessionInfo sessionInfo)
private frmVEPROMS _veProms;
public frmBatchRefresh(SessionInfo sessionInfo, frmVEPROMS veProms)
{
InitializeComponent();
_MySessionInfo = sessionInfo;
_veProms = veProms;
if (sideNavItmDelete.Checked)
{
AdminToolType = (E_AdminToolType)4;
if (swDeleteFolder.Value)
{
ResetDelTV(true);
setupProgessSteps1();
}
else
ResetDelTV(false);
}
setupProgessSteps1(); // C2017-030 - new Admin Tools user interface
UserInfo ui = UserInfo.GetByUserID(MySessionInfo.UserID);
IsAdministratorUser = ui.IsAdministrator();
@@ -43,11 +60,18 @@ 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;
@@ -74,6 +98,7 @@ namespace VEPROMS
private Dictionary<TreeNode, ProcedureInfo> myProcedures = new Dictionary<TreeNode, ProcedureInfo>();
private Dictionary<TreeNode, DocVersionInfo> myDocVersions = new Dictionary<TreeNode, DocVersionInfo>();
private Dictionary<TreeNode, FolderInfo> myFolders = new Dictionary<TreeNode, FolderInfo>();
private void frmBatchRefresh_Load(object sender, EventArgs e)
{
IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
@@ -116,6 +141,8 @@ namespace VEPROMS
//myTreeNodePath = new List<string>();
myTV.Nodes.Clear();
myDocVersions.Clear();
myFolders.Clear();
FolderInfo fi = FolderInfo.GetTop();
TreeNode tn = myTV.Nodes.Add(fi.Name);
tn.Tag = fi;
@@ -125,30 +152,87 @@ 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)
{
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();
//Expand if folders
if (noProcs)
myTVdel.ExpandAll();
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)
{
bool loadedWorkingDraft = false;
bool loadedChildWorkingDraft = false; // B2021-060 flag when child folder working draft is loaded
bool loadedChildWorkingDraft = false;
foreach (FolderInfo fic in fi.SortedChildFolders)
{
TreeNode tnc = tn.Nodes.Add(fic.Name);
tnc.Tag = fic;
if (fic.ChildFolderCount > 0)
{
if (LoadChildFolders(fic, tnc, noProcs))
{
loadedChildWorkingDraft = true;
// B2020-114 and C2020-035 only show folders the Set Admin can access
}
}
if (fic.FolderDocVersionCount > 0)
{
if (!LoadDocVersions(fic, tnc, noProcs))
{
tnc.Remove();
}
else
{
loadedWorkingDraft = true;
}
}
if (loadedChildWorkingDraft) loadedWorkingDraft = true; // B2021-060 if child folder working draft loaded set loadedWorkingDraft
else
{
// Add the folder to the dictionary
if (!myFolders.ContainsKey(tnc))
{
myFolders.Add(tnc, fic);
}
}
}
if (loadedChildWorkingDraft)
{
loadedWorkingDraft = true;
}
if (tn.Parent != null && !loadedWorkingDraft)
{
tn.Remove();
}
return loadedWorkingDraft;
}
private bool LoadDocVersions(FolderInfo fic, TreeNode tnc, bool noProcs)
@@ -1121,10 +1205,35 @@ 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)
@@ -1138,6 +1247,80 @@ namespace VEPROMS
}
}
//After check model to select and deselect nodes on the delete and annotation tree.
private void myTV_AfterCheck_DelAnn(object sender, TreeViewEventArgs e)
{
if (e.Action != TreeViewAction.Unknown)
{
if (e.Node.Nodes.Count > 0)
{
CheckChildNodes_DelAnn(e.Node, e.Node.Checked);
}
}
if (e.Node.Checked)
{
// Ensure child nodes follow the parent node's state
CheckChildNodes_DelAnn(e.Node, e.Node.Checked);
}
else
{
// Automatically deselect parent nodes if current node is unchecked
if (swDeleteFolder.Value)
DiselectParentNodes_DelAnn(e.Node);
}
btnFixLinks.Enabled = AtLeastOneNodeChecked_DelAnn(); // Ensure button is enabled based on custom logic
}
private void DiselectParentNodes_DelAnn(TreeNode node)
{
TreeNode parent = node.Parent;
while (parent != null)
{
parent.Checked = false;
parent = parent.Parent;
}
}
private void DiselectChildNodes_DelAnn(TreeNodeCollection children)
{
foreach (TreeNode child in children)
{
child.Checked = false;
DiselectChildNodes_DelAnn(child.Nodes);
}
}
private void CheckChildNodes_DelAnn(TreeNode treeNode, bool isChecked)
{
foreach (TreeNode tn in treeNode.Nodes)
{
tn.Checked = isChecked;
if (tn.Nodes.Count > 0)
CheckChildNodes_DelAnn(tn, isChecked);
}
}
private bool AtLeastOneNodeChecked_DelAnn()
{
foreach (TreeNode node in myTV.Nodes)
{
if (node.Checked || AnyChildNodeChecked_DelAnn(node))
return true;
}
return false;
}
private bool AnyChildNodeChecked_DelAnn(TreeNode node)
{
foreach (TreeNode childNode in node.Nodes)
{
if (childNode.Checked || AnyChildNodeChecked_DelAnn(childNode))
return true;
}
return false;
}
private ProgressBarItem _ProgressBar = null;
public ProgressBarItem ProgressBar
@@ -1246,6 +1429,24 @@ namespace VEPROMS
this.Close();
}
// new Admin Tools user interface for deletes
private void sideNavItmDelete_Click(object sender, EventArgs e)
{
AdminToolType = E_AdminToolType.Delete;
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 +1455,8 @@ namespace VEPROMS
Check = 0,
Repair = 1,
Links = 2,
Users = 3
Users = 3,
Delete = 4
};
private E_AdminToolType AdminToolType = 0;
@@ -1305,6 +1507,23 @@ namespace VEPROMS
splitContainer3.Panel2Collapsed = true;
progressSteps1.Visible = false;
break;
case E_AdminToolType.Delete:
if (swDeleteFolder.Value)
{
splitContainer3.Panel2Collapsed = false;
progressSteps1.Items.Add(siOrphDatRecs);
lblAdmToolProgressType.Text = "Repairing: ";
progressSteps1.Visible = true;
progressSteps1.Refresh();
}
else
{
lblAdmToolProgressType.Text = "";
splitContainer3.Panel2Collapsed = true;
progressSteps1.Visible = false;
}
break;
}
}
@@ -1500,5 +1719,171 @@ namespace VEPROMS
}
}
//C2024-005 Delete Annotations, Delete Folders
private void swDeleteAnnotations_ValueChanged(object sender, EventArgs e)
{
setupProgessSteps1();
swDeleteFolder.Value = !swDeleteAnnotations.Value;
if (swDeleteFolder.Value)
ResetDelTV(true);
else
ResetDelTV(false);
}
private void swDeleteFolder_ValueChanged(object sender, EventArgs e)
{
setupProgessSteps1();
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)
{
if (FlexibleMessageBox.Show(this, "You sure you want to remove the selected folders and their contents?", "Confirm Folder Deletion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
txtProcess.AppendText("Deleting Folders...");
//Load Selected Folders with docversions
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
foreach (TreeNode tn in myDocVersions.Keys)
if (tn.Checked)
dvil.Add(myDocVersions[tn]);
//Load Selected Folders with docversions
List<FolderInfo> ef = new List<FolderInfo>();
foreach (TreeNode tn in myFolders.Keys)
if (tn.Checked)
ef.Add(myFolders[tn]);
ProcessDelete(dvil, ef);
}
}
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, List<FolderInfo> emptyFoldersToDelete)
{
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)
{
//Gather folder information
FolderInfo fi = (FolderInfo)kvp.ActiveParent;
int itemID = (int)fi.FolderID;
string folderName = fi.Name;
// Perform the deletion operation
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);
}
//Delete non working info folders.
foreach (var kvp in emptyFoldersToDelete)
{
//Gather folder information
FolderInfo fi = (FolderInfo)kvp;
int itemID = (int)fi.FolderID;
string folderName = fi.Name;
// Perform the deletion operation
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);
}
//Run Repair
int prgStpIdx = -1;
StepProgress(++prgStpIdx, 50);
PurgeDisconnectedItems(); // Orphan Items
StepProgress(prgStpIdx, 100);
//rebuild
ResetDelTV(true);
MessageBox.Show("Folder Deletion Completed", "Delete Folders");
ClearStepProgress();
}
private bool DeleteFolderByID(int folderID)
{
try
{
//Delete
Folder.DeleteFolderAdmin(folderID);
//update treeview UI via veProms
_veProms.tv_FolderDelete(folderID);
return true;
}
catch
{
return false;
}
}
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;
}
}
}

View File

@@ -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 will allow for the deletion of groups of annotations and allow for deleting entire folders within PROMS. Use the tree nodes to select which items to delete.
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.
Click on the on/off switches to turn on/off each tool.
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>
Note that only one of these tools can be run at a time.</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
@@ -271,6 +241,71 @@ If more than one procedure is selected, it is recommended that this be performed
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">
<value>When Word attachments are modified and saved, PROMS will create a PDF of the attachment contents and save it in the database. When this is done, all the of the RO references are resolved as well as pagination of the attachment. This speeds up the overall printing of the procedure in that PROMS simply inserts the attachment contents.
@@ -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>

View File

@@ -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
}
}

View File

@@ -216,6 +216,8 @@ namespace VEPROMS
set { _MyDocVersion = value; }
}
// C2015-022 setup the child PROMS window
public frmVEPROMS(frmVEPROMS myParent, DocVersionInfo myDocVersion)
{
@@ -254,6 +256,22 @@ namespace VEPROMS
tc.RefreshItem(myItemInfo);
}
public void tv_FolderDelete(int folderId)
{
// Create an instance of the event args if needed
var args = new vlnTreeFolderDeleteEventArgs(folderId);
// Trigger the deletion using the event arguments
tv.RemoveFolder(args.FolderId);
}
private bool Tv_DeleteFolder(object sender, vlnTreeFolderDeleteEventArgs args)
{
tv.RemoveFolder(args.FolderId);
return true;
}
private E_UCFImportOptions _UCFImportOptionsFromSettings;
public frmVEPROMS()
@@ -475,6 +493,7 @@ namespace VEPROMS
tv.OpenItem += new vlnTreeViewItemInfoEvent(tv_OpenItem);
tv.TabDisplay += new StepPanelTabDisplayEvent(tc_PanelTabDisplay);
tv.DeleteItemInfo += new vlnTreeViewItemInfoDeleteEvent(tv_DeleteItemInfo);
tv.DeleteFolder += new vlnTreeViewItemInfoDeleteFolderEvent(Tv_DeleteFolder);
tv.InsertItemInfo += new vlnTreeViewItemInfoInsertEvent(tv_InsertItemInfo);
tv.NodeInsert += new vlnTreeViewEvent(tv_NodeInsert);
tv.PasteItemInfo += new vlnTreeViewItemInfoPasteEvent(tv_PasteItemInfo);
@@ -1603,6 +1622,11 @@ namespace VEPROMS
return rtval;
}
private bool tv_DeleteFolder(object sender, vlnTreeItemInfoEventArgs args)
{
return true;
}
private bool tv_PasteItemInfo(object sender, vlnTreeItemInfoPasteEventArgs args)
{
return tc.PasteRTBItem(args.MyItemInfo, args.CopyStartID, args.PasteType, (int)args.Type);
@@ -2741,7 +2765,7 @@ namespace VEPROMS
void btnAdministrativeTools_Click(object sender, EventArgs e)
{
frmBatchRefresh frm = new frmBatchRefresh(MySessionInfo);
frmBatchRefresh frm = new frmBatchRefresh(MySessionInfo, this);
frm.ProgressBar = bottomProgBar;
frm.ShowDialog(this);
}

View File

@@ -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;
}
//public partial class AnnotationTypeAnnotations
//{
// public static int GetAnnotationID()
// {
// return AnnotationTypeAnnotat
// }
//}
}
[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);
}
}
}
}

View File

@@ -1433,6 +1433,31 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Folder.Remove", ex);
}
}
[Transactional(TransactionalTypes.TransactionScope)]
public static void DeleteFolderAdmin(int folderID)
{
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.Remove", 0);
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteFolderAdmin";
cm.Parameters.AddWithValue("@FolderID", folderID);
cm.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.Remove", ex);
throw new DbCslaException("Folder.Remove", ex);
}
}
#endregion
#region Exists
public static bool Exists(int folderID)
@@ -1536,6 +1561,8 @@ namespace VEPROMS.CSLA.Library
// Needs to be overriden to add new validation rules
}
}
#endregion
} // Class
#region Converter

View File

@@ -167,6 +167,8 @@ namespace VEPROMS.CSLA.Library
tn.ResetNode("Dummy GetFolder");
return tn;
}
// public abstract void LoadChildren();
//private long _Start;
//private Dictionary<string, long> _Timings=new Dictionary<string,long>();

View File

@@ -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));
}
}
}

View File

@@ -669,7 +669,7 @@ namespace Volian.Controls.Library
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
string key = "Item - " + proc.ItemID.ToString();
if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it
if (_MyDisplayTabItems.ContainsKey(key) && pasteType != ItemInfo.EAddpingPart.Replace) // If procedure page open use it unless replace
{
DisplayTabItem pg = _MyDisplayTabItems[key];
if (pg.MyStepTabPanel.MyStepPanel._LookupEditItems.ContainsKey(myItemInfo.ItemID) &&
@@ -708,6 +708,11 @@ namespace Volian.Controls.Library
return true;
}
}
else if (_MyDisplayTabItems.ContainsKey(key) && pasteType == ItemInfo.EAddpingPart.Replace)
{
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;
}

View File

@@ -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 = 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;

View File

@@ -26,6 +26,7 @@ namespace Volian.Controls.Library
public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args);
public delegate bool vlnTreeViewBoolEvent(object sender, vlnTreeEventArgs args);
public delegate bool vlnTreeViewItemInfoDeleteEvent(object sender, vlnTreeItemInfoEventArgs args);
public delegate bool vlnTreeViewItemInfoDeleteFolderEvent(object sender, vlnTreeFolderDeleteEventArgs args);
public delegate bool vlnTreeViewItemInfoInsertEvent(object sender, vlnTreeItemInfoInsertEventArgs args);
public delegate bool vlnTreeViewItemInfoPasteEvent(object sender, vlnTreeItemInfoPasteEventArgs args);
public delegate TreeNode vlnTreeViewTreeNodeEvent(object sender, vlnTreeEventArgs args);
@@ -220,6 +221,15 @@ namespace Volian.Controls.Library
}
#endregion
}
public class vlnTreeFolderDeleteEventArgs : EventArgs
{
public int FolderId { get; }
public vlnTreeFolderDeleteEventArgs(int folderId)
{
FolderId = folderId;
}
}
public enum E_InsertType {Before, After, Child};
public partial class vlnTreeItemInfoInsertEventArgs
{
@@ -427,6 +437,12 @@ namespace Volian.Controls.Library
if (DeleteItemInfo != null) return DeleteItemInfo(sender, args);
return false;
}
public event vlnTreeViewItemInfoDeleteFolderEvent DeleteFolder;
private bool OnDeleteFolder(object sender, vlnTreeFolderDeleteEventArgs args)
{
if (DeleteItemInfo != null) return DeleteFolder(sender, args);
return false;
}
public event vlnTreeViewItemInfoInsertEvent InsertItemInfo;
private bool OnInsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args)
{
@@ -3567,6 +3583,41 @@ namespace Volian.Controls.Library
}
return false;
}
public void RemoveFolder(int folderId)
{
TreeNode nodeToRemove = FindNodeById(folderId, this.Nodes);
if (nodeToRemove != null)
{
// Perform the removal logic
nodeToRemove.Remove(); // This removes the node from its parent
}
}
private TreeNode FindNodeById(int folderId, TreeNodeCollection nodes)
{
foreach (TreeNode node in nodes)
{
VETreeNode vetNode = node as VETreeNode;
if (vetNode != null)
{
FolderInfo folderInfo = vetNode.VEObject as FolderInfo;
if (folderInfo != null && folderInfo.FolderID == folderId)
{
return node;
}
else
{
TreeNode foundNode = FindNodeById(folderId, node.Nodes);
if (foundNode != null)
{
return foundNode;
}
}
}
}
return null;
}
private bool DeleteItemInfoAndChildren(ItemInfo ii)
{
DateTime dtStart = DateTime.Now;