From 65dd986027b52b475221fef4cfe50caf04507fdb Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 18 Dec 2013 16:42:52 +0000 Subject: [PATCH] =?UTF-8?q?Handle=20tabs=20defined=20in=20format=20as=20{L?= =?UTF-8?q?NK=20Step=20Num}=20=20for=20deviation=20documents=20If=20can?= =?UTF-8?q?=E2=80=99t=20find=20an=20edit=20window,=20for=20example=20from?= =?UTF-8?q?=20search=20results=20that=20list=20=E2=80=98hidden=E2=80=99=20?= =?UTF-8?q?data,=20give=20message=20=E2=80=93not=20crash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs | 4 +++- PROMS/Volian.Controls.Library/StepTabPanel.cs | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 2b954703..cf3b2d74 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2484,7 +2484,9 @@ namespace VEPROMS.CSLA.Library tbformat = FormatStepData.TabData.IdentEdit; if (ActiveFormat.Name.ToUpper() == "WCNCKL" && FormatStepData.StepLayoutData.AlignWithParentTab) tbformat = tbformat.TrimStart(" ".ToCharArray()); } - if ((ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) + if (((ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) || + ((ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations)) + { if (tbformat.Contains("{LNK C/N Num}")) { diff --git a/PROMS/Volian.Controls.Library/StepTabPanel.cs b/PROMS/Volian.Controls.Library/StepTabPanel.cs index 7962169e..c6825900 100644 --- a/PROMS/Volian.Controls.Library/StepTabPanel.cs +++ b/PROMS/Volian.Controls.Library/StepTabPanel.cs @@ -57,6 +57,11 @@ namespace Volian.Controls.Library set { _MyStepPanel.SelectedEditItem = _MyStepPanel.GetEditItem(value); + if (_MyStepPanel.SelectedEditItem == null) + { + MessageBox.Show("The selected item is not available in the editor. One possible cause is that the data is 'not editable', check the section properties 'Editable Data' checkbox.", "Inaccessible Data", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + return; + } if (_MyStepPanel.SelectedEditItem != null) _MyStepPanel.SelectedEditItem.ItemSelect(); if (!_MyStepPanel.ItemSelectionChangeShown) _MyStepPanel.OnItemSelectedChanged(this, new ItemSelectedChangedEventArgs(_MyStepPanel.SelectedEditItem));