Пример #1
0
        private void GetDatabaseObjects2(DBRegistrationClass dbR)
        {
            if (dbR == null)
            {
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            var db  = dbR.Clone();
            var ddc = new DatabaseDesignClass
            {
                Tables = StaticTreeClass.GetAllTableObjectsComplete(db),
                Views  = StaticTreeClass.GetViewObjects(db)
            };

            var generators = StaticTreeClass.GetGeneratorObjects(db);
            var procedures = StaticTreeClass.GetProcedureObjects(db);

            slbDbObjects2.ClearItems();
            foreach (var tc in ddc.Tables.Values)
            {
                slbDbObjects2.Add($@"TABLE.{tc.Name}", CheckState.Checked, tc);
            }

            foreach (var tc in ddc.Views.Values)
            {
                slbDbObjects2.Add($@"VIEW.{tc.Name}", CheckState.Checked, tc);
            }

            foreach (var tc in generators.Values)
            {
                slbDbObjects2.Add($@"GEN.{tc.Name}", CheckState.Checked, tc);
            }

            foreach (var tc in procedures.Values)
            {
                slbDbObjects2.Add($@"PROC.{tc.Name}", CheckState.Checked, tc);
            }
            this.Cursor = Cursors.Default;
        }
Пример #2
0
        public EXPORTDataForm(Form parent, DBRegistrationClass drc)
        {
            InitializeComponent();
            this.MdiParent = parent;

            localNotify = new NotifiesClass()
            {
                NotifyType  = eNotifyType.ErrorWithoutMessage,
                AllowErrors = false
            };
            localNotify.Notify.OnRaiseInfoHandler  += new NotifyInfos.RaiseNotifyHandler(InfoRaised);
            localNotify.Notify.OnRaiseErrorHandler += new NotifyInfos.RaiseNotifyHandler(ErrorRaised);

            DBReg = drc;

            var viewobjects      = StaticTreeClass.GetViewObjects(DBReg);
            var tableObjects     = StaticTreeClass.GetAllTableObjectsComplete(DBReg);
            var domainObjects    = StaticTreeClass.GetDomainObjects(DBReg);
            var generatorObjects = StaticTreeClass.GetGeneratorObjects(DBReg);
            var indecesObjects   = StaticTreeClass.GetIndecesObjects(DBReg);
            var triggerObjects   = StaticTreeClass.GetTriggerObjects(DBReg);
            //var procedureObjects = StaticTreeClass.GetAllProcedureObjects(DBReg);
            var procedureObjects = StaticTreeClass.GetProcedureObjects(DBReg);
            var functionObjects  = StaticTreeClass.GetInternalFunctionObjects(DBReg);

            if (tableObjects.Count <= 0)
            {
                return;
            }

            foreach (var tc in tableObjects.Values)
            {
                selTables.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selTables.CheckChecks();

            foreach (var tc in tableObjects.Values)
            {
                selStructureTables.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selStructureTables.CheckChecks();

            SelectAllTableFields();

            foreach (var tc in viewobjects.Values)
            {
                selStructureViews.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selStructureViews.CheckChecks();

            foreach (var tc in domainObjects.Values)
            {
                if ((tc.ToString().StartsWith("RDB$")) || (tc.ToString().StartsWith("SEC$")) || (tc.ToString().StartsWith("MON$")))
                {
                    continue;
                }
                selDomains.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selDomains.CheckChecks();

            foreach (var tc in generatorObjects.Values)
            {
                if ((tc.ToString().StartsWith("RDB$")) || (tc.ToString().StartsWith("SEC$")) || (tc.ToString().StartsWith("MON$")))
                {
                    continue;
                }
                selGenerators.Add(tc.ToString(), CheckState.Unchecked, tc);
            }
            selGenerators.CheckChecks();


            foreach (var tc in triggerObjects.Values)
            {
                selTriggerStructure.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selTriggerStructure.CheckChecks();


            foreach (var tc in indecesObjects.Values)
            {
                selIndeces.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selIndeces.CheckChecks();

            foreach (var tc in procedureObjects.Values)
            {
                selProceduresStructure.Add(tc.ToString(), CheckState.Unchecked, tc);
            }
            selProceduresStructure.CheckChecks();

            foreach (var tc in functionObjects.Values)
            {
                selFunctionsStructure.Add(tc.ToString(), CheckState.Unchecked, tc);
            }
            selFunctionsStructure.CheckChecks();

            var itm = selTables.ItemDatas[0] as ItemDataClass;

            TableObject = itm.Object as TableClass;

            selExportStructureList.AllowMultipleChecks = true;

            selExportStructureList.Add("Domains", CheckState.Checked, new DomainClass());
            selExportStructureList.Add("UDFs", CheckState.Checked, new UserDefinedFunctionClass());
            selExportStructureList.Add("Generators", CheckState.Checked, new GeneratorClass());
            selExportStructureList.Add("Procedures", CheckState.Checked, new ProcedureClass());
            selExportStructureList.Add("Functions", CheckState.Checked, new FunctionClass());
            selExportStructureList.Add("Tables", CheckState.Checked, new TableClass());
            selExportStructureList.Add("Views", CheckState.Checked, new ViewClass());
            selExportStructureList.Add("Check constraints", CheckState.Checked, new ChecksClass());
            selExportStructureList.Add("Unique constraints", CheckState.Checked, new UniquesClass());
            selExportStructureList.Add("Primary keys", CheckState.Checked, new PrimaryKeyClass());
            selExportStructureList.Add("Foreign keys", CheckState.Checked, new ForeignKeyClass());
            selExportStructureList.Add("Indices", CheckState.Checked, new IndexClass());
            selExportStructureList.Add("Triggers", CheckState.Checked, new TriggerClass());

            selExportStructureList.Add("UDF descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Generator descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Procedure descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Table descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Table field descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("View descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("View field descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Index descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Trigger descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Procedure parameter descriptions", CheckState.Checked, new object());
        }