Added GetCombinedSlaveValue method to correct how master unit values are obtained

This commit is contained in:
Rich 2014-01-10 03:12:50 +00:00
parent 15e744eb2c
commit c97f0d38e0

View File

@ -829,7 +829,7 @@ namespace VEPROMS.CSLA.Library
{
get
{
string s = _Xp["Unit", "Number"];// get the saved value
string s = GetCombinedSlaveValue("Number") ?? _Xp["Unit", "Number"];// get the saved value
if (SelectedSlave > 0)
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "Number"];
return s;
@ -863,7 +863,7 @@ namespace VEPROMS.CSLA.Library
{
get
{
string s = _Xp["Unit", "OtherNumber"];// get the saved value
string s = GetCombinedSlaveValue("OtherNumber") ?? _Xp["Unit", "OtherNumber"];// get the saved value
if (SelectedSlave > 0)
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "OtherNumber"];
return s;
@ -885,7 +885,7 @@ namespace VEPROMS.CSLA.Library
{
get
{
string s = _Xp["Unit", "Name"];// get the saved value
string s = GetCombinedSlaveValue("Name") ?? _Xp["Unit", "Name"];// get the saved value
if (SelectedSlave > 0)
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "Name"];
return s;
@ -907,7 +907,7 @@ namespace VEPROMS.CSLA.Library
{
get
{
string s = _Xp["Unit", "OtherName"];// get the saved value
string s = GetCombinedSlaveValue("OtherName") ?? _Xp["Unit", "OtherName"];// get the saved value
if (SelectedSlave > 0)
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "OtherName"];
return s;
@ -929,7 +929,7 @@ namespace VEPROMS.CSLA.Library
{
get
{
string s = _Xp["Unit", "Text"];// get the saved value
string s = GetCombinedSlaveValue("Text") ?? _Xp["Unit", "Text"];// get the saved value
if (SelectedSlave > 0)
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "Text"];
return s;
@ -951,7 +951,7 @@ namespace VEPROMS.CSLA.Library
{
get
{
string s = _Xp["Unit", "OtherText"];// get the saved value
string s = GetCombinedSlaveValue("OtherText") ?? _Xp["Unit", "OtherText"];// get the saved value
if (SelectedSlave > 0)
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "OtherText"];
return s;
@ -973,7 +973,7 @@ namespace VEPROMS.CSLA.Library
{
get
{
string s = _Xp["Unit", "ID"];// get the saved value
string s = GetCombinedSlaveValue("ID") ?? _Xp["Unit", "ID"];// get the saved value
if (SelectedSlave > 0)
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "ID"];
return s;
@ -995,7 +995,7 @@ namespace VEPROMS.CSLA.Library
{
get
{
string s = _Xp["Unit", "OtherID"];// get the saved value
string s = GetCombinedSlaveValue("OtherID") ?? _Xp["Unit", "OtherID"];// get the saved value
if (SelectedSlave > 0)
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "OtherID"];
return s;
@ -1017,7 +1017,7 @@ namespace VEPROMS.CSLA.Library
{
get
{
string s = _Xp["Unit", "ProcedureNumber"];// get the saved value
string s = GetCombinedSlaveValue("ProcedureNumber") ?? _Xp["Unit", "ProcedureNumber"];// get the saved value
if (SelectedSlave > 0)
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "ProcedureNumber"];
return s;
@ -1039,7 +1039,7 @@ namespace VEPROMS.CSLA.Library
{
get
{
string s = _Xp["ProcedureSet", "Name"];// get the saved value
string s = GetCombinedSlaveValue("SetName") ?? _Xp["ProcedureSet", "Name"];// get the saved value
if (SelectedSlave > 0)
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "SetName"];
return s;
@ -1061,7 +1061,7 @@ namespace VEPROMS.CSLA.Library
{
get
{
string s = _Xp["ProcedureSet", "ID"];// get the saved value
string s = GetCombinedSlaveValue("SetID") ?? _Xp["ProcedureSet", "ID"];// get the saved value
if (SelectedSlave > 0)
s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "SetID"];
return s;
@ -1639,5 +1639,24 @@ OnPropertyChanged("Default_BkColor");
return k;
}
}
//added by jcb to fix master issue byron/braidwood
private string GetCombinedSlaveValue(string item)
{
if (MaxSlaveIndex > 0)
{
string s = "";
string sep = "";
XmlNodeList nl = _Xp.XmlContents.SelectNodes("//Slave");
foreach (XmlNode nd in nl)
{
string ss = nd.Attributes.GetNamedItem("index").InnerText;
s += sep + _Xp["Slave[@index='" + ss + "']", item];
sep = ",";
}
return s;
}
return null;
}
//end added by jcb to fix master issue byron/braidwood
}
}