C2025-047-AnnotationsTypeSelectChanges

This commit is contained in:
2025-07-31 23:06:29 -04:00
parent 019aefbc61
commit a7c7744ff3
6 changed files with 225 additions and 5 deletions

View File

@@ -63,18 +63,21 @@ namespace VEPROMS
lstFrom.Items.Remove(item);
}
SetButtonsEditable();
btnUpdate.Enabled = true;
}
// Move all items to lstSelected.
private void btnSelectAll_Click(object sender, EventArgs e)
{
MoveAllItems(lstUnselected, lstSelected);
btnUpdate.Enabled = true;
}
// Move all items to lstUnselected.
private void btnDeselectAll_Click(object sender, EventArgs e)
{
MoveAllItems(lstSelected, lstUnselected);
btnUpdate.Enabled = true;
}
// Move all items from one ListBox to another.
@@ -83,6 +86,7 @@ namespace VEPROMS
lstTo.Items.AddRange(lstFrom.Items);
lstFrom.Items.Clear();
SetButtonsEditable();
btnUpdate.Enabled = true;
}
// Enable and disable buttons.
@@ -93,8 +97,10 @@ namespace VEPROMS
// Save selected list to DB.
private void btnUpdate_Click(object sender, EventArgs e)
{
DataTable dt2 = coverToTable();
VEPROMS.CSLA.Library.AnnotationstypeSelections.Update(dt2, UserID);
saveChanges();
//DataTable dt2 = coverToTable();
//VEPROMS.CSLA.Library.AnnotationstypeSelections.Update(dt2, UserID);
//btnUpdate.Enabled = false;
}
public class AnnotataionItem
{
@@ -154,7 +160,19 @@ namespace VEPROMS
private void btnCancel_Click_1(object sender, EventArgs e)
{
this.Close();
string message = "Changes have not yet been saved. Do you want to save the changes prior to closing?";
string title = "Save Annotation Selections";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result = MessageBox.Show(message, title, buttons);
if (result == DialogResult.Yes)
{
saveChanges();
this.Close();
}
else
{
this.Close();
}
}
private DataTable coverToTable()
@@ -169,6 +187,12 @@ namespace VEPROMS
}
return dt;
}
private void saveChanges()
{
DataTable dt2 = coverToTable();
VEPROMS.CSLA.Library.AnnotationstypeSelections.Update(dt2, UserID);
btnUpdate.Enabled = false;
}
}
}