public RelationTag getRelationTagByGUID(string GUID) { RelationTag relationTag = null; string getRelations = @"select elementid from t_connectortag where ea_guid like '" + GUID + "'"; XmlDocument xmlElementIDs = this.SQLQuery(getRelations); XmlNode elementNode = xmlElementIDs.SelectSingleNode("//elementid"); if (elementNode != null) { int objectID; if (int.TryParse(elementNode.InnerText, out objectID)) { ConnectorWrapper owner = this.getRelationByID(objectID); if (owner != null) { foreach (TaggedValue taggedValue in owner.taggedValues) { if (taggedValue.ea_guid.Equals(GUID, StringComparison.InvariantCultureIgnoreCase)) { relationTag = taggedValue as RelationTag; } } } } } return(relationTag); }
public List <RelationTag> getRelationTagsWithValue(string value) { List <RelationTag> relationTags = new List <RelationTag>(); string sqlFindGUIDS = @"select ea_guid from t_connectortag where value like '" + value + "'"; // get the nodes with the name "ea_guid" XmlDocument xmlTagGUIDs = this.SQLQuery(sqlFindGUIDS); XmlNodeList tagGUIDNodes = xmlTagGUIDs.SelectNodes("//ea_guid"); foreach (XmlNode guidNode in tagGUIDNodes) { RelationTag relationTag = this.getRelationTagByGUID(guidNode.InnerText); if (relationTag != null) { relationTags.Add(relationTag); } } return(relationTags); }