Assign variable mstr based on unit

Changed return values of Evaluate method for U case to support multi units
Changed return values of Evaluate method for S case to support multi units
Changed return value based on selected unit
Added MultiUnitCount property to DocVersion class
Added UnitNames property to DocVersion class
Removed blank line
This commit is contained in:
Rich 2012-12-04 22:56:47 +00:00
parent e086c88bb8
commit bdf8150326

View File

@ -194,7 +194,9 @@ namespace VEPROMS.CSLA.Library
//GetPrivateProfileString("unit", "procedure number", asis, mstr, MAXPATH, "proc.ini");
string pnum = asis;
string mstr = GetProfile("Unit", "ProcedureNumber", true);
//rhm/jcb stuff 20120511
//string mstr = GetProfile("Unit", "ProcedureNumber", true);
string mstr = DocVersionConfig.Unit_ProcedureNumber;
if (mstr != null && !mstr.Equals(string.Empty))
pnum = mstr;
if (pnum.Equals(asis))
@ -263,10 +265,26 @@ namespace VEPROMS.CSLA.Library
switch (swhir[swptr])
{
case 'U':
retval = GetProfile("Unit", substr, true);
//retval = GetProfile("Unit", substr, true);
if (substr.ToLower() == "id")
retval = this.DocVersionConfig.Unit_ID;
if (substr.ToLower() == "name")
retval = this.DocVersionConfig.Unit_Name;
if (substr.ToLower() == "number")
retval = this.DocVersionConfig.Unit_Number;
if (substr.ToLower() == "text")
retval = this.DocVersionConfig.Unit_Text;
//retval = this.DocVersionConfig.Other_Unit_ID;
//retval = this.DocVersionConfig.Other_Unit_Name;
//retval = this.DocVersionConfig.Other_Unit_Number;
//retval = this.DocVersionConfig.Other_Unit_Text;
break;
case 'S':
retval = GetProfile("Procedure_Set", substr, true);
//retval = GetProfile("Procedure_Set", substr, true);
if(substr.ToLower() == "id")
retval = this.DocVersionConfig.Unit_ProcedureSetID;
if (substr.ToLower() == "name")
retval = this.DocVersionConfig.Unit_ProcedureSetName;
break;
case 'P':
//TODO: THIS IS A GLOBAL IN THE 16 BIT CODE!!!!
@ -282,11 +300,11 @@ namespace VEPROMS.CSLA.Library
}
else if (len == 1 && (str.ToUpper())[0] == 'U')
{
retval = GetProfile("Unit", "Number");
retval = this.DocVersionConfig.Unit_Number;
}
else if (len == 2 && str.StartsWith("ID"))
{
retval = GetProfile("Unit", "ID");
retval = this.DocVersionConfig.Unit_ID;
}
// if the return value is empty, then the resulting
// evaluation should repeat the token string including
@ -488,8 +506,40 @@ namespace VEPROMS.CSLA.Library
return false;
}
}
public int MultiUnitCount
{
get
{
return DocVersionConfig.Unit_Count;
}
}
private string[] _UnitNames;
public string[] UnitNames
{
get
{
if (_UnitNames == null)
{
// _UnitNames = DocVersionConfig.Unit_Name.Split(',');
_UnitNames = new string[DocVersionConfig.Unit_Count];
int j = 0;
for (int k = 1; k <= DocVersionConfig.MaxSlaveIndex; k++)
{
DocVersionConfig.SelectedSlave = k;
try
{
_UnitNames[j] = DocVersionConfig.Unit_Name;
j++;
}
catch
{
}
}
}
return _UnitNames;
}
}
}
public enum VersionTypeEnum : int
{
WorkingDraft = 0, Temporary = 1, Revision = 128, Approved = 129