Handle exception if external transition to a procedure.

This commit is contained in:
Rich 2015-03-10 10:10:56 +00:00
parent 3ef663d7e3
commit 7e10163760
3 changed files with 35 additions and 1 deletions

View File

@ -1367,6 +1367,7 @@ namespace VEPROMS.CSLA.Library
if (!HandleSqlExceptionOnCopy(ex))
{
if (ex.Message.Contains("has External Transitions and has no next step")
|| ex.Message.Contains("has External Transitions to Procedure")
|| ex.Message.Contains("has External Transitions to it's children")
|| ex.Message.Contains("This step has been deleted")
)

View File

@ -793,6 +793,24 @@ namespace Volian.Controls.Library
SetFocus();
}
}
else if (ex.Message.Contains("has External Transitions to Procedure"))
{
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitions(MyID))
{
DialogResult ans = MessageBox.Show("Transitions exist to this procedure." +
"\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" +
"\r\n\r\nSubsteps with Problem Transitions" +
exTrans.Summarize(),
"Cannot Delete This Procedure", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]);
}
else
SetFocus();
}
}
else if (ex.Message.Contains("has External Transitions to it's children"))
{
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID))

View File

@ -2271,6 +2271,21 @@ namespace Volian.Controls.Library
}
}
}
else if (ex.Message.Contains("has External Transitions to Procedure"))
{
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitions(ii.ItemID))
{
DialogResult ans = MessageBox.Show("Transitions exist to this procedure and cannot be adjusted automatically." +
"\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" +
"\r\n\r\nSubsteps with Problem Transitions" +
exTrans.Summarize(),
"Cannot Delete This Procedure", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (ans == DialogResult.Yes)
{
OnOpenItem(this, new vlnTreeItemInfoEventArgs(exTrans[0].MyContent.ContentItems[0]));
}
}
}
else if (ex.Message.Contains("has External Transitions to it's children"))
{
using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ii.ItemID))