C2024-005-Annotations-Cleanup

This commit is contained in:
2024-07-17 13:19:58 -04:00
parent b496f8b9ed
commit 331ea86e6e
10 changed files with 32 additions and 56 deletions

View File

@@ -25,38 +25,36 @@ namespace VEPROMS
List<ProcedureInfo> pil2 = new List<ProcedureInfo>();
List<DocVersionInfo> dvil2 = new List<DocVersionInfo>();
private frmBatchRefresh mainForm = null;
// frmAnnotationsCleanup constructor passes users procedure and docversion selections from frmBatchRefresh
public frmAnnotationsCleanup(Form callingForm, List<ProcedureInfo> pil, List<DocVersionInfo> dvil)
{
{ // Set up link back to parent form.
mainForm = callingForm as frmBatchRefresh;
InitializeComponent();
pil2 = pil;
dvil2 = dvil;
// Get list of annotation types for plant.
myAnnotationTypeInfoList = AnnotationTypeInfoList.Get();
lbAnnotationTypes.DataSource = myLocalAnnotationTypeInfoList = new LocalAnnotationTypeInfoList(myAnnotationTypeInfoList);
Dictionary<string, string> AnnotationsList = new Dictionary<string, string>();
// Add name and type ID to form.
foreach (LocalAnnotationTypeInfo lati in myLocalAnnotationTypeInfoList)
{
AnnotationsList.Add(lati.TypeID.ToString(), lati.Name);
//cbAnnotationTypes.Items.Add(new { Name = lati.Name, Value = lati.TypeID });
}
//cbAnnotationTypes.DroppedDown = true; //DroppedDown
lbAnnotationTypes.DataSource = new BindingSource(AnnotationsList, null);
lbAnnotationTypes.DisplayMember = "Value";
lbAnnotationTypes.ValueMember = "Key";
lbAnnotationTypes.SelectedIndexChanged += lbAnnotationTypes_SelectedIndexChanged;
//List<ProcedureInfo> SelectedProds = new List<ProcedureInfo>();
//SelectedProds = frmBatchRefresh.RetrieveChkAnnotations();
}
// create comma delimited string of procedures selected by user.
private string getAnnotationProcItems(List<ProcedureInfo> pil2)
{
procList = "";
@@ -75,9 +73,9 @@ namespace VEPROMS
}
}
return procList;
//for( int i = 0; pil2.Count ; i++ )
}
// create comma delimited string of doc versions selected by user.
private string getAnnotationDocvItems(List<DocVersionInfo> dvil2)
{
docvList = "";
@@ -96,11 +94,12 @@ namespace VEPROMS
}
}
return docvList;
//for( int i = 0; pil2.Count ; i++ )
}
private AnnotationTypeInfoList myAnnotationTypeInfoList = null;
private LocalAnnotationTypeInfoList myLocalAnnotationTypeInfoList = null;
// Process used to cleanup annotations "(Proceed?" button)
private void button1_Click(object sender, EventArgs e)
{
foreach (var p in pil2)
@@ -127,12 +126,7 @@ namespace VEPROMS
}
}
}
//private void cbAnnotationTypes_SelectedIndexChanged(object sender, EventArgs e)
//{
// mylab.Text = mylab.Text + ((KeyValuePair<string, string>)cbAnnotationTypes.SelectedItem).Key;
//}
// Retrieve number of annotations that will be deleted.
private void lbAnnotationTypes_SelectedIndexChanged(object sender, EventArgs e)
{
lblCountNumber.Text = "";
@@ -152,23 +146,11 @@ namespace VEPROMS
lblCountNumber.Text = (deletecountProc + deletecountDocv).ToString();
}
// Close form.
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
//private void cbAnnotationTypes_(object sender, EventArgs e)
//{
// //mylab.Text = mylab.Text + cbAnnotationTypes.SelectedValue;
// //mylab.Text = mylab.Text + cbAnnotationTypes.SelectedItem.ToString();
// //mylab.Text = mylab.Text + ((KeyValuePair<string, string>)cbAnnotationTypes.SelectedItem).Value;
//}
}
}