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
This commit is contained in:
parent
4f8e69d232
commit
201cac2c54
@ -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 = "<Config/>";
|
||||
@ -280,10 +287,16 @@ 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
|
||||
{
|
||||
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
|
||||
{
|
||||
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;}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user