diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs index 0ec4e750..9eef5ffc 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs @@ -513,7 +513,7 @@ this.swDeleteFolder.Name = "swDeleteFolder"; this.swDeleteFolder.Size = new System.Drawing.Size(69, 22); this.swDeleteFolder.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.superTooltip1.SetSuperTooltip(this.swDeleteFolder, new DevComponents.DotNetBar.SuperTooltipInfo("Check RO Links", "", resources.GetString("swDeleteFolder.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(250, 150))); + this.superTooltip1.SetSuperTooltip(this.swDeleteFolder, new DevComponents.DotNetBar.SuperTooltipInfo("Delete Folders", "", resources.GetString("swDeleteFolder.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(250, 150))); this.swDeleteFolder.SwitchClickTogglesValue = true; this.swDeleteFolder.TabIndex = 39; this.swDeleteFolder.ValueChanged += new System.EventHandler(this.swDeleteFolder_ValueChanged); @@ -529,7 +529,7 @@ this.labelX13.Location = new System.Drawing.Point(85, 42); this.labelX13.Name = "labelX13"; this.labelX13.Size = new System.Drawing.Size(168, 22); - this.superTooltip1.SetSuperTooltip(this.labelX13, new DevComponents.DotNetBar.SuperTooltipInfo("Check RO Links", "", resources.GetString("labelX13.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(350, 175))); + this.superTooltip1.SetSuperTooltip(this.labelX13, new DevComponents.DotNetBar.SuperTooltipInfo("Delete Folders", "", resources.GetString("labelX13.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(350, 175))); this.labelX13.TabIndex = 38; this.labelX13.Text = "Delete Folders"; // @@ -543,7 +543,7 @@ this.swDeleteAnnotations.Name = "swDeleteAnnotations"; this.swDeleteAnnotations.Size = new System.Drawing.Size(69, 22); this.swDeleteAnnotations.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.superTooltip1.SetSuperTooltip(this.swDeleteAnnotations, new DevComponents.DotNetBar.SuperTooltipInfo("Refresh Transitions", "", resources.GetString("swDeleteAnnotations.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(265, 175))); + this.superTooltip1.SetSuperTooltip(this.swDeleteAnnotations, new DevComponents.DotNetBar.SuperTooltipInfo("Delete Annotations", "", resources.GetString("swDeleteAnnotations.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(265, 175))); this.swDeleteAnnotations.SwitchClickTogglesValue = true; this.swDeleteAnnotations.TabIndex = 37; this.swDeleteAnnotations.Value = true; @@ -561,7 +561,7 @@ this.labelX14.Location = new System.Drawing.Point(85, 14); this.labelX14.Name = "labelX14"; this.labelX14.Size = new System.Drawing.Size(186, 22); - this.superTooltip1.SetSuperTooltip(this.labelX14, new DevComponents.DotNetBar.SuperTooltipInfo("Process Deletions", "", resources.GetString("labelX14.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(200, 175))); + this.superTooltip1.SetSuperTooltip(this.labelX14, new DevComponents.DotNetBar.SuperTooltipInfo("Delete Annotations", "", resources.GetString("labelX14.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(200, 175))); this.labelX14.TabIndex = 36; this.labelX14.Text = "Delete Annotations"; // diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs index 1ae0f399..e5c85cb9 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs @@ -239,7 +239,7 @@ namespace VEPROMS return loadedWorkingDraft; } - + private bool LoadDocVersions(FolderInfo fic, TreeNode tnc, bool noProcs) { bool rtnval = false; @@ -1755,19 +1755,78 @@ namespace VEPROMS txtResults.Clear(); txtProcess.Clear(); + this.Cursor = Cursors.WaitCursor; + + //Create checked proce and doc info lists. + List pil = new List(); + List dvil = new List(); + + // Create a list of procedures the user selected + foreach (TreeNode tn in myProcedures.Keys) + if (tn.Checked) + pil.Add(myProcedures[tn]); + + // Create a list of doc versions the user selected + foreach (TreeNode tn in myDocVersions.Keys) + if (tn.Checked) + 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 with docversions - List dvil = new List(); - foreach (TreeNode tn in myDocVersions.Keys) - if (tn.Checked) - dvil.Add(myDocVersions[tn]); - - //Load Selected Folders with docversions + //Load Selected Folders List ef = new List(); foreach (TreeNode tn in myFolders.Keys) @@ -1782,24 +1841,13 @@ namespace VEPROMS // Write progress status txtProcess.AppendText("Deleting Annotations..."); - // Create a list of procedures the user selected - List pil = new List(); - foreach (TreeNode tn in myProcedures.Keys) - if (tn.Checked) - pil.Add(myProcedures[tn]); - - // Create a list of doc versions the user selected - List dvil = new List(); - foreach (TreeNode tn in myDocVersions.Keys) - if (tn.Checked) - dvil.Add(myDocVersions[tn]); - frmAnnotationsCleanup frmAnnoDel = new frmAnnotationsCleanup(this, pil, dvil); frmAnnoDel.ShowDialog(); } + this.Cursor = Cursors.Default; } private void ProcessDelete(List foldersToDelete, List emptyFoldersToDelete) @@ -1860,8 +1908,8 @@ namespace VEPROMS } - txtResults.AppendText($"Folder deletion process completed, {foldersDeleted} folder(s) have been deleted. "); - txtResults.AppendText(Environment.NewLine); + + //Run Repair int prgStpIdx = -1; @@ -1874,6 +1922,9 @@ namespace VEPROMS 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) diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.resx b/PROMS/VEPROMS User Interface/frmBatchRefresh.resx index c140c84f..ceac1979 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.resx +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.resx @@ -121,9 +121,7 @@ 17, 17 - 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. + This allows the user to remove folders and sub folders as well as their contents. Be sure a current backup of the database exists prior performing this function. @@ -132,28 +130,27 @@ It is recommended that this be done during off hours. - 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. + This allows the user to remove folders and sub folders as well as their contents. Be sure a current backup of the database exists prior performing this function. It is recommended that this be done during off hours. + - This function will refresh transitions in all procedures selected below, whether they were selected individually or as a group via a procedure set. + 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. -If more than one procedure is selected, it is recommended that this be performed during off hours. +If more than one working draft is selected, it is recommended that this be performed during off hours. - 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. + This function will allow the user to remove annotations from the selected working drafts. -Click on the on/off switches to turn on/off each tool. +Be sure a current backup of the database exists prior to running this function. -Note that only one of these tools can be run at a time. +If more than one working draft is selected, it is recommended that this be performed during off hours. 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.