B2017-179 detect if Paste/Replace was aborted due to Transition references and user had selected to go to the first transition that needs attention.
The Paste/Replace method can now return a NULL, so we needed to handle that.
This commit is contained in:
parent
738ea466b6
commit
d228ca58dc
@ -2334,6 +2334,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
#region PasteReplace
|
#region PasteReplace
|
||||||
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid)
|
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid)
|
||||||
{
|
{
|
||||||
|
bool tmp= false;
|
||||||
|
return PasteReplace(itemInfo, copyStartID, chgid, ref tmp);
|
||||||
|
}
|
||||||
|
// B2017-179 return a bool (firstTrans) if we could not replace the step but the user wants to position to the first transition that needs resolved
|
||||||
|
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, ref bool firstTrans)
|
||||||
|
{
|
||||||
|
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");
|
||||||
try
|
try
|
||||||
@ -2378,7 +2385,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
{
|
{
|
||||||
ItemInfo iii = itemInfo.HandleSqlExceptionOnDelete(ex);
|
ItemInfo iii = itemInfo.HandleSqlExceptionOnDelete(ex);
|
||||||
if (iii == itemInfo) return null;// If self returned then return null
|
if (iii == itemInfo) return null;// If self returned then return null
|
||||||
if (iii != null) return iii;
|
if (iii != null)
|
||||||
|
{
|
||||||
|
firstTrans = true; // B2017-179 set the firstTrans to true and return the itminfo of the first transition location that needs resolved
|
||||||
|
return iii;
|
||||||
|
}
|
||||||
if (!HandleSqlExceptionOnCopy(ex))
|
if (!HandleSqlExceptionOnCopy(ex))
|
||||||
{
|
{
|
||||||
if (ex.Message.Contains("has External Transitions and has no next step")
|
if (ex.Message.Contains("has External Transitions and has no next step")
|
||||||
|
@ -527,6 +527,7 @@ namespace Volian.Controls.Library
|
|||||||
break;
|
break;
|
||||||
case ItemInfo.EAddpingPart.Replace:
|
case ItemInfo.EAddpingPart.Replace:
|
||||||
EditItem ei = edtitm.PasteReplace(copyStartID);
|
EditItem ei = edtitm.PasteReplace(copyStartID);
|
||||||
|
if (ei == null) return false; //B2017-179 PasteReplace will return null if was aborted
|
||||||
if (ei.MyItemInfo.ItemID != edtitm.MyItemInfo.ItemID)
|
if (ei.MyItemInfo.ItemID != edtitm.MyItemInfo.ItemID)
|
||||||
{
|
{
|
||||||
edtitm.Dispose();
|
edtitm.Dispose();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user