Development #373

Merged
djankowski merged 17 commits from Development into master 2024-08-01 08:37:24 -04:00
Showing only changes of commit 9011b134d6 - Show all commits

View File

@ -105,47 +105,50 @@ namespace VEPROMS
// 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<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)
if (lbAnnotationTypes.SelectedIndex > -1)
{
if (p.IsProcedure)
{
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)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";
}
}
foreach (var d in dvil2)
{
if (d.IsDocVersion)
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)
{
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
//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);
Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString());
if (p.IsProcedure)
{
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)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";
}
lblCountNumber.Text = "0";
}
foreach (var d in dvil2)
{
if (d.IsDocVersion)
{
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
//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);
Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString());
lblCountNumber.Text = "0";
}
}
frm3.AppendText(Environment.NewLine + Environment.NewLine + "Total Annotations Deleted: " + totalDeleteCnt + Environment.NewLine + Environment.NewLine);
}
frm3.AppendText(Environment.NewLine + Environment.NewLine + "Total Annotations Deleted: " + totalDeleteCnt + Environment.NewLine + Environment.NewLine);
}