Ejemplo n.º 1
0
        static void Main(string[] args)
        {

            String localPath = Environment.CurrentDirectory;
            FileDB db = FileDB.createDatabase(localPath + @"\db", "testDB2");

            Console.WriteLine(db);

            TestClass2 rectangle = new TestClass2(db);
            rectangle.Length = 2;
            rectangle.height = 3;
            rectangle.save();

            Console.WriteLine(db);
            db.save();

            Console.ReadKey();

            TestClass2 loadRect = TestClass2.loadByID(0);
            Console.WriteLine("Length: {0} , Height: {1}", loadRect.Length, loadRect.height);

            /*TestClass tc = new TestClass(db, "1.23") { Name = "Curt" };

            tc.save();

            Console.WriteLine(db);
            db.save();

            Console.ReadKey();

            tc.Name = "Michael";
            tc.save();
            Console.WriteLine("ID is {0}", tc.getID());

            db.save();

            TestClass tc2 = TestClass.loadByID(0);
            Console.WriteLine("Name of tc2: {0}", tc2.Name);*/


            /*FileDB db = FileDB.createDatabase(localPath + @"\db", "testDB");

            Console.WriteLine(db);
            Console.WriteLine(db.getTableByName("testTable3"));*/

            /*FileDBTable table1 = db.createTable("testTable1");
            table1.addColumn("name", typeof(String));
            table1.addColumn("surname", typeof(String));
            table1.addColumn("Student", typeof(String));
            table1.addRow("Phillip", "Phoelich", "Yes");
            table1.addRow("Morten", "Therkildsen", "Yes");

            FileDBTable table2 = db.createTable("testTable2");
            table2.addColumn("name", typeof(String));
            table2.addColumn("study", typeof(String));
            table2.addRow("Phillip", "SWU");
            table2.addRow("Morten", "SWU");

            Console.WriteLine(db);
            Console.WriteLine();
            Console.WriteLine(table1);
            Console.WriteLine();
            Console.WriteLine(table2);

            db.save();

            Console.ReadKey();
            db.deleteTable(ref table1);
            Console.WriteLine(db);

            db.save();*/

            Console.ReadKey();

        }