B2020-091: Section deletes even if transition point to it

This commit is contained in:
2020-07-15 12:45:30 +00:00
parent 1e785d7400
commit b8d46d3768
3 changed files with 364 additions and 4 deletions

View File

@@ -69,6 +69,22 @@ namespace VEPROMS.CSLA.Library
}
}
}
// B2020-091: If deleting a section that has transitions pointing to it, show list:
else if (ex.Message.Contains("has External Transitions to Section"))
{
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ItemID))
{
DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this section and cannot be adjusted automatically." +
"\r\n\r\nDo you want to be placed at the " + (exTrans.Count > 1 ? "first " : "") + "location with the problem Transition?" +
"\r\n\r\nLocations with Problem Transitions" +
exTrans.Summarize(),
"Cannot Delete This Section", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
return exTrans[0].MyContent.ContentItems[0];
}
}
}
else if (ex.Message.Contains("has External Transitions to it's children"))
{
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ItemID))