Removed GetRoChildFromID which was not working properly

Added GetROIDByAccPagID to get ROID from Accessory Page ID
This commit is contained in:
Rich 2011-01-20 20:20:10 +00:00
parent fbe94ed3a0
commit 5994bf2e4e

View File

@ -188,19 +188,21 @@ namespace VEPROMS.CSLA.Library
tmp.ID = -1; tmp.ID = -1;
return tmp; return tmp;
} }
public rochild GetRoChildFromID(int id) // The following Method is not correct. It needs to have a RO database id as well as an id. Without that,
{ // the first RO with a specific id will be found regardless of the RO Database id.
if (dicRosIntIDs == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); //public rochild GetRoChildFromID(int id)
// Use the id to get the value from the dictionary //{
if (dicRosIntIDs.ContainsKey(id)) // if (dicRosIntIDs == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup);
{ // // Use the id to get the value from the dictionary
rochild rochld = (rochild)dicRosIntIDs[id]; // if (dicRosIntIDs.ContainsKey(id))
return rochld; // {
} // rochild rochld = (rochild)dicRosIntIDs[id];
rochild tmp = new rochild(); // return rochld;
tmp.ID = -1; // }
return tmp; // rochild tmp = new rochild();
} // tmp.ID = -1;
// return tmp;
//}
public rodbi[] GetRODatabaseList() public rodbi[] GetRODatabaseList()
{ {
return myHdr.myDbs; return myHdr.myDbs;
@ -687,6 +689,12 @@ namespace VEPROMS.CSLA.Library
if (child != null) return ((rochild)child).type; if (child != null) return ((rochild)child).type;
return null; return null;
} }
public string GetROIDByAccPagID(string accPageID, string spDefault, string igDefault)
{
rochild? child = GetRoChildByAccPagID(accPageID, spDefault, igDefault);
if (child != null) return ((rochild)child).roid;
return null;
}
public rochild? GetRoChildByAccPagID(string accPageID, string spDefault, string igDefault) public rochild? GetRoChildByAccPagID(string accPageID, string spDefault, string igDefault)
{ {
if (_dicROAPID == null) if (_dicROAPID == null)