CSLA Config cleanup
This commit is contained in:
@@ -159,16 +159,13 @@ namespace VEPROMS.CSLA.Library
|
||||
private int _totalRoCnt = 0;
|
||||
private double _pctComplete = 0;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
#region Properties
|
||||
|
||||
public int RofstID
|
||||
{
|
||||
get { return _rofstID; }
|
||||
}
|
||||
public int RofstID => _rofstID;
|
||||
|
||||
public DocVersionInfo MyDocVersionInfo
|
||||
public DocVersionInfo MyDocVersionInfo
|
||||
{
|
||||
get { return _myDocVersionInfo; }
|
||||
set
|
||||
@@ -178,14 +175,11 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
|
||||
// C2021-065 see if we need to get the RO information for the "Other" Child applicability value
|
||||
public int SelectedSlave
|
||||
{
|
||||
get { return (!string.IsNullOrEmpty(_otherChild)) ? Convert.ToInt32(_otherChild) : _selectedSlave; }
|
||||
}
|
||||
// C2021-065 see if we need to get the RO information for the "Other" Child applicability value
|
||||
public int SelectedSlave => (!string.IsNullOrEmpty(_otherChild)) ? Convert.ToInt32(_otherChild) : _selectedSlave;
|
||||
|
||||
//C2021-065 used by Barakah Alarms so that we get ROLookUp for the Other applicability
|
||||
public string OtherChild
|
||||
//C2021-065 used by Barakah Alarms so that we get ROLookUp for the Other applicability
|
||||
public string OtherChild
|
||||
{
|
||||
get { return _otherChild; }
|
||||
set { _otherChild = value; }
|
||||
@@ -237,16 +231,13 @@ namespace VEPROMS.CSLA.Library
|
||||
set { _autoCombineSingleRetValues = value; }
|
||||
}
|
||||
|
||||
public bool ShowLoadingStatus
|
||||
{
|
||||
get { return _showLoadingStatus; }
|
||||
}
|
||||
public bool ShowLoadingStatus => _showLoadingStatus;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
#region Constructors
|
||||
|
||||
public ROFSTLookup(int rofstID, DocVersionInfo dvi, string otherChild, bool showLoadingStatus = true)
|
||||
public ROFSTLookup(int rofstID, DocVersionInfo dvi, string otherChild, bool showLoadingStatus = true)
|
||||
{
|
||||
// Set Fields/Properties
|
||||
_rofstID = rofstID;
|
||||
@@ -321,31 +312,19 @@ namespace VEPROMS.CSLA.Library
|
||||
return RofstDataSearch(_rofstID, value, searchTypeID, onlyRoid16, maxNumRecords);
|
||||
}
|
||||
|
||||
public ROFSTLookup.rochild[] GetRoChildrenByID(int id, int dbiID, bool loadChildren = false, bool loadAllChildren = false)
|
||||
{
|
||||
return RofstDataGetChildrenByID(_rofstID, dbiID, id, loadChildren, loadAllChildren);
|
||||
}
|
||||
public ROFSTLookup.rochild[] GetRoChildrenByID(int id, int dbiID, bool loadChildren = false, bool loadAllChildren = false) => RofstDataGetChildrenByID(_rofstID, dbiID, id, loadChildren, loadAllChildren);
|
||||
|
||||
public ROFSTLookup.rochild[] GetRoChildrenByRoid(string roid, bool loadChildren = false, bool loadAllChildren = false)
|
||||
{
|
||||
return RofstDataGetChildrenByRoid(_rofstID, roid, loadChildren, loadAllChildren);
|
||||
}
|
||||
public ROFSTLookup.rochild[] GetRoChildrenByRoid(string roid, bool loadChildren = false, bool loadAllChildren = false) => RofstDataGetChildrenByRoid(_rofstID, roid, loadChildren, loadAllChildren);
|
||||
|
||||
public ROFSTLookup.rochild[] GetRoChildrenByType(E_ROValueType valueTypes, bool loadChildren = false, bool loadAllChildren = false)
|
||||
{
|
||||
return RofstDataGetRoChildrenByType(_rofstID, valueTypes, loadChildren, loadAllChildren);
|
||||
}
|
||||
public ROFSTLookup.rochild[] GetRoChildrenByType(E_ROValueType valueTypes, bool loadChildren = false, bool loadAllChildren = false) => RofstDataGetRoChildrenByType(_rofstID, valueTypes, loadChildren, loadAllChildren);
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region (RO Database Info)
|
||||
#region (RO Database Info)
|
||||
|
||||
public int GetRODatabaseTitleIndex(string roid)
|
||||
{
|
||||
return Convert.ToInt32("0x" + roid.Substring(0, 4), 16);
|
||||
}
|
||||
public int GetRODatabaseTitleIndex(string roid) => Convert.ToInt32("0x" + roid.Substring(0, 4), 16);
|
||||
|
||||
public string GetRODatabaseTitle(int idx)
|
||||
public string GetRODatabaseTitle(int idx)
|
||||
{
|
||||
ROFSTLookup.rodbi rd = RofstDataGetDatabaseByID(_rofstID, idx);
|
||||
return (!string.IsNullOrEmpty(rd.dbiTitle) ? rd.dbiTitle : "RO Database Title Not Found");
|
||||
@@ -358,16 +337,13 @@ namespace VEPROMS.CSLA.Library
|
||||
return (rd.dbiID > 0) ? rd : RofstDataGetDatabaseByID(_rofstID, 1, loadChildren, loadAllChildren);
|
||||
}
|
||||
|
||||
public ROFSTLookup.rodbi[] GetRODatabaseList(bool loadChildren = false, bool loadAllChildren = false)
|
||||
{
|
||||
return RofstDataGetDatabases(_rofstID, loadChildren, loadAllChildren);
|
||||
}
|
||||
public ROFSTLookup.rodbi[] GetRODatabaseList(bool loadChildren = false, bool loadAllChildren = false) => RofstDataGetDatabases(_rofstID, loadChildren, loadAllChildren);
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region (RO Info By AccPageID)
|
||||
#region (RO Info By AccPageID)
|
||||
|
||||
public string FormatAccPageKey(string accPageID)
|
||||
public string FormatAccPageKey(string accPageID)
|
||||
{
|
||||
string accPageBase = string.Empty;
|
||||
string accPageExt = string.Empty;
|
||||
@@ -527,12 +503,9 @@ namespace VEPROMS.CSLA.Library
|
||||
return (!string.IsNullOrEmpty(retval)) ? retval.Replace("\r\n", @"\par ") : retval;
|
||||
}
|
||||
|
||||
public List<string> GetValueDifferences(int originalRofstID, ref List<string> delList)
|
||||
{
|
||||
return RofstDataGetValueDifferences(originalRofstID, _rofstID, ref delList);
|
||||
}
|
||||
public List<string> GetValueDifferences(int originalRofstID, ref List<string> delList) => RofstDataGetValueDifferences(originalRofstID, _rofstID, ref delList);
|
||||
|
||||
public List<string> GetROTitleAndGroupPath(string roid, bool reportMissingROs, bool convertCaretToDelta)
|
||||
public List<string> GetROTitleAndGroupPath(string roid, bool reportMissingROs, bool convertCaretToDelta)
|
||||
{
|
||||
// Return the RO Title in a list of strings. The last item in the list is the actual RO title,
|
||||
// the items preceding it are the titles of the groups and sub-groups containing the RO
|
||||
@@ -616,26 +589,17 @@ namespace VEPROMS.CSLA.Library
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region (RO Info Helper Methods)
|
||||
#region (RO Info Helper Methods)
|
||||
|
||||
public static byte[] GetRofstLookupBytes(int rofstID)
|
||||
{
|
||||
return RofstDataGetRofstLookupBytes(rofstID);
|
||||
}
|
||||
public static byte[] GetRofstLookupBytes(int rofstID) => RofstDataGetRofstLookupBytes(rofstID);
|
||||
|
||||
public static DateTime GetRoFSTdts(int rofstID)
|
||||
{
|
||||
return GetRofstDtsByID(rofstID);
|
||||
}
|
||||
public static DateTime GetRoFSTdts(int rofstID) => GetRofstDtsByID(rofstID);
|
||||
|
||||
public DateTime GetRoFSTdts()
|
||||
{
|
||||
return GetRoFSTdts(_rofstID);
|
||||
}
|
||||
public DateTime GetRoFSTdts() => GetRoFSTdts(_rofstID);
|
||||
|
||||
public bool HasChildren(ref ROFSTLookup.rochild child)
|
||||
public bool HasChildren(ref ROFSTLookup.rochild child)
|
||||
{
|
||||
LoadChildren(ref child);
|
||||
return child.children.Any();
|
||||
@@ -666,12 +630,9 @@ namespace VEPROMS.CSLA.Library
|
||||
db.children = GetRoChildrenByID(db.ID, db.dbiID, false);
|
||||
}
|
||||
|
||||
public static ROFSTLookup.rochild GetEmptyRoChild()
|
||||
{
|
||||
return new ROFSTLookup.rochild() { ID = -1, type = 0 };
|
||||
}
|
||||
public static ROFSTLookup.rochild GetEmptyRoChild() => new ROFSTLookup.rochild() { ID = -1, type = 0 };
|
||||
|
||||
public static string CalculateDuration(DateTime dtStart)
|
||||
public static string CalculateDuration(DateTime dtStart)
|
||||
{
|
||||
string duration = string.Empty;
|
||||
|
||||
@@ -1736,31 +1697,6 @@ namespace VEPROMS.CSLA.Library
|
||||
|
||||
#region (Convert To Objects)
|
||||
|
||||
private ROFSTLookup.roHdr ConvertToRoHdrObject(SafeDataReader dr, bool loadChildren)
|
||||
{
|
||||
ROFSTLookup.roHdr rh = new ROFSTLookup.roHdr
|
||||
{
|
||||
hSize = (int)dr.GetValue("hSize"),
|
||||
hYear = (int)dr.GetValue("hYear"),
|
||||
hMonth = (byte)dr.GetValue("hMonth"),
|
||||
hDay = (byte)dr.GetValue("hDay"),
|
||||
hcYear = (int)dr.GetValue("hcYear"),
|
||||
hcMonth = (byte)dr.GetValue("hcMonth"),
|
||||
hcDay = (byte)dr.GetValue("hcDay"),
|
||||
hcHour = (byte)dr.GetValue("hcHour"),
|
||||
hcMin = (byte)dr.GetValue("hcMin"),
|
||||
hcSec = (byte)dr.GetValue("hcSec"),
|
||||
hcHund = (byte)dr.GetValue("hcHund")
|
||||
};
|
||||
|
||||
if (loadChildren)
|
||||
{
|
||||
rh.myDbs = RofstDataGetDatabases(_rofstID);
|
||||
}
|
||||
|
||||
return rh;
|
||||
}
|
||||
|
||||
private ROFSTLookup.rodbi ConvertToRodbiObject(SafeDataReader dr, bool loadChildren, bool loadAllChildren)
|
||||
{
|
||||
ROFSTLookup.rodbi rd = new ROFSTLookup.rodbi
|
||||
@@ -2202,12 +2138,9 @@ namespace VEPROMS.CSLA.Library
|
||||
return i;
|
||||
}
|
||||
|
||||
private int NextDelimiter(string delim, string str)
|
||||
{
|
||||
return (!string.IsNullOrEmpty(str)) ? str.IndexOfAny(delim.ToCharArray()) : -1;
|
||||
}
|
||||
private int NextDelimiter(string delim, string str) => (!string.IsNullOrEmpty(str)) ? str.IndexOfAny(delim.ToCharArray()) : -1;
|
||||
|
||||
private int MatchingBrace(string str)
|
||||
private int MatchingBrace(string str)
|
||||
{
|
||||
int level = 1;
|
||||
int idx = 0; // the while will skip the first position (the first brace)
|
||||
@@ -2426,7 +2359,7 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
if (match.Groups[2].Value != "1") // Other than "1", multiply it times 10 raised to a power
|
||||
{
|
||||
sb.Append(match.Groups[2].Value + "x10");
|
||||
sb.Append($"{match.Groups[2].Value}x10");
|
||||
}
|
||||
else // The number is simply 1 so it can be ignored and 10 can be raised to a power
|
||||
{
|
||||
@@ -2435,11 +2368,11 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
else // A number with a decimal point
|
||||
{
|
||||
sb.Append(match.Groups[2].Value + "." + match.Groups[3].Value + "x10");
|
||||
sb.Append($"{match.Groups[2].Value}.{match.Groups[3].Value}x10");
|
||||
}
|
||||
|
||||
// Add the exponent as superscript
|
||||
return sb.ToString() + "\\up2 " + match.Groups[4].Value.Replace("-", @"\u8209?") + match.Groups[5].Value + "\\up0 ";
|
||||
return $"{sb}\\up2 {match.Groups[4].Value.Replace("-", @"\u8209?")}{match.Groups[5].Value}\\up0 ";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user