From 4d24f93f3a71c66ede6cc086533b5609ce32749b Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 4 Apr 2012 16:16:36 +0000 Subject: [PATCH] --- .../VEPROMS.CSLA.Library/Config/ProcConfig.cs | 12 ++++----- .../Config/SectionConfig.cs | 26 ++++++++++++++++--- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs index 4e8e10c9..d8b47465 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs @@ -222,14 +222,14 @@ namespace VEPROMS.CSLA.Library { get { - string s = _Xp["format", "columns"]; + string s = _Xp["Format", "Columns"]; //If there is no value to get, then get the parent value (a.k.a. default value). if (s == string.Empty) - s = _Xp.ParentValue("format", "columns"); // get the parent value + s = _Xp.ParentValue("Format", "Columns"); // get the parent value // If there is no parent value, then use the volian default if (s == string.Empty) - return FormatColumns.Default;// default to volian default + return FormatColumns.TwoColumn;// At the procedure level, default to Two column return (FormatColumns)int.Parse(s); } @@ -238,15 +238,15 @@ namespace VEPROMS.CSLA.Library // if value being saved is same as the parent value, then clear the value (save blank). This will // reset the data to use the parent value. - string parval = _Xp.ParentValue("format", "columns"); // get the parent value + string parval = _Xp.ParentValue("Format", "Columns"); // get the parent value if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default parval = ((int)(FormatColumns.Default)).ToString(); if (parval.Equals(((int)value).ToString())) - _Xp["format", "columns"] = string.Empty; // reset to parent value + _Xp["Format", "Columns"] = string.Empty; // reset to parent value else - _Xp["format", "columns"] = ((int)value).ToString(); // save selected value + _Xp["Format", "Columns"] = ((int)value).ToString(); // save selected value OnPropertyChanged("Format_Columns"); } diff --git a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs index c49aa1c3..7252d588 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs @@ -470,9 +470,29 @@ namespace VEPROMS.CSLA.Library rval = (int)MyDefaultFormat.MyStepSectionLayoutData.PMode; //return (SectionColumnMode)rval; } - // if no pmode is defined, i.e. rval = 0, then default to single column - // this is what 16bit ve-proms did. - if (rval == 0) rval = 1; + // if no pmode is defined, i.e. rval = 0, then go up to the procedure level & get + // it's format column. + if (rval == 0) + { + SectionInfo si = _SectionInfo != null? _SectionInfo: SectionInfo.Get(_Section.ItemID); + if (si != null) + { + switch (si.MyProcedure.ProcedureConfig.Format_Columns) + { + case FormatColumns.OneColumn: + return SectionColumnMode.One; + break; + case FormatColumns.TwoColumn: + return SectionColumnMode.Two; + break; + default: + return SectionColumnMode.One; + break; + } + } + else + return SectionColumnMode.One; // 16bit's default if nothing defined + } return (SectionColumnMode)rval; } else