static void ReadData(NodeReference node) { try { node.AppendSubscript(""); string subscr = node.NextSubscript(); while (!subscr.Equals("")) { node.SetSubscript(node.GetSubscriptCount(), subscr); if (node.HasData()) { Console.Write(" ".PadLeft(node.GetSubscriptCount() * 4, '-') + subscr + " -> "); GetData(node); } if (node.HasSubnodes()) { ReadData(node); } subscr = node.NextSubscript(); } } catch (GlobalsException ex) { Console.WriteLine(ex.Message); } finally { node.SetSubscriptCount(node.GetSubscriptCount() - 1); } }
static void CreateThirdBranch(NodeReference node, Connection myConn) { node.SetSubscript(2, "DXJ342"); node.Set("Some bank 3"); node.SetSubscript(3, 26008962495545); node.Set(126.32); node.SetSubscript(4, 4567098712347654); string slip = "John Smith 1965"; byte[] bytes = System.Text.Encoding.GetEncoding(1251).GetBytes(slip); node.Set(bytes); node.SetSubscript(5, 1); ValueList myList = myConn.CreateList(); myList.Append(0, 29244825509100, "John Smith", 115.54, "Transfer to own account in different bank"); node.Set(myList); myList.Close(); node.SetSubscript(5, 2); myList = myConn.CreateList(); myList.Append(1, 26032009100100, "John Smith", 1015.54, "Transfer to own account in different bank"); node.Set(myList); myList.Close(); Console.WriteLine("Info about third bank is createed"); }
internal static IEnumerable <NodeReference> GetEntitiesNodes(NodeReference node, DataContext context) { var result = new List <NodeReference>(); node.AppendSubscript(""); var subscript = node.NextSubscript(); while (!subscript.Equals("")) { if (!string.Equals(subscript, IdentityValueSubscriptName)) { var entityNode = context.CreateNodeReference(node.GetName()); entityNode.AppendSubscript(subscript); result.Add(entityNode); } node.SetSubscript(node.GetSubscriptCount(), subscript); subscript = node.NextSubscript(); } return(result); }
private static bool IsKeyExists(string key, NodeReference node) { if (string.IsNullOrEmpty(key)) { return(false); } node.AppendSubscript(GetPreviousSubscriptKey(key)); var subscript = node.NextSubscript(); while (!subscript.Equals("")) { if (string.Equals(subscript, key)) { return(true); } node.SetSubscript(node.GetSubscriptCount(), subscript); subscript = node.NextSubscript(); } return(false); }