diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs index 8ea5ff1f..2eac4140 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs @@ -45,6 +45,7 @@ namespace VEPROMS.CSLA.Library public int ParentID; public rochild[] children; }; + // rogrp defines tree structure public struct rogrp { public int ID; @@ -53,19 +54,27 @@ namespace VEPROMS.CSLA.Library public string value; public string appid; }; + // rochild can be read directory from the ro.fst. Read in from ro.fst as bytes. public struct rochild { public int ID; public int ParentID; public int type; - public string title; - public string roid; - public string appid; - public string value; + public string title; // gets used for treeview + public string roid; // roid unique identifier + public string appid; // accessory page id - user specified unique id + public string value; // return value, can be multiple values public rochild[] children; }; + // roChild is a container for rochild public class roChild { + //private static int _roChildUnique = 0; + //private static int roChildUnique + //{ get { return ++_roChildUnique; } } + //private int _MyRoChildUnique = roChildUnique; + //public int MyRoChildUnique // Absolutely Unique ID - Info + //{ get { return _MyRoChildUnique; } } rochild _MyChild; public rochild MyChild { @@ -86,7 +95,7 @@ namespace VEPROMS.CSLA.Library private string _ROValue = ""; private List lstRoValues; private List multiRoValues; - private Dictionary DictROVar = new Dictionary(); + private Dictionary DictROVar = new Dictionary(); //use this to find values within return value #endregion #region Constructors private ROFst _ROFst; @@ -162,12 +171,12 @@ namespace VEPROMS.CSLA.Library public roHdr myHdr; private int TableID; private Dictionary dicRos; - private Dictionary dicRosIntIDs; + // private Dictionary dicRosIntIDs; - not used private Dictionary dicRoDBs; public void Reset() { dicRos = null; - dicRosIntIDs = null; + //dicRosIntIDs = null; dicRoDBs = null; } #endregion @@ -175,29 +184,29 @@ namespace VEPROMS.CSLA.Library public void Close() { // remove the dictionary - if (dicRosIntIDs != null)dicRosIntIDs.Clear(); - dicRosIntIDs = null; + //if (dicRosIntIDs != null)dicRosIntIDs.Clear(); + //dicRosIntIDs = null; if (dicRos != null)dicRos.Clear(); dicRos = null; if (dicRoDBs != null) dicRoDBs.Clear(); dicRoDBs = null; } - private Dictionary _dicROAPIDLookup; - public string GetAccPageID(string roid) - { - if(_dicROAPIDLookup==null) - { - _dicROAPIDLookup = new Dictionary(); - if (_dicROAPID == null) - BuildROAPIDDictionary(); - foreach (string appid in _dicROAPID.Keys) - _dicROAPIDLookup.Add(_dicROAPID[appid].roid,appid); - } - String roidkey = roid.Substring(0, 12).ToUpper(); - if(_dicROAPIDLookup.ContainsKey(roidkey)) - return _dicROAPIDLookup[roidkey]; - return null; - } + //private Dictionary _dicROAPIDLookup; + //public string GetAccPageID(string roid) + //{ + // if(_dicROAPIDLookup==null) + // { + // _dicROAPIDLookup = new Dictionary(); + // if (_dicROAPID == null) + // BuildROAPIDDictionary(); + // foreach (string appid in _dicROAPID.Keys) + // _dicROAPIDLookup.Add(_dicROAPID[appid].roid,appid); + // } + // String roidkey = roid.Substring(0, 12).ToUpper(); + // if(_dicROAPIDLookup.ContainsKey(roidkey)) + // return _dicROAPIDLookup[roidkey]; + // return null; + //} public List GetValueDifferences(ROFSTLookup origROFst, ref List delList) { // use this list to see what differences are between it and the original @@ -644,7 +653,7 @@ namespace VEPROMS.CSLA.Library // the first RO with a specific id will be found regardless of the RO Database id. //public rochild GetRoChildFromID(int id) //{ - // if (dicRosIntIDs == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); + // if (dicRosIntIDs == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); // // Use the id to get the value from the dictionary // if (dicRosIntIDs.ContainsKey(id)) // { @@ -893,10 +902,10 @@ namespace VEPROMS.CSLA.Library { foreach (rochild child in tmp.children) if (!dicRos.ContainsKey(child.roid.ToUpper())) - dicRos.Add(child.roid.ToUpper(), child); + dicRos.Add(child.roid.ToUpper(), child); // child is a struct not a class. } dicRos.Add(tmp.roid.ToUpper(), tmp); - if (!dicRosIntIDs.ContainsKey(tmp.ID)) dicRosIntIDs.Add(tmp.ID, tmp); + //if (!dicRosIntIDs.ContainsKey(tmp.ID)) dicRosIntIDs.Add(tmp.ID, tmp); int j; for (j = i - 1; j >= 0 && tmp.ID < myGrp.children[j].ID; j--) { @@ -966,7 +975,7 @@ namespace VEPROMS.CSLA.Library private void ParseIntoDictionary(byte[] ab) { if (dicRos == null) dicRos = new Dictionary(); - if (dicRosIntIDs == null) dicRosIntIDs = new Dictionary(); + //if (dicRosIntIDs == null) dicRosIntIDs = new Dictionary(); if (dicRoDBs == null) dicRoDBs = new Dictionary(); myHdr.hSize = BitConverter.ToInt32(ab, 0); @@ -1202,7 +1211,7 @@ namespace VEPROMS.CSLA.Library else { List children = new List(); - children.Add(new roChild(child)); + children.Add(new roChild(child)); // adding entries to this dictionary for every ro!! _ValueLookupDictionary.Add(value, children); } }