diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index e85051ea..fbc49538 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -4541,6 +4541,12 @@ namespace VEPROMS.CSLA.Library public static ProcedureInfo GetNewLookup(object sender, TransitionLookupEventArgs args) { ProcedureInfo tmp = DataPortal.Fetch(new ItemAndChildrenByUnitCriteria(args.ProcID, 0, args.UnitID)); + if (tmp.MyDocVersion != null) + { + tmp.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitID; + (tmp.MyConfig as ProcedureConfig).SelectedSlave = args.UnitID; + ItemInfo.SetParentSectionAndDocVersion(tmp, tmp.MyDocVersion, null, tmp, tmp.MyDocVersion); + } return tmp; } // Criteria to get Item and children by unit diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs index 1e0ae880..d53f0f4b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs @@ -71,8 +71,8 @@ namespace VEPROMS.CSLA.Library tranLookup.AddProcLookup(myItemToID.MyProcedure.ItemID, ProcedureInfo.GetNewLookup(tranLookup, new TransitionLookupEventArgs(myItemToID.MyProcedure.ItemID, tranLookup.ApplicabilityUnit, MyItemToID.MyDocVersion, tranLookup)).MyLookup); if (tranLookup.ContainsKey(ToID)) myItemToID = tranLookup[ToID]; - //else - // Console.WriteLine("Transition May Not Be Correct at Location"); + else + _MyLog.WarnFormat("Invalid Unit Transition: from,to '{0}','{1}'", MyContent.ContentItems[0].ShortPath, myItemToID.ShortPath); } ItemInfo myItemRangeID = MyItemRangeID; if (tranLookup.ContainsKey(RangeID)) @@ -85,8 +85,9 @@ namespace VEPROMS.CSLA.Library tranLookup.AddProcLookup(MyItemRangeID.MyProcedure.ItemID, ProcedureInfo.GetNewLookup(tranLookup, new TransitionLookupEventArgs(MyItemRangeID.MyProcedure.ItemID, tranLookup.ApplicabilityUnit, MyItemRangeID.MyDocVersion, tranLookup)).MyLookup); if (tranLookup.ContainsKey(RangeID)) myItemRangeID = tranLookup[RangeID]; - //else - // Console.WriteLine("Transition May Not Be Correct at Location"); + else + if (myItemRangeID.ItemID != myItemToID.ItemID) + _MyLog.WarnFormat("Invalid Unit Range Transition: from,to '{0}','{1}'", MyContent.ContentItems[0].ShortPath, myItemRangeID.ShortPath); //Console.WriteLine("Format = {0}", item.ActiveFormat); //Console.WriteLine("item = {0}", item.ItemID); //Console.WriteLine("TranType = {0}", TranType);