From d97b6bccf5ee273774de73dc13c02983ee02654b Mon Sep 17 00:00:00 2001 From: John Date: Wed, 21 Mar 2018 18:57:07 +0000 Subject: [PATCH] =?UTF-8?q?B2018-054=20Added=20a=20HasSectionContent=20met?= =?UTF-8?q?hod=20to=20tell=20us=20if=20a=20section=20has=20sub-sections=20?= =?UTF-8?q?(used=20in=20frmSectionProperties.cs)=20B2018-054=20Don?= =?UTF-8?q?=E2=80=99t=20allow=20user=20to=20change=20a=20step=20section=20?= =?UTF-8?q?(with=20no=20steps)=20to=20a=20word=20section,=20if=20that=20se?= =?UTF-8?q?ction=20has=20sub=20sections?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/VEPROMS User Interface/frmSectionProperties.cs | 2 +- PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index 5e7f0b14..017c44b4 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -89,7 +89,7 @@ namespace VEPROMS PlantFormat pf = (ppCmbxFormat.SelectedIndex != -1) ? FormatInfoList.SortedFormatInfoList[ppCmbxFormat.SelectedIndex].PlantFormat : (_SectionConfig.MyFormat != null) ? _SectionConfig.MyFormat.PlantFormat : _SectionConfig.MyDefaultFormat.PlantFormat; ItemInfo ii = ItemInfo.Get(_SectionConfig.MySection.ItemID); // if creating a new section, enable the StepSect and WordSect radio buttons - bool isNewSection = !(ii.HasWordContent || ii.HasStepContent); + bool isNewSection = !(ii.HasWordContent || ii.HasStepContent || ii.HasSectionContent); // B2018-054 added check for sub sections int numStepSects = 0; int numWordSects = 0; foreach (DocStyle nds in pf.DocStyles.DocStyleListActive) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index 9fcb3a30..88d0e506 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -3392,6 +3392,16 @@ namespace VEPROMS.CSLA.Library return true; } } + // B2018-054 added check for sub sections - fixes issue of added a new section (step section) then adding sub-section, then changing main section to word section + public bool HasSectionContent + { + get + { + if (MyContent.ContentPartCount == 0) return false; + if (MyContent.ContentPartCount == 1 && MyContent.ContentParts[0].PartType == E_FromType.Section) return true; + return false; + } + } private ProcedureInfo _MyProcedure; public ProcedureInfo MyProcedure {