static void CreateFirstBranch(NodeReference node, Connection myConn)
        {
            node.AppendSubscript("111111111111");
            node.Set("Smith,John");
            node.AppendSubscript("DBO546");
            node.Set("Some bank 1");
            node.AppendSubscript(29244825509100);
            node.Set(28741.35);
            node.AppendSubscript(2145632596588547);
            string slip = "Smith,John/1965";

            byte[] bytes = System.Text.Encoding.GetEncoding(1251).GetBytes(slip);
            node.Set(bytes);
            node.AppendSubscript(1);
            ValueList myList = myConn.CreateList();

            myList.Append(0, 29244225564111, "John Doe", 500.26, "Payment for goods from ToysRUs");
            node.Set(myList);
            myList.Close();
            node.SetSubscriptCount(4);
            node.AppendSubscript(2);
            myList = myConn.CreateList();
            myList.Append(0, 26032009100100, "John Smith", 115.54, "Transfer to own account in different bank");
            node.Set(myList);
            myList.Close();
            Console.WriteLine("Info about first bank is createed");
        }
Example #2
0
        public void ValuesSimple1()
        {
            ValueList w = new ValueList(global::SqlBuilder.Format.MsSQL);

            w.Append("a", "b", "c");
            string result = w.GetSql();
            string sql    = "a, b, c";

            Assert.AreEqual(sql, result);
        }
        static void CreateSecondBranch(NodeReference node, Connection myConn)
        {
            node.SetSubscriptCount(1);
            node.Set("Some bank 2", "DXO987");
            node.Set(65241.24, "DXO987", 26032009100100);
            string slip = "Smith John||1965";

            byte[] bytes = System.Text.Encoding.GetEncoding(1251).GetBytes(slip);
            node.Set(bytes, "DXO987", 26032009100100, 6541963285249512);
            ValueList myList = myConn.CreateList();

            myList.Append(1, 29242664509184, "Jane Doe", 500.26, "Recurring payment to Amazon");
            node.Set(myList, "DXO987", 26032009100100, 6541963285249512, 1);
            myList.Close();
            myList = myConn.CreateList();
            myList.Append(0, 26548962495545, "John Doe", 1015.10, "Payment for delivery");
            node.Set(myList, "DXO987", 26032009100100, 6541963285249512, 2);
            myList.Close();
            Console.WriteLine("Info about second bank is createed");
        }
Example #4
0
 private void InitializeValueList()
 {
     if (ValueList == null)
     {
         ValueList = new StringBuilder();
     }
     else
     {
         ValueList.Append(", ");
     }
 }
Example #5
0
        public void ValuesSimple1()
        {
            NKnife.Storages.SQL.Common.SuperSql.DefaultFormatter = FormatterLibrary.MsSql;

            ValueList w = new ValueList(NKnife.Storages.SQL.Common.SuperSql.DefaultFormatter);

            w.Append("a", "b", "c");
            string result = w.GetSql();
            string sql    = "a, b, c";

            Assert.Equal(sql, result);
        }
Example #6
0
        public void ValuesSimple1()
        {
            SqlBuilder.DefaultFormatter = FormatterLibrary.MsSql;

            ValueList w = new ValueList(SqlBuilder.DefaultFormatter);

            w.Append("a", "b", "c");
            string result = w.GetSql();
            string sql    = "a, b, c";

            Assert.AreEqual(sql, result);
        }
Example #7
0
        private void AppendActualString(string property_name, string new_value)
        {
            ValueList current_vl = _DocNodeRef.GetList(property_name, VALUE_SUBSCRIPT);

            if (current_vl == null)
            {
                current_vl = GlobalsDocDB.ActiveConnection().CreateList();
            }

            current_vl.Append(new_value);
            _DocNodeRef.Set(current_vl, property_name, VALUE_SUBSCRIPT);
            current_vl.Close();
        }
        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");
        }
Example #9
0
        private void RemoveActualString(string property_name, string value_to_remove)
        {
            ValueList current_vl = _DocNodeRef.GetList(property_name, VALUE_SUBSCRIPT);
            ValueList new_vl     = GlobalsDocDB.ActiveConnection().CreateList();

            string loop_str = current_vl.GetNextString();

            while (loop_str != null)
            {
                if (loop_str != value_to_remove)
                {
                    new_vl.Append(loop_str);
                }

                loop_str = current_vl.GetNextString();
            }

            _DocNodeRef.Set(new_vl, property_name, VALUE_SUBSCRIPT);

            current_vl.Close();
            new_vl.Close();
        }