private bool GetKingdomCodeFromName(string KingdomName, out string KingdomCode, out bool Added) { // Check the Kingdom cache... var objKingdom = _KingdomCache.FindByName(KingdomName); if (objKingdom != null) { KingdomCode = objKingdom.Code; Added = false; return(true); } NameCodeItem item = null; KingdomCode = null; Added = false; StoredProcReaderFirst("spXMLImportBiotaDefKingdomResolve", (reader) => { item = new NameCodeItem { Name = KingdomName, Code = reader["KingdomCode"] as string, IsExisting = (bool)reader["Added"] }; }, _P("vchrFullKingdom", KingdomName)); if (item != null) { KingdomCode = item.Code; Added = !item.IsExisting; } return(item != null); }
private bool GetRankCodeFromName(string RankName, out string RankCode, out bool Added) { // Check the rank cache... var objRank = _RankCache.FindByName(RankName); if (objRank != null) { RankCode = objRank.Code; Added = false; return(true); } RankCode = null; Added = false; NameCodeItem item = null; StoredProcReaderFirst("spXMLImportBiotaDefRankResolve", (reader) => { item = new NameCodeItem { Name = RankName, Code = reader["RankCode"] as string, IsExisting = (bool)reader["Added"] }; _RankCache.Add(RankName, item); }, _P("vchrFullRank", RankName)); if (item != null) { RankCode = item.Code; Added = !item.IsExisting; } return(item != null); }