|
|
@@ -2508,11 +2508,28 @@ namespace VEPROMS.CSLA.Library
|
|
|
|
firstTrans = false;
|
|
|
|
firstTrans = false;
|
|
|
|
if (!CanDeleteObject())
|
|
|
|
if (!CanDeleteObject())
|
|
|
|
throw new System.Security.SecurityException("User not authorized to remove a Item");
|
|
|
|
throw new System.Security.SecurityException("User not authorized to remove a Item");
|
|
|
|
|
|
|
|
// B2016-009 check source and desintation types and display message box if needed
|
|
|
|
|
|
|
|
// C2022-017 moved the CheckSourceDestinationType call to btnPasteReplace_Click in StepTabRibbon
|
|
|
|
|
|
|
|
// B2023-101 Handle Paste Replace when procedure to be replaced has Incoming Transitions, i.e. do a separate try/catch for this case
|
|
|
|
|
|
|
|
ItemInfo newItemInfo = null;
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); //itemInfo.ItemID, itemInfo.MyContent.Type, itemInfo.MyContent.Type);
|
|
|
|
|
|
|
|
if (newItemInfo == null) return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (ex1.Message.Contains("has External Transitions and has no next step")
|
|
|
|
|
|
|
|
|| ex1.Message.Contains("has External Transitions to Procedure")
|
|
|
|
|
|
|
|
|| ex1.Message.Contains("has External Transitions to it's children"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
FlexibleMessageBox.Show("This procedure has external transition references to it that must be resolved before doing the Paste/Replace.\r\nRight Click on the procedure and select the Incoming Transitions menu option to find these references and resolve them.", "Paste Replace Failed", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// B2016-009 check source and desintation types and display message box if needed
|
|
|
|
|
|
|
|
// C2022-017 moved the CheckSourceDestinationType call to btnPasteReplace_Click in StepTabRibbon
|
|
|
|
|
|
|
|
ItemInfo newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); //itemInfo.ItemID, itemInfo.MyContent.Type, itemInfo.MyContent.Type);
|
|
|
|
|
|
|
|
// Delete business objects, including remove from tree
|
|
|
|
// Delete business objects, including remove from tree
|
|
|
|
ItemInfo.DeleteItemInfoAndChildren(itemInfo.ItemID); // Dispose ItemInfo and Children
|
|
|
|
ItemInfo.DeleteItemInfoAndChildren(itemInfo.ItemID); // Dispose ItemInfo and Children
|
|
|
|
using (Item item = Get(newItemInfo.ItemID)) ItemInfo.Refresh(item);
|
|
|
|
using (Item item = Get(newItemInfo.ItemID)) ItemInfo.Refresh(item);
|
|
|
|