diff --git a/PROMS/VEPROMS User Interface/frmAnnotationsCleanup.cs b/PROMS/VEPROMS User Interface/frmAnnotationsCleanup.cs index 7e964995..7a78813d 100644 --- a/PROMS/VEPROMS User Interface/frmAnnotationsCleanup.cs +++ b/PROMS/VEPROMS User Interface/frmAnnotationsCleanup.cs @@ -22,6 +22,8 @@ namespace VEPROMS string procList = ""; string docvList = ""; int AnnotationTyp; + string AnnotationName = ""; + string totalDeleteCnt = ""; List pil2 = new List(); List dvil2 = new List(); private frmBatchRefresh mainForm = null; @@ -99,16 +101,29 @@ namespace VEPROMS private AnnotationTypeInfoList myAnnotationTypeInfoList = null; private LocalAnnotationTypeInfoList myLocalAnnotationTypeInfoList = null; - // Process used to cleanup annotations "(Proceed?" button) + // Process used to cleanup annotations "(Proceed?" button) private void button1_Click(object sender, EventArgs e) { + + TextBox frm2 = mainForm.GettxtProcess(); + TextBox frm3 = mainForm.GettxtResults(); + AnnotationTyp = System.Convert.ToInt32(((KeyValuePair)lbAnnotationTypes.SelectedItem).Key); + AnnotationName = System.Convert.ToString(((KeyValuePair)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) { if (p.IsProcedure) { - TextBox frm2 = mainForm.GettxtProcess(); - frm2.AppendText(p.DisplayNumber + ' ' + p.DisplayText); - AnnotationTyp = System.Convert.ToInt32(((KeyValuePair)lbAnnotationTypes.SelectedItem).Key); + //AnnotationTyp = System.Convert.ToInt32(((KeyValuePair)lbAnnotationTypes.SelectedItem).Key); + //AnnotationName = System.Convert.ToString(((KeyValuePair)lbAnnotationTypes.SelectedItem).Value); + //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()); lblCountNumber.Text = "0"; } @@ -118,15 +133,22 @@ namespace VEPROMS { if (d.IsDocVersion) { - TextBox frm2 = mainForm.GettxtProcess(); - frm2.AppendText(d.ActiveParent.ToString()); + //AnnotationTyp = System.Convert.ToInt32(((KeyValuePair)lbAnnotationTypes.SelectedItem).Key); + //AnnotationName = System.Convert.ToString(((KeyValuePair)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)lbAnnotationTypes.SelectedItem).Key); Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString()); + 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) { btnClean.Enabled = false; @@ -145,6 +167,7 @@ namespace VEPROMS deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, getAnnotationDocvItems(dvil2)); } lblCountNumber.Text = (deletecountProc + deletecountDocv).ToString(); + totalDeleteCnt = (deletecountProc + deletecountDocv).ToString(); btnClean.Enabled = true; } @@ -156,3 +179,5 @@ namespace VEPROMS } } + + diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs index 041d81f5..429c1244 100644 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh.cs +++ b/PROMS/VEPROMS User Interface/frmBatchRefresh.cs @@ -61,6 +61,13 @@ namespace VEPROMS { 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) // 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 @@ -1722,7 +1729,7 @@ namespace VEPROMS else { // Write progress status - txtProcess.AppendText("Deleting Annotations..."); + txtProcess.AppendText("Deleting Annotations..." + Environment.NewLine); // Create a list of procedures the user selected List pil = new List(); @@ -1792,3 +1799,5 @@ namespace VEPROMS } + +