From acec23a2807a4d2eff62d6b9f6f436ef65141a3b Mon Sep 17 00:00:00 2001 From: Kathy Date: Wed, 26 Jul 2017 13:18:01 +0000 Subject: [PATCH] F2017-036: For VCB: Additional Proprietary statement --- .../VEPROMS.CSLA.Library/Format/PageStyles.cs | 65 +++++++++++++++++++ .../Volian.Print.Library/VlnSvgPageHelper.cs | 16 +++++ 2 files changed, 81 insertions(+) diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PageStyles.cs b/PROMS/VEPROMS.CSLA.Library/Format/PageStyles.cs index abb144f4..b3b7878d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PageStyles.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PageStyles.cs @@ -84,6 +84,14 @@ namespace VEPROMS.CSLA.Library return (_Font == null) ?_Font = new VE_Font(XmlNode): _Font; } } + private RelatedItem _RelatedItem; + public RelatedItem RelatedItem + { + get + { + return (_RelatedItem == null) ? _RelatedItem = new RelatedItem(SelectSingleNode("RelatedItem")) : _RelatedItem; + } + } private LazyLoad _Token; [Category("Content")] [DisplayName("Content")] @@ -146,6 +154,7 @@ namespace VEPROMS.CSLA.Library } } #endregion + #region Override ToString public override string ToString() { @@ -157,4 +166,60 @@ namespace VEPROMS.CSLA.Library #endregion } #endregion + #region RelatedItem + // RelatedItem was added to allow a PSI logical to have an associated PSI item, and if both are + // selected the RelatedItem data changes where the item prints. This was implemented for + // F2017-036 - VCS. + [TypeConverter(typeof(ExpandableObjectConverter))] + public class RelatedItem : vlnFormatItem + { + #region Constructor + public RelatedItem(XmlNode xmlNode) : base(xmlNode) { } + public RelatedItem() : base() { } + #endregion + #region Business Methods + private LazyLoad _Token; + [Category("RelatedContent")] + [DisplayName("RelatedContent")] + [Description("Item RelatedContent")] + public string Token + { + get + { + return LazyLoad(ref _Token, "@Token"); + } + } + private LazyLoad _Row; + [Category("Location")] + [DisplayName("Vertical Position")] + [Description("Vertical Position")] + public float? Row + { + get + { + return LazyLoad(ref _Row, "@Row"); + } + } + private LazyLoad _Col; + [Category("Location")] + [DisplayName("Horizontal Position")] + [Description("Horizontal Position")] + public float? Col + { + get + { + return LazyLoad(ref _Col, "@Col"); + } + } + private LazyLoad _Justify; + public E_Justify? Justify + { + get + { + return LazyLoad(ref _Justify, "@Justify"); + } + } + #endregion + } + #endregion } diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs index f0eb2175..fb162844 100644 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs +++ b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs @@ -1309,7 +1309,23 @@ namespace Volian.Print.Library string val = procConfig.GetValue("PSI", pstok); int bindx = token.IndexOf("|", indx); if (val == "Y") + { val = token.Substring(qindx + 1, bindx - qindx - 1); + // F2017-036: see if there is a RelatedItem in this page item. RelatedItem allows for repositioning + // this current item if both items are set to be printed from the Procedure Specific Information. If both are printed + // the location of this item is defined in the RelatedItem xml. + if (pageItem.RelatedItem.Token != null) + { + // see if the related item is on this page also, if so, use the new row/col/justify: + string reltoken = pageItem.RelatedItem.Token; + string relval = procConfig.GetValue("PSI", reltoken); + if (relval == "Y") + { + svgGroup.Add(PageItemToSvgText(pageItem.Token, (float)pageItem.RelatedItem.Row, (float)pageItem.RelatedItem.Col, pageItem.RelatedItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, val, MySection)); + plstr = ""; // Clear it so it isn't put out twice (used below) + } + } + } else { int eindx = token.IndexOf("}", bindx);