B2017-268: Fix crash when creating a new enhanced procedure & linking an existing source procedure to it when the Procedure Numbers were different.

This commit is contained in:
Kathy Ruffing 2017-12-04 17:05:35 +00:00
parent 12fb3abab0
commit 7dfd2d9738

View File

@ -1784,6 +1784,19 @@ namespace VEPROMS.CSLA.Library
}
else if (IsProcedure)
{
// To fix B2017-268 the order of the following 2 'usings' had to be changed and the
// Content.Number had to be set in the enhanced.
using (Item ei = Item.Get(enhii.ItemID))
{
ProcedureConfig sc = enhii.MyConfig as ProcedureConfig;
sc.AddEnhancedDocument(0, this.ItemID);
sc.SaveEnhancedDocuments();
ei.MyContent.Number = MyContent.Number;
ei.MyContent.Text = DisplayText;
ei.MyContent.Config = sc.ToString();
ei.Save();
enhii.RefreshConfig();
}
using (Item ii = this.Get())
{
ProcedureConfig sc = this.MyConfig as ProcedureConfig;
@ -1793,16 +1806,6 @@ namespace VEPROMS.CSLA.Library
ii.Save();
RefreshConfig();
}
using (Item ei = Item.Get(enhii.ItemID))
{
ProcedureConfig sc = enhii.MyConfig as ProcedureConfig;
sc.AddEnhancedDocument(0, this.ItemID);
sc.SaveEnhancedDocuments();
ei.MyContent.Text = DisplayText;
ei.MyContent.Config = sc.ToString();
ei.Save();
enhii.RefreshConfig();
}
}
}
#endregion