Example #1
0
        private void InitClass()
        {
            DataSetName        = "dsmeta";
            Prefix             = "";
            Namespace          = "http://tempuri.org/dsmeta.xsd";
            EnforceConstraints = false;

            #region create DataTables
            MetaTable T;
            //////////////////// COLUMNTYPES_PARENT /////////////////////////////////
            T = new MetaTable("columntypes_parent");
            T.defineColumn("tablename", typeof(String), false);
            T.defineColumn("field", typeof(String), false);
            Tables.Add(T);
            T.defineKey("tablename", "field");

            //////////////////// COLUMNTYPES_MIDDLE /////////////////////////////////
            T = new MetaTable("columntypes_middle");
            T.defineColumn("tablename", typeof(String), false);
            T.defineColumn("field", typeof(String), false);
            Tables.Add(T);
            T.defineKey("tablename", "field");

            //////////////////// CUSTOMINDIRECTRELCOL /////////////////////////////////
            var tcustomindirectrelcol = new customindirectrelcolTable();
            tcustomindirectrelcol.addBaseColumns("idcustomindirectrel", "parentfield", "parentnumber", "lastmodtimestamp", "lastmoduser", "middlefield");
            Tables.Add(tcustomindirectrelcol);
            tcustomindirectrelcol.defineKey("idcustomindirectrel", "parentfield", "parentnumber");

            #endregion


            #region DataRelation creation
            DataColumn [] CPar;
            DataColumn [] CChild;
            CPar = new DataColumn[1] {
                columntypes_middle.Columns["field"]
            };
            CChild = new DataColumn[1] {
                customindirectrelcol.Columns["middlefield"]
            };
            Relations.Add(new DataRelation("columntypes_middle_customindirectrelcol", CPar, CChild, false));

            CPar = new DataColumn[1] {
                columntypes_parent.Columns["field"]
            };
            CChild = new DataColumn[1] {
                customindirectrelcol.Columns["parentfield"]
            };
            Relations.Add(new DataRelation("columntypes_parent_customindirectrelcol", CPar, CChild, false));

            #endregion
        }
Example #2
0
        private void InitClass()
        {
            DataSetName        = "dsmeta";
            Prefix             = "";
            Namespace          = "http://tempuri.org/dsmeta.xsd";
            EnforceConstraints = false;

            #region create DataTables
            MetaTable T;
            //////////////////// CUSTOMINDIRECTREL /////////////////////////////////
            var tcustomindirectrel = new customindirectrelTable();
            tcustomindirectrel.addBaseColumns("idcustomindirectrel", "description", "edittype", "filtermiddle", "filterparenttable2", "flag", "insertfilterparenttable1", "lastmodtimestamp", "lastmoduser", "listtype", "middletable", "navigationfilterparenttable1", "parenttable1", "parenttable2", "parenttable2view");
            Tables.Add(tcustomindirectrel);
            tcustomindirectrel.defineKey("idcustomindirectrel");

            //////////////////// CUSTOMINDIRECTRELCOL /////////////////////////////////
            var tcustomindirectrelcol = new customindirectrelcolTable();
            tcustomindirectrelcol.addBaseColumns("idcustomindirectrel", "parentfield", "parentnumber", "lastmodtimestamp", "lastmoduser", "middlefield");
            Tables.Add(tcustomindirectrelcol);
            tcustomindirectrelcol.defineKey("idcustomindirectrel", "parentfield", "parentnumber");

            //////////////////// CUSTOMOBJECT_MIDDLE /////////////////////////////////
            T = new MetaTable("customobject_middle");
            T.defineColumn("objectname", typeof(String), false);
            T.defineColumn("description", typeof(String));
            T.defineColumn("isreal", typeof(String), false);
            T.defineColumn("realtable", typeof(String));
            T.defineColumn("lastmodtimestamp", typeof(DateTime));
            T.defineColumn("lastmoduser", typeof(String));
            Tables.Add(T);
            T.defineKey("objectname");

            //////////////////// CUSTOMOBJECT_PARENT1 /////////////////////////////////
            T = new MetaTable("customobject_parent1");
            T.defineColumn("objectname", typeof(String), false);
            T.defineColumn("description", typeof(String));
            T.defineColumn("isreal", typeof(String), false);
            T.defineColumn("realtable", typeof(String));
            T.defineColumn("lastmodtimestamp", typeof(DateTime));
            T.defineColumn("lastmoduser", typeof(String));
            Tables.Add(T);
            T.defineKey("objectname");

            //////////////////// CUSTOMOBJECT_PARENT2 /////////////////////////////////
            T = new MetaTable("customobject_parent2");
            T.defineColumn("objectname", typeof(String), false);
            T.defineColumn("description", typeof(String));
            T.defineColumn("isreal", typeof(String), false);
            T.defineColumn("realtable", typeof(String));
            T.defineColumn("lastmodtimestamp", typeof(DateTime));
            T.defineColumn("lastmoduser", typeof(String));
            Tables.Add(T);
            T.defineKey("objectname");

            //////////////////// CUSTOMOBJECT_PARENT2VIEW /////////////////////////////////
            T = new MetaTable("customobject_parent2view");
            T.defineColumn("objectname", typeof(String), false);
            T.defineColumn("description", typeof(String));
            T.defineColumn("isreal", typeof(String), false);
            T.defineColumn("realtable", typeof(String));
            T.defineColumn("lastmodtimestamp", typeof(DateTime));
            T.defineColumn("lastmoduser", typeof(String));
            Tables.Add(T);
            T.defineKey("objectname");

            //////////////////// EDITTYPE /////////////////////////////////
            T = new MetaTable("edittype");
            T.defineColumn("edit", typeof(String), false);
            Tables.Add(T);
            T.defineKey("edit");

            //////////////////// LISTTYPE /////////////////////////////////
            T = new MetaTable("listtype");
            T.defineColumn("list", typeof(String), false);
            Tables.Add(T);
            T.defineKey("list");

            #endregion


            #region DataRelation creation
            DataColumn [] CPar;
            DataColumn [] CChild;
            this.defineRelation("customindirectrel_customindirectrelcol", "customindirectrel", "customindirectrelcol", "idcustomindirectrel");
            CPar = new DataColumn[1] {
                customobject_middle.Columns["objectname"]
            };
            CChild = new DataColumn[1] {
                customindirectrel.Columns["middletable"]
            };
            Relations.Add(new DataRelation("customobject_middle_customindirectrel", CPar, CChild, false));

            CPar = new DataColumn[1] {
                customobject_parent1.Columns["objectname"]
            };
            CChild = new DataColumn[1] {
                customindirectrel.Columns["parenttable1"]
            };
            Relations.Add(new DataRelation("customobject_parent1_customindirectrel", CPar, CChild, false));

            CPar = new DataColumn[1] {
                customobject_parent2.Columns["objectname"]
            };
            CChild = new DataColumn[1] {
                customindirectrel.Columns["parenttable2"]
            };
            Relations.Add(new DataRelation("customobject_parent2_customindirectrel", CPar, CChild, false));

            CPar = new DataColumn[1] {
                customobject_parent2view.Columns["objectname"]
            };
            CChild = new DataColumn[1] {
                customindirectrel.Columns["parenttable2view"]
            };
            Relations.Add(new DataRelation("customobject_parent2view_customindirectrel", CPar, CChild, false));

            CPar = new DataColumn[1] {
                listtype.Columns["list"]
            };
            CChild = new DataColumn[1] {
                customindirectrel.Columns["listtype"]
            };
            Relations.Add(new DataRelation("listtype_customindirectrel", CPar, CChild, false));

            CPar = new DataColumn[1] {
                edittype.Columns["edit"]
            };
            CChild = new DataColumn[1] {
                customindirectrel.Columns["edittype"]
            };
            Relations.Add(new DataRelation("edittype_customindirectrel", CPar, CChild, false));

            #endregion
        }