Exemplo n.º 1
0
        void PrepareEmployeeTerritories(out TableNode tn)
        {
            ApplicationController.WizardControllerFactory = new WizardControllerFactory(this.GetType().Assembly, "TestApp.RelationTests+IntermediateTableWizController");
            // Find Territories, map primary key, since it's not automatically detected,
            // and map class
            TreeNodeCollection nodes = ApplicationController.Instance.DatabaseNode.Nodes;

            tn = (TableNode)FindNode(nodes, "Territories");
            ColumnNode cn = (ColumnNode)FindNode(tn.Nodes, "TerritoryID");

            cn.ChangePrimary(null, EventArgs.Empty);
            tn.MapClass(null, EventArgs.Empty);
            tn.Table.ClassName = "Territory";

            // Find Employees and map class
            tn = (TableNode)FindNode(nodes, "Employees");
            tn.MapClass(null, EventArgs.Empty);
            tn.Table.ClassName = "Employee";

            tn = (TableNode)FindNode(nodes, "EmployeeTerritories");
            DatabaseNode dbn = (DatabaseNode)tn.Parent;

            Assertion.AssertNotNull("dbn shouldn't be null", dbn);
            tn.MapIntermediateTable(null, EventArgs.Empty);
        }
Exemplo n.º 2
0
 private void PrepareEmployeeOrder(out TableNode tn, out ColumnNode cn)
 {
     ApplicationController.WizardControllerFactory = new WizardControllerFactory(this.GetType().Assembly, "TestApp.RelationTests+FkWizardController");
     tn = (TableNode)FindNode(ApplicationController.Instance.DatabaseNode.Nodes, "Employees");
     tn.MapClass(null, EventArgs.Empty);
     tn = (TableNode)FindNode(ApplicationController.Instance.DatabaseNode.Nodes, "Orders");
     tn.MapClass(null, EventArgs.Empty);
     cn = (ColumnNode)FindNode(tn.Nodes, "EmployeeID");
     cn.ChangeMapping(null, EventArgs.Empty);
     cn.MakeForeignKey(null, EventArgs.Empty);
 }
Exemplo n.º 3
0
 void MapIntermediateClass(TableNode tn, NDO.Mapping.Class cl)
 {
     if (tn.Table.PrimaryKey == "")
     {
         tn.Table.PrimaryKey = cl.Oid.ColumnName;
     }
     //TODO: Intermediate class berücksichtigen
     tn.MapClass(null, EventArgs.Empty);
 }
Exemplo n.º 4
0
        void PrepareOrderDetails(out TableNode tn)
        {
            ApplicationController.WizardControllerFactory = new WizardControllerFactory(this.GetType().Assembly, "TestApp.RelationTests+IntermediateClassWizController");
            TreeNodeCollection nodes = ApplicationController.Instance.DatabaseNode.Nodes;

            tn = (TableNode)FindNode(nodes, "Orders");
            tn.MapClass(null, EventArgs.Empty);
            tn.Table.ClassName = "Order";
            tn = (TableNode)FindNode(nodes, "Products");
            tn.MapClass(null, EventArgs.Empty);
            tn.Table.ClassName = "Product";
            tn = (TableNode)FindNode(nodes, "Order Details");
            DatabaseNode dbn = (DatabaseNode)tn.Parent;

            Assertion.AssertNotNull("dbn shouldn't be null", dbn);

            tn.MapIntermediateClass(null, EventArgs.Empty);
            tn.Table.ClassName = "OrderDetail";
        }
Exemplo n.º 5
0
        private void FakeOracleAssembly()
        {
            allObjects.Nodes.Clear();
            model = new AssemblyWizModel();
            model.ConnectionType    = "Oracle";
            model.ConnectionString  = "Password=manager;User ID=SYSTEM;Data Source=maty;Persist Security Info=True";
            model.ProjectDirectory  = @"c:\MyNw\Scott";
            model.ProjectName       = "Scott";
            model.DefaultNamespace  = "Scott.Reverse";
            model.MapStringsAsGuids = false;
            model.UseClassField     = true;
            model.OwnerName         = "SCOTT";
            FillNodes();
            DatabaseNode dbn = (DatabaseNode)allObjects.Nodes[0];
            TableNode    tn  = (TableNode)dbn.FindNode("EMP");

            tn.MapClass(null, EventArgs.Empty);

            //			allObjects.Nodes[0].ForeColor = System.Drawing.Color.LightGray;
        }