Compare commits
49 Commits
3ec7c11797
...
7713f0cd63
Author | SHA1 | Date | |
---|---|---|---|
7713f0cd63 | |||
2711520666 | |||
4a6c0ba447 | |||
3f3281e2f4 | |||
0eadd3fe33 | |||
4bf42be80a | |||
d7f829737a | |||
25cc62c7c6 | |||
47596c7bca | |||
7129853902 | |||
f08466f702 | |||
4248d40917 | |||
7cf28366f4 | |||
037c82e22e | |||
6de13b12f9 | |||
cf69aa93e6 | |||
4b915b78b6 | |||
a891a62ffa | |||
7a768484a1 | |||
5f7af3309d | |||
1f3a1dabbc | |||
4b61495960 | |||
d091a37171 | |||
189b78d7d3 | |||
8ee7a31b97 | |||
055be66421 | |||
86a3e56a27 | |||
0db98e4182 | |||
3102596a3d | |||
41aa195785 | |||
954186265e | |||
33cced07c6 | |||
afbf6f360d | |||
df2be585a1 | |||
c81f527cb8 | |||
0f67382c27 | |||
b42b8ddfa3 | |||
f3efd409c6 | |||
9011b134d6 | |||
7c33bad362 | |||
e49a4d674f | |||
7872f192ed | |||
870bba0aa6 | |||
35c7b2b0cf | |||
9e6c8acca4 | |||
099bbdd328 | |||
720c5db2d0 | |||
659833c5bf | |||
5ea9bcdd8b |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -97,12 +97,12 @@ namespace VEPROMS
|
|||||||
this.expandableSplitter1 = new DevComponents.DotNetBar.ExpandableSplitter();
|
this.expandableSplitter1 = new DevComponents.DotNetBar.ExpandableSplitter();
|
||||||
this.panelEx2 = new DevComponents.DotNetBar.PanelEx();
|
this.panelEx2 = new DevComponents.DotNetBar.PanelEx();
|
||||||
this.groupPag = new DevComponents.DotNetBar.Controls.GroupPanel();
|
this.groupPag = new DevComponents.DotNetBar.Controls.GroupPanel();
|
||||||
|
this.cbxGenerateTimeCritActSum = new System.Windows.Forms.CheckBox();
|
||||||
this.expPrnSetting = new DevComponents.DotNetBar.ExpandablePanel();
|
this.expPrnSetting = new DevComponents.DotNetBar.ExpandablePanel();
|
||||||
this.ppGpDuplex = new DevComponents.DotNetBar.Controls.GroupPanel();
|
this.ppGpDuplex = new DevComponents.DotNetBar.Controls.GroupPanel();
|
||||||
this.tbBlankPage = new DevComponents.DotNetBar.Controls.TextBoxX();
|
this.tbBlankPage = new DevComponents.DotNetBar.Controls.TextBoxX();
|
||||||
this.lblBlPg = new DevComponents.DotNetBar.LabelX();
|
this.lblBlPg = new DevComponents.DotNetBar.LabelX();
|
||||||
this.swtbtnPDFdtPrefixSuffix = new DevComponents.DotNetBar.Controls.SwitchButton();
|
this.swtbtnPDFdtPrefixSuffix = new DevComponents.DotNetBar.Controls.SwitchButton();
|
||||||
this.cbxGenerateTimeCritActSum = new System.Windows.Forms.CheckBox();
|
|
||||||
this.gpnlDebug.SuspendLayout();
|
this.gpnlDebug.SuspendLayout();
|
||||||
this.grpDateSelector.SuspendLayout();
|
this.grpDateSelector.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.docVersionConfigBindingSource)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.docVersionConfigBindingSource)).BeginInit();
|
||||||
@ -1285,6 +1285,23 @@ namespace VEPROMS
|
|||||||
this.groupPag.TabIndex = 111;
|
this.groupPag.TabIndex = 111;
|
||||||
this.groupPag.Text = "Print using standard PROMS pagination rules by:";
|
this.groupPag.Text = "Print using standard PROMS pagination rules by:";
|
||||||
//
|
//
|
||||||
|
// cbxGenerateTimeCritActSum
|
||||||
|
//
|
||||||
|
this.cbxGenerateTimeCritActSum.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.cbxGenerateTimeCritActSum.AutoSize = true;
|
||||||
|
this.cbxGenerateTimeCritActSum.BackColor = System.Drawing.Color.Transparent;
|
||||||
|
this.cbxGenerateTimeCritActSum.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.cbxGenerateTimeCritActSum.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||||
|
this.cbxGenerateTimeCritActSum.Location = new System.Drawing.Point(240, 273);
|
||||||
|
this.cbxGenerateTimeCritActSum.Margin = new System.Windows.Forms.Padding(2);
|
||||||
|
this.cbxGenerateTimeCritActSum.Name = "cbxGenerateTimeCritActSum";
|
||||||
|
this.cbxGenerateTimeCritActSum.Size = new System.Drawing.Size(294, 17);
|
||||||
|
this.cbxGenerateTimeCritActSum.TabIndex = 102;
|
||||||
|
this.cbxGenerateTimeCritActSum.Text = "Generate Time Critical Action Summary (hidden but used)";
|
||||||
|
this.cbxGenerateTimeCritActSum.UseVisualStyleBackColor = false;
|
||||||
|
this.cbxGenerateTimeCritActSum.Visible = false;
|
||||||
|
//
|
||||||
// expPrnSetting
|
// expPrnSetting
|
||||||
//
|
//
|
||||||
this.expPrnSetting.CanvasColor = System.Drawing.SystemColors.Control;
|
this.expPrnSetting.CanvasColor = System.Drawing.SystemColors.Control;
|
||||||
@ -1421,23 +1438,6 @@ namespace VEPROMS
|
|||||||
this.swtbtnPDFdtPrefixSuffix.TabIndex = 111;
|
this.swtbtnPDFdtPrefixSuffix.TabIndex = 111;
|
||||||
this.swtbtnPDFdtPrefixSuffix.ValueChanged += new System.EventHandler(this.swtbtnPDFdtPrefixSuffix_ValueChanged);
|
this.swtbtnPDFdtPrefixSuffix.ValueChanged += new System.EventHandler(this.swtbtnPDFdtPrefixSuffix_ValueChanged);
|
||||||
//
|
//
|
||||||
// cbxGenerateTimeCritActSum
|
|
||||||
//
|
|
||||||
this.cbxGenerateTimeCritActSum.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.cbxGenerateTimeCritActSum.AutoSize = true;
|
|
||||||
this.cbxGenerateTimeCritActSum.BackColor = System.Drawing.Color.Transparent;
|
|
||||||
this.cbxGenerateTimeCritActSum.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
|
||||||
this.cbxGenerateTimeCritActSum.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
||||||
this.cbxGenerateTimeCritActSum.Location = new System.Drawing.Point(240, 273);
|
|
||||||
this.cbxGenerateTimeCritActSum.Margin = new System.Windows.Forms.Padding(2);
|
|
||||||
this.cbxGenerateTimeCritActSum.Name = "cbxGenerateTimeCritActSum";
|
|
||||||
this.cbxGenerateTimeCritActSum.Size = new System.Drawing.Size(294, 17);
|
|
||||||
this.cbxGenerateTimeCritActSum.TabIndex = 102;
|
|
||||||
this.cbxGenerateTimeCritActSum.Text = "Generate Time Critical Action Summary (hidden but used)";
|
|
||||||
this.cbxGenerateTimeCritActSum.UseVisualStyleBackColor = false;
|
|
||||||
this.cbxGenerateTimeCritActSum.Visible = false;
|
|
||||||
//
|
|
||||||
// DlgPrintProcedure
|
// DlgPrintProcedure
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
@ -1096,6 +1096,15 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
private void btnCreatePDF_Click(object sender, EventArgs e)
|
private void btnCreatePDF_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
// B2024-058 Add validation for Revision Date field of the Print dialog
|
||||||
|
if (txbRevDate.Visible)
|
||||||
|
{
|
||||||
|
if (!validateDate(txbRevDate))
|
||||||
|
{
|
||||||
|
//txbRevDate.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
DoCreatePDF();
|
DoCreatePDF();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1193,16 +1202,42 @@ namespace VEPROMS
|
|||||||
if (_Initializing) return;
|
if (_Initializing) return;
|
||||||
ppGpbxUserSpecTxt.Enabled = ppCmbxChgBarTxtType.SelectedIndex == (int)PrintChangeBarText.UserDef;
|
ppGpbxUserSpecTxt.Enabled = ppCmbxChgBarTxtType.SelectedIndex == (int)PrintChangeBarText.UserDef;
|
||||||
}
|
}
|
||||||
|
// B2024-058 Add validation for Revision Date field of the Print dialog
|
||||||
|
private bool validateDate(TextBox txtDate)
|
||||||
|
{
|
||||||
|
DateTime dDate;
|
||||||
|
if (DateTime.TryParse(txtDate.Text, out dDate))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string txtDate2 = txtDate.Text;
|
||||||
|
string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate2);
|
||||||
|
string txtTitle = "Invalid Format";
|
||||||
|
MessageBox.Show(message, txtTitle);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void txbRevDate_Enter(object sender, EventArgs e)
|
private void txbRevDate_Enter(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
txbDate = txbRevDate;
|
txbDate = txbRevDate;
|
||||||
grpDateSelector.Text = "Select Revision Date";
|
grpDateSelector.Text = "Select Revision Date";
|
||||||
grpDateSelector.Visible = calDateSelector.Visible = true;
|
grpDateSelector.Visible = calDateSelector.Visible = true;
|
||||||
//C2021-007 position the calendar to the current RevDate or if no RevDate, position to today's date
|
//C2021-007 position the calendar to the current RevDate or if no RevDate, position to today's date
|
||||||
DateTime initSelDate =(txbDate.Text != null && txbDate.Text.Length != 0)? Convert.ToDateTime(txbDate.Text) : DateTime.Today;
|
DateTime dDate;
|
||||||
|
// B2024-058 Add validation for Revision Date field of the Print dialog
|
||||||
|
if (!validateDate(txbDate))
|
||||||
|
{
|
||||||
|
txbRevDate.Focus();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DateTime initSelDate = (txbDate.Text != null && txbDate.Text.Length != 0) ? Convert.ToDateTime(txbDate.Text) : DateTime.Today;
|
||||||
calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate;
|
calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
private void txbRevDate_Leave(object sender, EventArgs e)
|
private void txbRevDate_Leave(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_Initializing) return;
|
if (_Initializing) return;
|
||||||
@ -1375,6 +1410,7 @@ namespace VEPROMS
|
|||||||
_NewRevForAllProcs = null;
|
_NewRevForAllProcs = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//private void cbxDebug_CheckedChanged(object sender, EventArgs e)
|
//private void cbxDebug_CheckedChanged(object sender, EventArgs e)
|
||||||
//{
|
//{
|
||||||
// cbxCmpPRMSpfd.Visible = cbxDebug.Checked;
|
// cbxCmpPRMSpfd.Visible = cbxDebug.Checked;
|
||||||
|
@ -23519,6 +23519,90 @@ GO
|
|||||||
==========================================================================================================
|
==========================================================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
==========================================================================================================
|
||||||
|
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 |
|
| ADD New Code Before this Block |
|
||||||
@ -23552,8 +23636,8 @@ BEGIN TRY -- Try Block
|
|||||||
DECLARE @RevDate varchar(255)
|
DECLARE @RevDate varchar(255)
|
||||||
DECLARE @RevDescription varchar(255)
|
DECLARE @RevDescription varchar(255)
|
||||||
|
|
||||||
set @RevDate = '07/18/2024 11:24'
|
set @RevDate = '07/29/2024 11:24'
|
||||||
set @RevDescription = 'C2024-005 Add an Admin tool that can delete a group of annotations.'
|
set @RevDescription = 'C2021-059 Add SQL for Admin tool delete folders.'
|
||||||
|
|
||||||
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
|
Select cast(@RevDate as datetime) RevDate, @RevDescription RevDescription
|
||||||
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
|
PRINT 'SQL Code Revision ' + @RevDate + ' - ' + @RevDescription
|
||||||
|
@ -22,6 +22,8 @@ namespace VEPROMS
|
|||||||
string procList = "";
|
string procList = "";
|
||||||
string docvList = "";
|
string docvList = "";
|
||||||
int AnnotationTyp;
|
int AnnotationTyp;
|
||||||
|
string AnnotationName = "";
|
||||||
|
string totalDeleteCnt = "";
|
||||||
List<ProcedureInfo> pil2 = new List<ProcedureInfo>();
|
List<ProcedureInfo> pil2 = new List<ProcedureInfo>();
|
||||||
List<DocVersionInfo> dvil2 = new List<DocVersionInfo>();
|
List<DocVersionInfo> dvil2 = new List<DocVersionInfo>();
|
||||||
private frmBatchRefresh mainForm = null;
|
private frmBatchRefresh mainForm = null;
|
||||||
@ -52,6 +54,7 @@ namespace VEPROMS
|
|||||||
lbAnnotationTypes.DisplayMember = "Value";
|
lbAnnotationTypes.DisplayMember = "Value";
|
||||||
lbAnnotationTypes.ValueMember = "Key";
|
lbAnnotationTypes.ValueMember = "Key";
|
||||||
lbAnnotationTypes.SelectedIndexChanged += lbAnnotationTypes_SelectedIndexChanged;
|
lbAnnotationTypes.SelectedIndexChanged += lbAnnotationTypes_SelectedIndexChanged;
|
||||||
|
lbAnnotationTypes.ClearSelected();
|
||||||
|
|
||||||
}
|
}
|
||||||
// create comma delimited string of procedures selected by user.
|
// create comma delimited string of procedures selected by user.
|
||||||
@ -102,13 +105,28 @@ namespace VEPROMS
|
|||||||
// Process used to cleanup annotations "(Proceed?" button)
|
// Process used to cleanup annotations "(Proceed?" button)
|
||||||
private void button1_Click(object sender, EventArgs e)
|
private void button1_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (lbAnnotationTypes.SelectedIndex > -1)
|
||||||
|
{
|
||||||
|
|
||||||
|
TextBox frm2 = mainForm.GettxtProcess();
|
||||||
|
TextBox frm3 = mainForm.GettxtResults();
|
||||||
|
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||||
|
AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
||||||
|
frm3.AppendText("Deleting Annotations: Annotation Type: " + '"' + AnnotationName + '"');
|
||||||
|
frm3.AppendText(Environment.NewLine + "P = Procedure, F = Folder" + Environment.NewLine);
|
||||||
|
int deletecountProc = 0;
|
||||||
|
int deletecountDocv = 0;
|
||||||
foreach (var p in pil2)
|
foreach (var p in pil2)
|
||||||
{
|
{
|
||||||
if (p.IsProcedure)
|
if (p.IsProcedure)
|
||||||
{
|
{
|
||||||
TextBox frm2 = mainForm.GettxtProcess();
|
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||||
frm2.AppendText(p.DisplayNumber + ' ' + p.DisplayText);
|
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
||||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
//deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, getAnnotationProcItems(p));
|
||||||
|
deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, p.ItemID.ToString());
|
||||||
|
frm2.AppendText(Environment.NewLine + p.DisplayNumber + ' ' + p.DisplayText);
|
||||||
|
//frm3.AppendText(Environment.NewLine + "P: " + p.DisplayNumber + '"' + p.DisplayText + '"' + " Type: " + '"' + AnnotationName + '"' + " count: " + deletecountProc);
|
||||||
|
frm3.AppendText(Environment.NewLine + "P: " + p.DisplayNumber + '"' + p.DisplayText + '"' + " Delete count: " + deletecountProc);
|
||||||
Annotation.DeleteAnnotationProcByType(AnnotationTyp, p.ItemID.ToString());
|
Annotation.DeleteAnnotationProcByType(AnnotationTyp, p.ItemID.ToString());
|
||||||
lblCountNumber.Text = "0";
|
lblCountNumber.Text = "0";
|
||||||
}
|
}
|
||||||
@ -118,16 +136,26 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
if (d.IsDocVersion)
|
if (d.IsDocVersion)
|
||||||
{
|
{
|
||||||
TextBox frm2 = mainForm.GettxtProcess();
|
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||||
frm2.AppendText(d.ActiveParent.ToString());
|
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
||||||
|
deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, d.VersionID.ToString());
|
||||||
|
frm2.AppendText(Environment.NewLine + d.ActiveParent.ToString());
|
||||||
|
frm3.AppendText(Environment.NewLine + "F: " + '"' + d.ActiveParent.ToString() + '"' + " Delete count: " + deletecountDocv);
|
||||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||||
Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString());
|
Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString());
|
||||||
|
|
||||||
lblCountNumber.Text = "0";
|
lblCountNumber.Text = "0";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
frm3.AppendText(Environment.NewLine + Environment.NewLine + "Total Annotations Deleted: " + totalDeleteCnt + Environment.NewLine + Environment.NewLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Retrieve number of annotations that will be deleted.
|
// Retrieve number of annotations that will be deleted.
|
||||||
private void lbAnnotationTypes_SelectedIndexChanged(object sender, EventArgs e)
|
private void lbAnnotationTypes_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (lbAnnotationTypes.SelectedIndex > -1)
|
||||||
{
|
{
|
||||||
btnClean.Enabled = false;
|
btnClean.Enabled = false;
|
||||||
lblCountNumber.Text = "";
|
lblCountNumber.Text = "";
|
||||||
@ -145,7 +173,9 @@ namespace VEPROMS
|
|||||||
deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, getAnnotationDocvItems(dvil2));
|
deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, getAnnotationDocvItems(dvil2));
|
||||||
}
|
}
|
||||||
lblCountNumber.Text = (deletecountProc + deletecountDocv).ToString();
|
lblCountNumber.Text = (deletecountProc + deletecountDocv).ToString();
|
||||||
|
totalDeleteCnt = (deletecountProc + deletecountDocv).ToString();
|
||||||
btnClean.Enabled = true;
|
btnClean.Enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// Close form.
|
// Close form.
|
||||||
@ -156,3 +186,5 @@ namespace VEPROMS
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
424
PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs
generated
424
PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,7 @@ using System.IO;
|
|||||||
using Volian.Controls.Library;
|
using Volian.Controls.Library;
|
||||||
using DevComponents.DotNetBar;
|
using DevComponents.DotNetBar;
|
||||||
using JR.Utils.GUI.Forms;
|
using JR.Utils.GUI.Forms;
|
||||||
|
using Volian.Controls.Library;
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
{
|
{
|
||||||
@ -24,11 +25,17 @@ namespace VEPROMS
|
|||||||
private bool IsAdministratorUser = false; //C2020-035 used to control what Set Amins can do
|
private bool IsAdministratorUser = false; //C2020-035 used to control what Set Amins can do
|
||||||
// C2017-030 - new Admin Tools user interface
|
// C2017-030 - new Admin Tools user interface
|
||||||
// pass in session info to constructor
|
// pass in session info to constructor
|
||||||
public frmBatchRefresh(SessionInfo sessionInfo)
|
|
||||||
|
private frmVEPROMS _veProms;
|
||||||
|
|
||||||
|
public frmBatchRefresh(SessionInfo sessionInfo, frmVEPROMS veProms)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_MySessionInfo = sessionInfo;
|
_MySessionInfo = sessionInfo;
|
||||||
|
|
||||||
|
_veProms = veProms;
|
||||||
|
|
||||||
|
|
||||||
// When opening Admin tools Check tab will be default.
|
// When opening Admin tools Check tab will be default.
|
||||||
this.sideNavItmCheck.Checked = true;
|
this.sideNavItmCheck.Checked = true;
|
||||||
|
|
||||||
@ -36,7 +43,10 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
AdminToolType = (E_AdminToolType)4;
|
AdminToolType = (E_AdminToolType)4;
|
||||||
if (swDeleteFolder.Value)
|
if (swDeleteFolder.Value)
|
||||||
|
{
|
||||||
ResetDelTV(true);
|
ResetDelTV(true);
|
||||||
|
setupProgessSteps1();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ResetDelTV(false);
|
ResetDelTV(false);
|
||||||
}
|
}
|
||||||
@ -61,6 +71,13 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
return txtProcess;
|
return txtProcess;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make txtResults text box available to frmAnnotationsClean form.
|
||||||
|
internal TextBox GettxtResults()
|
||||||
|
{
|
||||||
|
return txtResults;
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE: removed the Refresh ROs and Refresh Transitions and ROs options (now only Transitions can be refreshed)
|
// 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
|
// 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
|
// also annotations will be placed on step elements that have RO changes
|
||||||
@ -94,6 +111,8 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private Dictionary<TreeNode, ProcedureInfo> myProcedures = new Dictionary<TreeNode, ProcedureInfo>();
|
private Dictionary<TreeNode, ProcedureInfo> myProcedures = new Dictionary<TreeNode, ProcedureInfo>();
|
||||||
private Dictionary<TreeNode, DocVersionInfo> myDocVersions = new Dictionary<TreeNode, DocVersionInfo>();
|
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)
|
private void frmBatchRefresh_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||||
@ -136,6 +155,7 @@ namespace VEPROMS
|
|||||||
//myTreeNodePath = new List<string>();
|
//myTreeNodePath = new List<string>();
|
||||||
myTV.Nodes.Clear();
|
myTV.Nodes.Clear();
|
||||||
myDocVersions.Clear();
|
myDocVersions.Clear();
|
||||||
|
myFolders.Clear();
|
||||||
FolderInfo fi = FolderInfo.GetTop();
|
FolderInfo fi = FolderInfo.GetTop();
|
||||||
TreeNode tn = myTV.Nodes.Add(fi.Name);
|
TreeNode tn = myTV.Nodes.Add(fi.Name);
|
||||||
tn.Tag = fi;
|
tn.Tag = fi;
|
||||||
@ -158,12 +178,6 @@ namespace VEPROMS
|
|||||||
FolderInfo fi = FolderInfo.GetTop();
|
FolderInfo fi = FolderInfo.GetTop();
|
||||||
|
|
||||||
if (fi.ChildFolderCount > 0)
|
if (fi.ChildFolderCount > 0)
|
||||||
{
|
|
||||||
if (noProcs)
|
|
||||||
{
|
|
||||||
LoadBottomLevelFolders(fi, myTVdel);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
TreeNode tn = new TreeNode(fi.Name);
|
TreeNode tn = new TreeNode(fi.Name);
|
||||||
tn.Tag = fi;
|
tn.Tag = fi;
|
||||||
@ -171,32 +185,15 @@ namespace VEPROMS
|
|||||||
LoadChildFolders(fi, tn, noProcs);
|
LoadChildFolders(fi, tn, noProcs);
|
||||||
myTVdel.Nodes.Add(tn);
|
myTVdel.Nodes.Add(tn);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (myTVdel.SelectedNode != null)
|
if (myTVdel.SelectedNode != null)
|
||||||
myTVdel.SelectedNode.Expand();
|
myTVdel.SelectedNode.Expand();
|
||||||
this.Cursor = Cursors.Default;
|
|
||||||
|
|
||||||
//btnFixLinks.Enabled = false;
|
//Expand if folders
|
||||||
//this.Cursor = Cursors.WaitCursor;
|
if (noProcs)
|
||||||
////myTreeNodePath = new List<string>();
|
myTVdel.ExpandAll();
|
||||||
//myTVdel.Nodes.Clear();
|
|
||||||
//myDocVersions.Clear();
|
this.Cursor = Cursors.Default;
|
||||||
//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
|
// B2021-060 Higher level folders where being removed from the tree even if there was a child folder that containe a working draft set
|
||||||
@ -208,10 +205,13 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
TreeNode tnc = tn.Nodes.Add(fic.Name);
|
TreeNode tnc = tn.Nodes.Add(fic.Name);
|
||||||
tnc.Tag = fic;
|
tnc.Tag = fic;
|
||||||
|
|
||||||
if (fic.ChildFolderCount > 0)
|
if (fic.ChildFolderCount > 0)
|
||||||
|
{
|
||||||
if (LoadChildFolders(fic, tnc, noProcs))
|
if (LoadChildFolders(fic, tnc, noProcs))
|
||||||
loadedChildWorkingDraft = true;
|
loadedChildWorkingDraft = true;
|
||||||
// B2020-114 and C2020-035 only show folders the Set Admin can access
|
}
|
||||||
|
|
||||||
if (fic.FolderDocVersionCount > 0)
|
if (fic.FolderDocVersionCount > 0)
|
||||||
{
|
{
|
||||||
if (!LoadDocVersions(fic, tnc, noProcs))
|
if (!LoadDocVersions(fic, tnc, noProcs))
|
||||||
@ -219,40 +219,27 @@ namespace VEPROMS
|
|||||||
else
|
else
|
||||||
loadedWorkingDraft = true;
|
loadedWorkingDraft = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (loadedChildWorkingDraft) loadedWorkingDraft = true; // B2021-060 if child folder working draft loaded set loadedWorkingDraft
|
|
||||||
if (tn.Parent != null && !loadedWorkingDraft)
|
|
||||||
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
|
else
|
||||||
{
|
{
|
||||||
if (fic.Name != "PROMS")
|
// 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;
|
||||||
|
}
|
||||||
|
|
||||||
// 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)
|
private bool LoadDocVersions(FolderInfo fic, TreeNode tnc, bool noProcs)
|
||||||
{
|
{
|
||||||
bool rtnval = false;
|
bool rtnval = false;
|
||||||
@ -1269,6 +1256,76 @@ 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;
|
private ProgressBarItem _ProgressBar = null;
|
||||||
|
|
||||||
@ -1459,8 +1516,20 @@ namespace VEPROMS
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case E_AdminToolType.Delete:
|
case E_AdminToolType.Delete:
|
||||||
|
if (swDeleteFolder.Value)
|
||||||
|
{
|
||||||
|
splitContainer3.Panel2Collapsed = false;
|
||||||
|
progressSteps1.Items.Add(siOrphDatRecs);
|
||||||
|
lblAdmToolProgressType.Text = "Deleting: ";
|
||||||
|
progressSteps1.Visible = true;
|
||||||
|
progressSteps1.Refresh();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblAdmToolProgressType.Text = "";
|
||||||
splitContainer3.Panel2Collapsed = true;
|
splitContainer3.Panel2Collapsed = true;
|
||||||
progressSteps1.Visible = false;
|
progressSteps1.Visible = false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1662,6 +1731,7 @@ namespace VEPROMS
|
|||||||
//C2024-005 Delete Annotations, Delete Folders
|
//C2024-005 Delete Annotations, Delete Folders
|
||||||
private void swDeleteAnnotations_ValueChanged(object sender, EventArgs e)
|
private void swDeleteAnnotations_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
setupProgessSteps1();
|
||||||
swDeleteFolder.Value = !swDeleteAnnotations.Value;
|
swDeleteFolder.Value = !swDeleteAnnotations.Value;
|
||||||
if (swDeleteFolder.Value)
|
if (swDeleteFolder.Value)
|
||||||
ResetDelTV(true);
|
ResetDelTV(true);
|
||||||
@ -1671,6 +1741,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private void swDeleteFolder_ValueChanged(object sender, EventArgs e)
|
private void swDeleteFolder_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
setupProgessSteps1();
|
||||||
swDeleteAnnotations.Value = !swDeleteFolder.Value;
|
swDeleteAnnotations.Value = !swDeleteFolder.Value;
|
||||||
if (swDeleteFolder.Value)
|
if (swDeleteFolder.Value)
|
||||||
ResetDelTV(true);
|
ResetDelTV(true);
|
||||||
@ -1684,68 +1755,105 @@ namespace VEPROMS
|
|||||||
txtResults.Clear();
|
txtResults.Clear();
|
||||||
txtProcess.Clear();
|
txtProcess.Clear();
|
||||||
|
|
||||||
|
this.Cursor = Cursors.WaitCursor;
|
||||||
|
|
||||||
if (swDeleteFolder.Value)
|
//Create checked proce and doc info lists.
|
||||||
{
|
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
||||||
//TODO process deletions of folders
|
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
|
||||||
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
|
// Create a list of procedures the user selected
|
||||||
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
|
||||||
foreach (TreeNode tn in myProcedures.Keys)
|
foreach (TreeNode tn in myProcedures.Keys)
|
||||||
if (tn.Checked)
|
if (tn.Checked)
|
||||||
pil.Add(myProcedures[tn]);
|
pil.Add(myProcedures[tn]);
|
||||||
|
|
||||||
// Create a list of doc versions the user selected
|
// Create a list of doc versions the user selected
|
||||||
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
|
|
||||||
foreach (TreeNode tn in myDocVersions.Keys)
|
foreach (TreeNode tn in myDocVersions.Keys)
|
||||||
if (tn.Checked)
|
if (tn.Checked)
|
||||||
dvil.Add(myDocVersions[tn]);
|
dvil.Add(myDocVersions[tn]);
|
||||||
|
|
||||||
|
bool cancelledOut = false; // Flag to indicate if the process should be cancelled
|
||||||
|
StringBuilder sbDocVersions = new StringBuilder();
|
||||||
|
|
||||||
|
foreach (DocVersionInfo dq in dvil)
|
||||||
|
{
|
||||||
|
string msg = string.Empty;
|
||||||
|
if (!MySessionInfo.CanCheckOutItem(dq.VersionID, CheckOutType.DocVersion, ref msg))
|
||||||
|
{
|
||||||
|
string msgp = string.Empty;
|
||||||
|
foreach (ProcedureInfo pi in dq.Procedures)
|
||||||
|
{
|
||||||
|
if (!MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref msgp))
|
||||||
|
{
|
||||||
|
FolderInfo fi = (FolderInfo)dq.ActiveParent;
|
||||||
|
int itemID = (int)fi.FolderID;
|
||||||
|
string folderName = fi.Name;
|
||||||
|
|
||||||
|
if (swDeleteFolder.Value)
|
||||||
|
sbDocVersions.AppendLine($"{folderName} - {msgp}");
|
||||||
|
else
|
||||||
|
sbDocVersions.AppendLine(msgp);
|
||||||
|
|
||||||
|
cancelledOut = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cancelledOut)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.AppendLine("The batch update process was not successful for all working drafts selected.");
|
||||||
|
sb.AppendLine("The following procedures are currently checked out...");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(sbDocVersions.ToString());
|
||||||
|
sb.AppendLine();
|
||||||
|
if (swDeleteFolder.Value)
|
||||||
|
sb.AppendLine("If you want to delete these folders, please contact the respective users and have them close any procedures in the working draft.");
|
||||||
|
else
|
||||||
|
sb.AppendLine("If you want to delete annotations from these working drafts, please contact the respective users and have them close any procedures in the working draft.");
|
||||||
|
sb.AppendLine();
|
||||||
|
txtProcess.AppendText(sb.ToString());
|
||||||
|
this.Cursor = Cursors.Default;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (swDeleteFolder.Value)
|
||||||
|
{
|
||||||
|
if (FlexibleMessageBox.Show(this, "Are 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
|
||||||
|
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...");
|
||||||
|
|
||||||
frmAnnotationsCleanup frmAnnoDel = new frmAnnotationsCleanup(this, pil, dvil);
|
frmAnnotationsCleanup frmAnnoDel = new frmAnnotationsCleanup(this, pil, dvil);
|
||||||
|
|
||||||
frmAnnoDel.ShowDialog();
|
frmAnnoDel.ShowDialog();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
this.Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProcessDelete(List<DocVersionInfo> foldersToDelete)
|
private void ProcessDelete(List<DocVersionInfo> foldersToDelete, List<FolderInfo> emptyFoldersToDelete)
|
||||||
{
|
{
|
||||||
|
int foldersDeleted = 0;
|
||||||
|
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm"));
|
txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm"));
|
||||||
@ -1753,17 +1861,19 @@ namespace VEPROMS
|
|||||||
|
|
||||||
foreach (var kvp in foldersToDelete)
|
foreach (var kvp in foldersToDelete)
|
||||||
{
|
{
|
||||||
int itemID = (int)kvp.ItemID;
|
//Gather folder information
|
||||||
string folderName = kvp.Name;
|
FolderInfo fi = (FolderInfo)kvp.ActiveParent;
|
||||||
|
int itemID = (int)fi.FolderID;
|
||||||
|
string folderName = fi.Name;
|
||||||
|
|
||||||
// Perform the deletion operation
|
// Perform the deletion operation
|
||||||
// Assume DeleteFolderByID is a method that deletes the folder by its ItemID
|
|
||||||
bool deletionSuccessful = DeleteFolderByID(itemID);
|
bool deletionSuccessful = DeleteFolderByID(itemID);
|
||||||
|
|
||||||
// Update txtProcess with the progress
|
// Update txtProcess with the progress
|
||||||
if (deletionSuccessful)
|
if (deletionSuccessful)
|
||||||
{
|
{
|
||||||
txtProcess.AppendText($"Successfully deleted folder: {folderName} (ID: {itemID})");
|
txtProcess.AppendText($"Successfully deleted folder: {folderName} (ID: {itemID})");
|
||||||
|
foldersDeleted += 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1771,13 +1881,69 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Example deletion method
|
|
||||||
private bool DeleteFolderByID(int itemID)
|
//Delete non working info folders.
|
||||||
|
foreach (var kvp in emptyFoldersToDelete)
|
||||||
{
|
{
|
||||||
// Implement your folder deletion logic here
|
//Gather folder information
|
||||||
// Return true if deletion was successful, false otherwise
|
FolderInfo fi = (FolderInfo)kvp;
|
||||||
return true; // Placeholder
|
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})");
|
||||||
|
foldersDeleted += 1;
|
||||||
|
}
|
||||||
|
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, {foldersDeleted} folders have been deleted.", "Delete Folders");
|
||||||
|
ClearStepProgress();
|
||||||
|
|
||||||
|
txtResults.AppendText($"Folder deletion process completed, {foldersDeleted} folders have been deleted.");
|
||||||
|
txtResults.AppendText(Environment.NewLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool DeleteFolderByID(int folderID)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//Delete
|
||||||
|
Folder.DeleteFolderAdmin(folderID);
|
||||||
|
|
||||||
|
//update treeview UI via veProms
|
||||||
|
_veProms.tv_FolderDelete(folderID);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
string err = ex.ToString();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ProcedureInfo> RetrieveChkAnnotations()
|
public List<ProcedureInfo> RetrieveChkAnnotations()
|
||||||
@ -1792,3 +1958,5 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,9 +121,7 @@
|
|||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<data name="swDeleteFolder.SuperTooltip" xml:space="preserve">
|
<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.
|
<value>This allows the user to remove folders and sub folders as well as their contents.
|
||||||
|
|
||||||
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.
|
Be sure a current backup of the database exists prior performing this function.
|
||||||
|
|
||||||
@ -132,28 +130,34 @@ It is recommended that this be done during off hours.
|
|||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="labelX13.SuperTooltip" xml:space="preserve">
|
<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.
|
<value>This allows the user to remove folders and sub folders as well as their contents.
|
||||||
|
|
||||||
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.
|
Be sure a current backup of the database exists prior performing this function.
|
||||||
|
|
||||||
It is recommended that this be done during off hours.
|
It is recommended that this be done during off hours.
|
||||||
|
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="swDeleteAnnotations.SuperTooltip" xml:space="preserve">
|
<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.
|
<value>This function will allow the user to remove annotations from the selected working drafts.
|
||||||
|
|
||||||
Be sure a current backup of the database exists prior to running this function.
|
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>
|
If more than one working draft is selected, it is recommended that this be performed during off hours.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="labelX14.SuperTooltip" xml:space="preserve">
|
<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.
|
<value>This function will allow the user to remove annotations from the selected working drafts.
|
||||||
|
|
||||||
Be sure a current backup of the database exists prior to running this function.
|
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>
|
If more than one working draft is selected, it is recommended that this be performed during off hours.</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnDeleteItems.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.
|
||||||
|
|
||||||
|
Click on the on/off switches to turn on/off each tool.
|
||||||
|
|
||||||
|
Note that only one of these tools can be run at a time.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="swCheckROLinks.SuperTooltip" xml:space="preserve">
|
<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.
|
<value>This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode.
|
||||||
|
@ -254,6 +254,21 @@ namespace VEPROMS
|
|||||||
tc.RefreshItem(myItemInfo);
|
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;
|
private E_UCFImportOptions _UCFImportOptionsFromSettings;
|
||||||
|
|
||||||
public frmVEPROMS()
|
public frmVEPROMS()
|
||||||
@ -474,6 +489,7 @@ namespace VEPROMS
|
|||||||
tv.NodeNew += new vlnTreeViewEvent(tv_NodeNew);
|
tv.NodeNew += new vlnTreeViewEvent(tv_NodeNew);
|
||||||
tv.OpenItem += new vlnTreeViewItemInfoEvent(tv_OpenItem);
|
tv.OpenItem += new vlnTreeViewItemInfoEvent(tv_OpenItem);
|
||||||
tv.TabDisplay += new StepPanelTabDisplayEvent(tc_PanelTabDisplay);
|
tv.TabDisplay += new StepPanelTabDisplayEvent(tc_PanelTabDisplay);
|
||||||
|
tv.DeleteFolder += new vlnTreeViewItemInfoDeleteFolderEvent(Tv_DeleteFolder);
|
||||||
tv.DeleteItemInfo += new vlnTreeViewItemInfoDeleteEvent(tv_DeleteItemInfo);
|
tv.DeleteItemInfo += new vlnTreeViewItemInfoDeleteEvent(tv_DeleteItemInfo);
|
||||||
tv.InsertItemInfo += new vlnTreeViewItemInfoInsertEvent(tv_InsertItemInfo);
|
tv.InsertItemInfo += new vlnTreeViewItemInfoInsertEvent(tv_InsertItemInfo);
|
||||||
tv.NodeInsert += new vlnTreeViewEvent(tv_NodeInsert);
|
tv.NodeInsert += new vlnTreeViewEvent(tv_NodeInsert);
|
||||||
@ -2741,7 +2757,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
void btnAdministrativeTools_Click(object sender, EventArgs e)
|
void btnAdministrativeTools_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
frmBatchRefresh frm = new frmBatchRefresh(MySessionInfo);
|
frmBatchRefresh frm = new frmBatchRefresh(MySessionInfo, this);
|
||||||
frm.ProgressBar = bottomProgBar;
|
frm.ProgressBar = bottomProgBar;
|
||||||
frm.ShowDialog(this);
|
frm.ShowDialog(this);
|
||||||
}
|
}
|
||||||
|
@ -951,7 +951,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// it is pasted into a section without enhanced data, then clear it.
|
// it is pasted into a section without enhanced data, then clear it.
|
||||||
|
|
||||||
// config data can only be on hls/notes/cautions for pasted steps.
|
// config data can only be on hls/notes/cautions for pasted steps.
|
||||||
if (!pasteItem.IsHigh && !pasteItem.IsCaution && !pasteItem.IsNote) return;
|
// B2024-059: clear links on a source section. When a paste occurs, the section is copied with the links but not
|
||||||
|
// new section is created in the enhanced document, so the links point to the original section (copied). These
|
||||||
|
// need to be removed.
|
||||||
|
if (!pasteItem.IsHigh && !pasteItem.IsCaution && !pasteItem.IsNote && !pasteItem.IsSection) return;
|
||||||
|
|
||||||
// See if the pasted step's section is enhanced with enhanced steps, and if not, clear it
|
// See if the pasted step's section is enhanced with enhanced steps, and if not, clear it
|
||||||
// Also, if pasting into a source section, don't clear (B2017-225), the 'isSourceSection' portion of the code.
|
// Also, if pasting into a source section, don't clear (B2017-225), the 'isSourceSection' portion of the code.
|
||||||
@ -974,6 +977,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// of the pasted step.
|
// of the pasted step.
|
||||||
if (pasteItem.HasEnhancedLinkedStep) pasteItem.RemoveEnhancedFromConfig();
|
if (pasteItem.HasEnhancedLinkedStep) pasteItem.RemoveEnhancedFromConfig();
|
||||||
}
|
}
|
||||||
|
// B2024-059: clear links on a source section
|
||||||
|
if (isSourceSection)
|
||||||
|
{
|
||||||
|
EnhancedDocuments seleds = pasteItem.GetMyEnhancedDocuments();
|
||||||
|
foreach (EnhancedDocument ed in seleds) pasteItem.DoUnlinkEnhanced(pasteItem, ed.Type, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Insert Child
|
#region Insert Child
|
||||||
@ -1309,8 +1318,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
else if (addType == EAddpingPart.Replace) // what about user interface for enhanced pasted steps?
|
else if (addType == EAddpingPart.Replace) // what about user interface for enhanced pasted steps?
|
||||||
{
|
{
|
||||||
ItemInfo enhReplaceItem = ItemInfo.Get(edSource.ItemID);
|
ItemInfo enhReplaceItem = ItemInfo.Get(edSource.ItemID);
|
||||||
TreeNode trn = null;
|
newEnhancedItemInfo = Item.PasteReplace(enhReplaceItem, tmpCopyEnhancedID, chgid);
|
||||||
newEnhancedItemInfo = Item.PasteReplace(enhReplaceItem, tmpCopyEnhancedID, chgid, trn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the config data for the new enhanced item (procedure, section or step) to point back to the correct source
|
// update the config data for the new enhanced item (procedure, section or step) to point back to the correct source
|
||||||
@ -2498,16 +2506,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region PasteReplace
|
#region PasteReplace
|
||||||
|
// B2024-045, 049 and 050: remove the treenode that was passed in - adjust tree from user interface code, not in item extension
|
||||||
|
// code (the 2 PasteReplace methods here had a treenode passed in)
|
||||||
|
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid)
|
||||||
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, TreeNode treeNodeReplace)
|
|
||||||
{
|
{
|
||||||
bool tmp = false;
|
bool tmp = false;
|
||||||
return PasteReplace(itemInfo, copyStartID, chgid, treeNodeReplace, ref tmp);
|
return PasteReplace(itemInfo, copyStartID, chgid, 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)
|
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, ref bool firstTrans)
|
||||||
{
|
{
|
||||||
firstTrans = false;
|
firstTrans = false;
|
||||||
if (!CanDeleteObject())
|
if (!CanDeleteObject())
|
||||||
@ -2565,10 +2572,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Create tree node for copied procedure when no other procedures exist in the working draft (treeNodeReplace)
|
// B2024-045, 049 and 050: if not a single procedure replace, update user interface by using the 'OnNewChild'. Single
|
||||||
VETreeNode tn = null;
|
// procedure's MyParent is null because its parent is a working draft (docversion) since MyParent's type is iteminfo.
|
||||||
tn = new VETreeNode(newItemInfo);
|
// For the single procedure case, the user interface code in vlntreeview will update the tree.
|
||||||
treeNodeReplace.Nodes.Add(tn);
|
if (newItemInfo.MyParent != null)
|
||||||
|
newItemInfo.MyParent.OnNewChild(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Child));
|
||||||
}
|
}
|
||||||
return newItemInfo;
|
return newItemInfo;
|
||||||
}
|
}
|
||||||
|
@ -1107,7 +1107,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
foreach (MembershipInfo mi in this.UserMemberships)
|
foreach (MembershipInfo mi in this.UserMemberships)
|
||||||
{
|
{
|
||||||
if (mi.EndDate == string.Empty)
|
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
||||||
{
|
{
|
||||||
foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments)
|
foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments)
|
||||||
{
|
{
|
||||||
@ -1129,7 +1129,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
foreach (MembershipInfo mi in this.UserMemberships)
|
foreach (MembershipInfo mi in this.UserMemberships)
|
||||||
{
|
{
|
||||||
if (mi.EndDate == string.Empty)
|
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
||||||
{
|
{
|
||||||
Dictionary<int, int> folders = new Dictionary<int, int>();
|
Dictionary<int, int> folders = new Dictionary<int, int>();
|
||||||
//FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID);
|
//FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID);
|
||||||
@ -1157,7 +1157,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
foreach (MembershipInfo mi in this.UserMemberships)
|
foreach (MembershipInfo mi in this.UserMemberships)
|
||||||
{
|
{
|
||||||
if (mi.EndDate == string.Empty)
|
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
||||||
{
|
{
|
||||||
Dictionary<int, int> folders = new Dictionary<int, int>();
|
Dictionary<int, int> folders = new Dictionary<int, int>();
|
||||||
FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID);
|
FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID);
|
||||||
@ -1184,7 +1184,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
foreach (MembershipInfo mi in this.UserMemberships)
|
foreach (MembershipInfo mi in this.UserMemberships)
|
||||||
{
|
{
|
||||||
if (mi.EndDate == string.Empty)
|
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
||||||
{
|
{
|
||||||
Dictionary<int, int> folders = new Dictionary<int, int>();
|
Dictionary<int, int> folders = new Dictionary<int, int>();
|
||||||
FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID);
|
FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID);
|
||||||
@ -1211,7 +1211,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
foreach (MembershipInfo mi in this.UserMemberships)
|
foreach (MembershipInfo mi in this.UserMemberships)
|
||||||
{
|
{
|
||||||
if (mi.EndDate == string.Empty)
|
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
||||||
{
|
{
|
||||||
Dictionary<int, int> folders = new Dictionary<int, int>();
|
Dictionary<int, int> folders = new Dictionary<int, int>();
|
||||||
FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID);
|
FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID);
|
||||||
@ -1238,7 +1238,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
|
|
||||||
foreach (MembershipInfo mi in this.UserMemberships)
|
foreach (MembershipInfo mi in this.UserMemberships)
|
||||||
{
|
{
|
||||||
if (mi.EndDate == string.Empty)
|
if (mi.EndDate == string.Empty && mi.MyGroup.GroupAssignments != null) //B2024-051 added null check - user assigned to non-existing procedure set
|
||||||
{
|
{
|
||||||
Dictionary<int, int> folders = new Dictionary<int, int>();
|
Dictionary<int, int> folders = new Dictionary<int, int>();
|
||||||
FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID);
|
FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID);
|
||||||
|
@ -1433,6 +1433,31 @@ namespace VEPROMS.CSLA.Library
|
|||||||
throw new DbCslaException("Folder.Remove", ex);
|
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
|
#endregion
|
||||||
#region Exists
|
#region Exists
|
||||||
public static bool Exists(int folderID)
|
public static bool Exists(int folderID)
|
||||||
|
@ -672,8 +672,10 @@ namespace Volian.Controls.Library
|
|||||||
if (_MyDisplayTabItems.ContainsKey(key) && pasteType != ItemInfo.EAddpingPart.Replace) // If procedure page open use it unless replace
|
if (_MyDisplayTabItems.ContainsKey(key) && pasteType != ItemInfo.EAddpingPart.Replace) // If procedure page open use it unless replace
|
||||||
{
|
{
|
||||||
DisplayTabItem pg = _MyDisplayTabItems[key];
|
DisplayTabItem pg = _MyDisplayTabItems[key];
|
||||||
|
// B2024-038: if section, refresh the editor even if the section is not expanded.
|
||||||
|
bool isSec = myItemInfo.IsSection;
|
||||||
if (pg.MyStepTabPanel.MyStepPanel._LookupEditItems.ContainsKey(myItemInfo.ItemID) &&
|
if (pg.MyStepTabPanel.MyStepPanel._LookupEditItems.ContainsKey(myItemInfo.ItemID) &&
|
||||||
pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID].Expanded)
|
(pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID].Expanded || isSec))
|
||||||
{
|
{
|
||||||
EditItem edtitm = pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID];
|
EditItem edtitm = pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID];
|
||||||
switch (pasteType)
|
switch (pasteType)
|
||||||
@ -710,7 +712,8 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
else if (_MyDisplayTabItems.ContainsKey(key) && pasteType == ItemInfo.EAddpingPart.Replace)
|
else if (_MyDisplayTabItems.ContainsKey(key) && pasteType == ItemInfo.EAddpingPart.Replace)
|
||||||
{
|
{
|
||||||
CloseTabItem(_MyDisplayTabItems["Item - " + myItemInfo.ItemID.ToString()]); //Grab itemID and set to close open tab.
|
// B2024-038: changed tab key to procedure (was item, which caused crash if section)
|
||||||
|
CloseTabItem(_MyDisplayTabItems["Item - " + proc.ItemID.ToString()]); //Grab itemID and set to close open tab.
|
||||||
return false; //B2017-179 PasteReplace will return null if was aborted
|
return false; //B2017-179 PasteReplace will return null if was aborted
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1844,8 +1844,8 @@ namespace Volian.Controls.Library
|
|||||||
bool gotoFirstTrans = false;
|
bool gotoFirstTrans = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
TreeNode treeNodeReplace = null;
|
// B2024-045, 049 and 050: do not pass in a tree node to Item.PasteReplace
|
||||||
newItemInfo = Item.PasteReplace(MyItemInfo, copyStartID, GetChangeId(MyItemInfo), treeNodeReplace, ref gotoFirstTrans);
|
newItemInfo = Item.PasteReplace(MyItemInfo, copyStartID, GetChangeId(MyItemInfo), ref gotoFirstTrans);
|
||||||
if (gotoFirstTrans) //B2017-179 could not replace step, we are positioning onto the first transition that needs resolved
|
if (gotoFirstTrans) //B2017-179 could not replace step, we are positioning onto the first transition that needs resolved
|
||||||
{
|
{
|
||||||
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(newItemInfo);
|
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(newItemInfo);
|
||||||
|
@ -26,7 +26,9 @@ namespace Volian.Controls.Library
|
|||||||
public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args);
|
public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args);
|
||||||
public delegate bool vlnTreeViewBoolEvent(object sender, vlnTreeEventArgs args);
|
public delegate bool vlnTreeViewBoolEvent(object sender, vlnTreeEventArgs args);
|
||||||
public delegate bool vlnTreeViewItemInfoDeleteEvent(object sender, vlnTreeItemInfoEventArgs args);
|
public delegate bool vlnTreeViewItemInfoDeleteEvent(object sender, vlnTreeItemInfoEventArgs args);
|
||||||
|
|
||||||
public delegate bool vlnTreeViewItemInfoInsertEvent(object sender, vlnTreeItemInfoInsertEventArgs args);
|
public delegate bool vlnTreeViewItemInfoInsertEvent(object sender, vlnTreeItemInfoInsertEventArgs args);
|
||||||
|
public delegate bool vlnTreeViewItemInfoDeleteFolderEvent(object sender, vlnTreeFolderDeleteEventArgs args);
|
||||||
public delegate bool vlnTreeViewItemInfoPasteEvent(object sender, vlnTreeItemInfoPasteEventArgs args);
|
public delegate bool vlnTreeViewItemInfoPasteEvent(object sender, vlnTreeItemInfoPasteEventArgs args);
|
||||||
public delegate TreeNode vlnTreeViewTreeNodeEvent(object sender, vlnTreeEventArgs args);
|
public delegate TreeNode vlnTreeViewTreeNodeEvent(object sender, vlnTreeEventArgs args);
|
||||||
public delegate DialogResult vlnTreeViewPropertyEvent(object sender, vlnTreePropertyEventArgs args);
|
public delegate DialogResult vlnTreeViewPropertyEvent(object sender, vlnTreePropertyEventArgs args);
|
||||||
@ -220,6 +222,15 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
public class vlnTreeFolderDeleteEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public int FolderId { get; }
|
||||||
|
|
||||||
|
public vlnTreeFolderDeleteEventArgs(int folderId)
|
||||||
|
{
|
||||||
|
FolderId = folderId;
|
||||||
|
}
|
||||||
|
}
|
||||||
public enum E_InsertType {Before, After, Child};
|
public enum E_InsertType {Before, After, Child};
|
||||||
public partial class vlnTreeItemInfoInsertEventArgs
|
public partial class vlnTreeItemInfoInsertEventArgs
|
||||||
{
|
{
|
||||||
@ -427,6 +438,12 @@ namespace Volian.Controls.Library
|
|||||||
if (DeleteItemInfo != null) return DeleteItemInfo(sender, args);
|
if (DeleteItemInfo != null) return DeleteItemInfo(sender, args);
|
||||||
return false;
|
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;
|
public event vlnTreeViewItemInfoInsertEvent InsertItemInfo;
|
||||||
private bool OnInsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args)
|
private bool OnInsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args)
|
||||||
{
|
{
|
||||||
@ -551,6 +568,11 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
if (ProcedureCheckedOutTo != null) ProcedureCheckedOutTo(sender, args);
|
if (ProcedureCheckedOutTo != null) ProcedureCheckedOutTo(sender, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public event vlnTreeViewEvent ExportImportProcedureSets;
|
public event vlnTreeViewEvent ExportImportProcedureSets;
|
||||||
private void OnExportImportProcedureSets(object sender, vlnTreeEventArgs args)
|
private void OnExportImportProcedureSets(object sender, vlnTreeEventArgs args)
|
||||||
{
|
{
|
||||||
@ -1059,6 +1081,11 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
#region Menu_Delete
|
#region Menu_Delete
|
||||||
if (ok)
|
if (ok)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// Add delete to the menu unless at the very 'top' node, on a grouping (partinfo)
|
// Add delete to the menu unless at the very 'top' node, on a grouping (partinfo)
|
||||||
// node (RNOs, Steps, Cautions, Notes) or Folder/DocVersion that contains any items.
|
// node (RNOs, Steps, Cautions, Notes) or Folder/DocVersion that contains any items.
|
||||||
@ -1082,6 +1109,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
//_MyLog.WarnFormat("Context Menu 6 - {0}", GC.GetTotalMemory(true));
|
//_MyLog.WarnFormat("Context Menu 6 - {0}", GC.GetTotalMemory(true));
|
||||||
#region Menu_ExternalTransitions
|
#region Menu_ExternalTransitions
|
||||||
@ -1712,10 +1740,13 @@ namespace Volian.Controls.Library
|
|||||||
// 1) 'to' & 'from' both 'non', i.e. Neither can have enhanced config data (be source or enhanced)
|
// 1) 'to' & 'from' both 'non', i.e. Neither can have enhanced config data (be source or enhanced)
|
||||||
// can do Before/After/Replace
|
// can do Before/After/Replace
|
||||||
// 2) 'to' section is 'source' and 'from' section is 'non' (has no MyEnhancedDocuments)
|
// 2) 'to' section is 'source' and 'from' section is 'non' (has no MyEnhancedDocuments)
|
||||||
// can do Before/After - no links exist in pasted section.
|
// can do Before/After - no links exist in pasted section so cannot do Replace
|
||||||
// cannot do Replace
|
|
||||||
// 3) 'to' section is 'source' and 'from' section is same docversion 'source'
|
// 3) 'to' section is 'source' and 'from' section is same docversion 'source'
|
||||||
// can do Before/After/Replace
|
// can do Before/After (B2024-038 removes replace)
|
||||||
|
// 4) 'to' section is not 'source' and 'from' section is source
|
||||||
|
// can do Before/After but not replace - would have to manage
|
||||||
|
// links for 'from' section (B2024-038 added this case)
|
||||||
|
|
||||||
SectionConfig secToCfg = iiPasteHere.MyConfig as SectionConfig;
|
SectionConfig secToCfg = iiPasteHere.MyConfig as SectionConfig;
|
||||||
SectionConfig secFromCfg = iiClipboard.MyConfig as SectionConfig;
|
SectionConfig secFromCfg = iiClipboard.MyConfig as SectionConfig;
|
||||||
|
|
||||||
@ -1730,7 +1761,16 @@ namespace Volian.Controls.Library
|
|||||||
secCanPaste = true;
|
secCanPaste = true;
|
||||||
okToReplace = false;
|
okToReplace = false;
|
||||||
}
|
}
|
||||||
else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) secCanPaste = true; // 3)
|
else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID)
|
||||||
|
{
|
||||||
|
secCanPaste = true; // 3)
|
||||||
|
okToReplace = false;
|
||||||
|
}
|
||||||
|
else if (!secToIsSource && secFromIsSource)
|
||||||
|
{
|
||||||
|
secCanPaste = true; // 4
|
||||||
|
okToReplace = false;
|
||||||
|
}
|
||||||
if (iiClipboard.IsRtfRaw) secCanPaste = okToReplace = false; // never paste an equation.
|
if (iiClipboard.IsRtfRaw) secCanPaste = okToReplace = false; // never paste an equation.
|
||||||
if (secCanPaste) cm.MenuItems.Add("Paste Section Before", new EventHandler(mi_Click));
|
if (secCanPaste) cm.MenuItems.Add("Paste Section Before", new EventHandler(mi_Click));
|
||||||
if (okToReplace && secCanPaste) cm.MenuItems.Add("Replace Existing Section", new EventHandler(mi_Click));
|
if (okToReplace && secCanPaste) cm.MenuItems.Add("Replace Existing Section", new EventHandler(mi_Click));
|
||||||
@ -1940,6 +1980,16 @@ namespace Volian.Controls.Library
|
|||||||
OnPrintTransitionReport(this, new vlnTreeEventArgs(SelectedNode as VETreeNode));
|
OnPrintTransitionReport(this, new vlnTreeEventArgs(SelectedNode as VETreeNode));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (mi.Text == "Export Procedure Set" || mi.Text == "Export Procedure")
|
if (mi.Text == "Export Procedure Set" || mi.Text == "Export Procedure")
|
||||||
{
|
{
|
||||||
OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
|
OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
|
||||||
@ -2408,7 +2458,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
VETreeNode tn = SelectedNode as VETreeNode;
|
VETreeNode tn = SelectedNode as VETreeNode;
|
||||||
TreeNode treeNodeReplace = SelectedNode.Parent; //Get Tree Node of Parent we are proc we are placing into.
|
|
||||||
DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
|
DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
|
||||||
// Check for paste into a docversion - queries/code is different than paste related to an item (into a proc or section)
|
// Check for paste into a docversion - queries/code is different than paste related to an item (into a proc or section)
|
||||||
if (dvi != null)
|
if (dvi != null)
|
||||||
@ -2445,11 +2495,27 @@ namespace Volian.Controls.Library
|
|||||||
PasteBeforeOrAfter(MenuSelections.StepAfter, tn, iiClipboard.ItemID);
|
PasteBeforeOrAfter(MenuSelections.StepAfter, tn, iiClipboard.ItemID);
|
||||||
else if (p.IndexOf("Replace") > -1)
|
else if (p.IndexOf("Replace") > -1)
|
||||||
{
|
{
|
||||||
PasteReplace(tn, iiClipboard.ItemID, treeNodeReplace);
|
bool OnlyProc = iiPaste.IsProcedure && iiPaste.MyPrevious == null && (iiPaste.NextItems == null || iiPaste.NextItems.Count == 0);
|
||||||
|
VETreeNode tmp = null;
|
||||||
|
if (OnlyProc)
|
||||||
|
{
|
||||||
|
VETreeNode tnp = SelectedNode as VETreeNode;
|
||||||
|
tmp = tnp == null ? null : tnp.Parent as VETreeNode;
|
||||||
|
}
|
||||||
|
ItemInfo repitem = PasteReplace(tn, iiClipboard.ItemID);
|
||||||
|
// B2024-045, 049 and 050: The treenode was passed into the business object's replace but sometimes it was null. And this
|
||||||
|
// wasn't working if it was a single procedure in a working Draft. Adjust the tree here if single procedure in working draft.
|
||||||
|
if (OnlyProc && repitem != null && tmp != null)
|
||||||
|
{
|
||||||
|
VETreeNode tn1 = new VETreeNode(repitem);
|
||||||
|
tmp.Nodes.Add(tn1);
|
||||||
|
SelectedNode = tn1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // paste as child
|
else // paste as child
|
||||||
PasteAsChild(tn, iiClipboard.ItemID);
|
PasteAsChild(tn, iiClipboard.ItemID);
|
||||||
|
|
||||||
|
|
||||||
//if (p.IndexOf("Replace") <= -1)
|
//if (p.IndexOf("Replace") <= -1)
|
||||||
this.Cursor = Cursors.Default;
|
this.Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
@ -2541,18 +2607,19 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
SelectedNode = (VETreeNode)((newtype == MenuSelections.StepAfter) ? tn.NextNode : tn.PrevNode);
|
SelectedNode = (VETreeNode)((newtype == MenuSelections.StepAfter) ? tn.NextNode : tn.PrevNode);
|
||||||
}
|
}
|
||||||
private void PasteReplace(VETreeNode tn, int copyStartID, TreeNode treeNodeReplace)
|
private ItemInfo PasteReplace(VETreeNode tn, int copyStartID)
|
||||||
{
|
{
|
||||||
VETreeNode prevtn = (VETreeNode) tn.PrevNode;
|
VETreeNode prevtn = (VETreeNode) tn.PrevNode;
|
||||||
VETreeNode partn = (VETreeNode) tn.Parent;
|
VETreeNode partn = (VETreeNode) tn.Parent;
|
||||||
ItemInfo ii = tn.VEObject as ItemInfo;
|
ItemInfo ii = tn.VEObject as ItemInfo;
|
||||||
// F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format
|
// F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format
|
||||||
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(copyStartID, ii, true);
|
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(copyStartID, ii, true);
|
||||||
|
ItemInfo replItemInfo = null;
|
||||||
if (!OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, ItemInfo.EAddpingPart.Replace, ii.MyContent.Type)))
|
if (!OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, ItemInfo.EAddpingPart.Replace, ii.MyContent.Type)))
|
||||||
{
|
{
|
||||||
// first, check if a changeid is required.
|
// first, check if a changeid is required.
|
||||||
string chgId = OnGetChangeId(this, new vlnTreeItemInfoEventArgs(ii));
|
string chgId = OnGetChangeId(this, new vlnTreeItemInfoEventArgs(ii));
|
||||||
ItemInfo replItemInfo = Item.PasteReplace(ii, copyStartID, chgId, treeNodeReplace);
|
replItemInfo = Item.PasteReplace(ii, copyStartID, chgId);
|
||||||
|
|
||||||
StepConfig replItemConfig = ii.MyConfig as StepConfig;
|
StepConfig replItemConfig = ii.MyConfig as StepConfig;
|
||||||
if (replItemInfo != null)
|
if (replItemInfo != null)
|
||||||
@ -2562,7 +2629,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
// B2018-047: was crashing on the following line (before change it was casting the result to a VETreeNote when the partn.FirstNode was just a TreeNode)
|
// B2018-047: was crashing on the following line (before change it was casting the result to a VETreeNote when the partn.FirstNode was just a TreeNode)
|
||||||
SelectedNode = prevtn != null ? prevtn.NextNode : partn.FirstNode;
|
SelectedNode = prevtn != null ? prevtn.NextNode : partn.FirstNode;
|
||||||
|
return replItemInfo;
|
||||||
|
|
||||||
}
|
}
|
||||||
public void PasteRepalceEmpty(VETreeNode tn, int copyStartID)
|
public void PasteRepalceEmpty(VETreeNode tn, int copyStartID)
|
||||||
@ -3567,6 +3634,41 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
return false;
|
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)
|
private bool DeleteItemInfoAndChildren(ItemInfo ii)
|
||||||
{
|
{
|
||||||
DateTime dtStart = DateTime.Now;
|
DateTime dtStart = DateTime.Now;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user