From 201cac2c54dbd72ab8d31b512711b001573c8876 Mon Sep 17 00:00:00 2001 From: Rich Date: Tue, 4 Dec 2012 22:52:55 +0000 Subject: [PATCH] Changes ProcedureConfig class to implement IItemConfig interface Added SelectedSlave property to ProcedureConfig class Changed Print_Rev property to support multi units Changed Print_RevDate property to support multi units Added Print_ReviewDate property to ProcedureConfig class Added interface IItemConfig Added MasterSlave_Applicability property to IItemConfig Added Applicability_Index property to RevisionConfig class --- .../VEPROMS.CSLA.Library/Config/ProcConfig.cs | 78 +++++++++++++++++-- .../Config/RevisionConfig.cs | 23 ++++++ 2 files changed, 96 insertions(+), 5 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs index b3ebb3f5..cd165634 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs @@ -8,7 +8,7 @@ namespace VEPROMS.CSLA.Library { [Serializable] [TypeConverter(typeof(ExpandableObjectConverter))] - public class ProcedureConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged + public class ProcedureConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged, IItemConfig { #region DynamicTypeDescriptor internal override bool IsReadOnly @@ -101,6 +101,13 @@ namespace VEPROMS.CSLA.Library _Xp.AncestorLookup = true; if (procedureInfo.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder); } + private int _SelectedSlave = 0; + //[Browsable(false)] + public int SelectedSlave + { + get { return _SelectedSlave; } + set { _SelectedSlave = value; } + } public ProcedureConfig(string xml) { if (xml == string.Empty) xml = ""; @@ -280,11 +287,17 @@ namespace VEPROMS.CSLA.Library { get { - return _Xp["Procedure", "Rev"]; + string s = _Xp["Procedure", "Rev"]; + if (SelectedSlave > 0) + s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "Rev"]; + return s; } set { - _Xp["Procedure", "Rev"] = value; + if (SelectedSlave > 0) + _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "Rev"] = value; // save selected value + else + _Xp["Procedure", "Rev"] = value; OnPropertyChanged("Print_Rev"); } } @@ -298,14 +311,43 @@ namespace VEPROMS.CSLA.Library { get { - return _Xp["Procedure", "RevDate"]; + string s = _Xp["Procedure", "RevDate"]; + if (SelectedSlave > 0) + s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "RevDate"]; + return s; } set { - _Xp["Procedure", "RevDate"] = value; + if (SelectedSlave > 0) + _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "RevDate"] = value; // save selected value + else + _Xp["Procedure", "RevDate"] = value; OnPropertyChanged("Print_RevDate"); } } + [Category("Print Settings")] //Note that this print setting is stored under 'Procedure' element + [Browsable(false)] + [DisplayName("Review Date")] + [RefreshProperties(RefreshProperties.All)] + [Description("Review Date")] + public string Print_ReviewDate + { + get + { + string s = _Xp["Procedure", "ReviewDate"]; + if (SelectedSlave > 0) + s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "ReviewDate"]; + return s; + } + set + { + if (SelectedSlave > 0) + _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "ReviewDate"] = value; // save selected value + else + _Xp["Procedure", "ReviewDate"] = value; + OnPropertyChanged("Print_ReviewDate"); + } + } [Category("Print Settings")] //PROPGRID: Hide Number of Copies [Browsable(false)] @@ -727,5 +769,31 @@ namespace VEPROMS.CSLA.Library } } #endregion + + #region IItemConfig Members + + [Category("Master/Slave Settings")] + [DisplayName("Applicability")] + [RefreshProperties(RefreshProperties.All)] + [Description("Scope Applicability")] + public Volian.Base.Library.BigNum MasterSlave_Applicability + { + get + { + string s = _Xp["MasterSlave", "Applicability"]; + return new Volian.Base.Library.BigNum(s); + } + set + { + _Xp["MasterSlave", "Applicability"] = value.FlagList; + OnPropertyChanged("MasterSlave_Applicability"); + } + } + + #endregion + } + public interface IItemConfig + { + Volian.Base.Library.BigNum MasterSlave_Applicability { get; set;} } } diff --git a/PROMS/VEPROMS.CSLA.Library/Config/RevisionConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/RevisionConfig.cs index 13982b09..fa320e08 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/RevisionConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/RevisionConfig.cs @@ -84,6 +84,29 @@ namespace VEPROMS.CSLA.Library OnPropertyChanged("History_StartDate"); } } + //jcb 20120618 + [Category("Applicability")] + [Browsable(false)] + [DisplayName("Index")] + [RefreshProperties(RefreshProperties.All)] + [Description("Index for unit")] + public int Applicability_Index + { + get + { + string s = _Xp["Applicability", "Index"]; + if (s == string.Empty) return 0; + return int.Parse(s); + } + set + { + string s = _Xp["Applicability", "Index"]; + if (s == value.ToString()) return; + _Xp["Applicability", "Index"] = value.ToString(); + OnPropertyChanged("Applicability_Index"); + } + } + //end jcb 20120618 public void Save() { if (_Revision != null)