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

            #region create DataTables
            MetaTable T;
            //////////////////// CUSTOMDIRECTRELCOL /////////////////////////////////
            var tcustomdirectrelcol = new customdirectrelcolTable();
            tcustomdirectrelcol.addBaseColumns("fromfield", "idcustomdirectrel", "tofield", "lastmodtimestamp", "lastmoduser");
            Tables.Add(tcustomdirectrelcol);
            tcustomdirectrelcol.defineKey("fromfield", "idcustomdirectrel", "tofield");

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

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

            //////////////////// CUSTOMOBJECT /////////////////////////////////
            T = new MetaTable("customobject");
            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");

            #endregion


            #region DataRelation creation
            DataColumn [] CPar;
            DataColumn [] CChild;
            CPar = new DataColumn[1] {
                columntypes.Columns["field"]
            };
            CChild = new DataColumn[1] {
                customdirectrelcol.Columns["fromfield"]
            };
            Relations.Add(new DataRelation("columntypes_customdirectrelcol", CPar, CChild, false));

            CPar = new DataColumn[1] {
                columntypes1.Columns["field"]
            };
            CChild = new DataColumn[1] {
                customdirectrelcol.Columns["tofield"]
            };
            Relations.Add(new DataRelation("columntypes1_customdirectrelcol", CPar, CChild, false));

            CPar = new DataColumn[1] {
                customobject.Columns["objectname"]
            };
            CChild = new DataColumn[1] {
                columntypes1.Columns["tablename"]
            };
            Relations.Add(new DataRelation("customobject_columntypes1", 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;
            //////////////////// CUSTOMDIRECTREL /////////////////////////////////
            var tcustomdirectrel = new customdirectrelTable();
            tcustomdirectrel.addBaseColumns("idcustomdirectrel", "description", "edittype", "filter", "flag", "fromtable", "insertfilterparent", "lastmodtimestamp", "lastmoduser", "listtype", "navigationfilterparent", "totable", "totableview");
            Tables.Add(tcustomdirectrel);
            tcustomdirectrel.defineKey("idcustomdirectrel");

            //////////////////// CUSTOMOBJECT /////////////////////////////////
            T = new MetaTable("customobject");
            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");

            //////////////////// CUSTOMOBJECT1 /////////////////////////////////
            T = new MetaTable("customobject1");
            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");

            //////////////////// CUSTOMOBJECTTABLEVIEW /////////////////////////////////
            T = new MetaTable("customobjecttableview");
            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");

            //////////////////// CUSTOMDIRECTRELCOL /////////////////////////////////
            var tcustomdirectrelcol = new customdirectrelcolTable();
            tcustomdirectrelcol.addBaseColumns("fromfield", "idcustomdirectrel", "tofield", "lastmodtimestamp", "lastmoduser");
            Tables.Add(tcustomdirectrelcol);
            tcustomdirectrelcol.defineKey("fromfield", "idcustomdirectrel", "tofield");

            //////////////////// 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;
            CPar = new DataColumn[1] {
                customobject.Columns["objectname"]
            };
            CChild = new DataColumn[1] {
                customdirectrel.Columns["fromtable"]
            };
            Relations.Add(new DataRelation("customobject_customdirectrel", CPar, CChild, false));

            CPar = new DataColumn[1] {
                customobject1.Columns["objectname"]
            };
            CChild = new DataColumn[1] {
                customdirectrel.Columns["totable"]
            };
            Relations.Add(new DataRelation("customobject1_customdirectrel", CPar, CChild, false));

            CPar = new DataColumn[1] {
                customobjecttableview.Columns["objectname"]
            };
            CChild = new DataColumn[1] {
                customdirectrel.Columns["totableview"]
            };
            Relations.Add(new DataRelation("customobjectview_customdirectrel", CPar, CChild, false));

            this.defineRelation("customdirectrel_customdirectrelcol", "customdirectrel", "customdirectrelcol", "idcustomdirectrel");
            CPar = new DataColumn[1] {
                edittype.Columns["edit"]
            };
            CChild = new DataColumn[1] {
                customdirectrel.Columns["edittype"]
            };
            Relations.Add(new DataRelation("edittype_customdirectrel", CPar, CChild, false));

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

            #endregion
        }