private string TransferInSequence(string registryID, string noteID) { XmlNode tranferIns = null; ThisAddIn.TransferInTime(registryID, ref tranferIns); if (tranferIns == null) { return(null); } XmlNodeList emrNotes = emrDoc.DocumentElement.SelectNodes(ElementNames.EmrNote); XmlNode congeners = ThisAddIn.GetCongener0(noteID, emrNotes); if (congeners.ChildNodes.Count == 0) { return(tranferIns.FirstChild.Attributes[AttributeNames.TransferInSequence].Value); } string sequence = null; foreach (XmlNode tranferIn in tranferIns.ChildNodes) { string commitT = ""; sequence = tranferIn.Attributes[AttributeNames.TransferInSequence].Value; if (ThisAddIn.NoteExistsWithSequence(AttributeNames.TransferInSequence, sequence, congeners, ref commitT) != null && commitT != "") { continue; } break; } return(sequence); }