Ejemplo n.º 1
0
        public DomainForm(Form parent, DBRegistrationClass dbReg, List <TableClass> tables, TreeNode tn, ContextMenuStrip cm)
        {
            InitializeComponent();
            this.MdiParent = parent;
            _dbReg         = dbReg;
            _tables        = tables;
            DomainClass tc = (DomainClass)tn.Tag;

            if (tc == null)
            {
                DomainObject              = new DomainClass();
                DomainObject.Name         = "NEW_DOMAIN";
                DomainObject.NotNull      = false;
                DomainObject.FieldType    = "INTEGER";
                DomainObject.CharSet      = "NONE";
                DomainObject.Collate      = "NONE";
                DomainObject.DefaultValue = string.Empty;
                DomainObject.Check        = string.Empty;
            }
            else
            {
                DomainObject = tc;
            }


            Cm = cm;
            Tn = tn;
            _localNotify.Register4Error(Notify_OnRaiseErrorHandler);
            _localNotify.Register4Info(Notify_OnRaiseInfoHandler);
            _localTableNotify.Register4Info(TableInfoRaised);
        }
Ejemplo n.º 2
0
        public UserDefinedFunctionForm(Form parent, DBRegistrationClass dbReg, TreeNode tn, ContextMenuStrip cm, StateClasses.EditStateClass.eBearbeiten mode)
        {
            InitializeComponent();
            this.MdiParent = parent;
            Cm             = cm;
            Tn             = tn;

            try
            {
                BearbeitenMode = mode;

                if (BearbeitenMode == StateClasses.EditStateClass.eBearbeiten.eInsert)
                {
                    UserDefinedFunctionObject      = new UserDefinedFunctionClass();
                    UserDefinedFunctionObject.Name = "NEW_UserDefinedFunction";
                }
                else
                {
                    UserDefinedFunctionObject = (UserDefinedFunctionClass)tn.Tag;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            OldUserDefinedFunctionObject = (UserDefinedFunctionClass)UserDefinedFunctionObject.Clone();

            _dbReg = dbReg;
            _localNotify.Register4Error(Notify_OnRaiseErrorHandler);
            _localNotify.Register4Info(Notify_OnRaiseInfoHandler);
        }
Ejemplo n.º 3
0
        public ScriptingForm(DBRegistrationClass drc)
        {
            InitializeComponent();
            MdiParent          = FbXpertMainForm.Instance();
            _actScriptingDbReg = drc;
            _lastDirectory     = AppSettingsClass.Instance.PathSettings.ScriptingPath;
            _notifies.Register4Info(FormMeldungRaised);
            _notifies.Register4Error(FormErrorRaised);

            fcbSQL.Clear();
            fcbSQL.SelectionStart = 0;
            string _connstr = ConnectionStrings.Instance.MakeConnectionString(_actScriptingDbReg);

            _sql = new DBBasicClassLibrary.SQLScriptingClass(_connstr, AppSettingsClass.Instance.SQLVariables.GetNewLine(), AppSettingsClass.Instance.SQLVariables.CommentStart, AppSettingsClass.Instance.SQLVariables.CommentEnd, AppSettingsClass.Instance.SQLVariables.SingleLineComment, "SCRIPT");
            _sql.ScriptNotify.Register4Info(EventMeldungRaised);
        }
Ejemplo n.º 4
0
        public UniqueForm(Form parent, DBRegistrationClass dbReg, List <TableClass> tables, NotNullsClass notnullObject, ContextMenuStrip cmGroup, ContextMenuStrip cm)
        {
            InitializeComponent();
            this.MdiParent = parent;

            _dbReg  = dbReg;
            _tables = tables;
            Cm      = cm;
            CmGroup = cmGroup;

            if (notnullObject == null)
            {
                NotNullObject                = new NotNullsClass();
                NotNullObject.Name           = "NEW_CNSTR";
                NotNullObject.ConstraintType = eConstraintType.NOTNULL;
            }
            else
            {
                NotNullObject = notnullObject;
            }
            OrgTable = tables.Find(X => X.Name == notnullObject.TableName);
            NotNullObject.TableName = OrgTable.Name;

            _localNotify.Register4Error(Notify_OnRaiseErrorHandler);
            _localNotify.Register4Info(Notify_OnRaiseInfoHandler);
        }
Ejemplo n.º 5
0
        public FieldForm(DBRegistrationClass dbReg, Form parent, TreeNode tableNode, TableFieldClass fieldObject, NotifiesClass lnotify, StateClasses.EditStateClass.eBearbeiten bearbeitenMode)
        {
            InitializeComponent();

            DataFilled     = false;
            this.MdiParent = parent;
            _dbReg         = dbReg;
            TableNode      = tableNode;
            var tc = (TableClass)tableNode.Tag;

            TableObject    = tc.Clone() as TableClass;
            BearbeitenMode = bearbeitenMode;
            FillCombos();
            if (BearbeitenMode == StateClasses.EditStateClass.eBearbeiten.eInsert)
            {
                NewFieldObject();
            }
            else
            {
                FieldObject                = fieldObject;
                FieldObject.IsPrimary      = TableObject.IsPrimary(FieldObject.Name);
                FieldObject.Domain.NotNull = TableObject.IsNotNull(FieldObject.Name);
                FieldObject.TableName      = TableObject.Name;
            }

            OrgFieldObject = FieldObject.DeepClone();
            ObjectToEdit(FieldObject);

            _localTableNotify = (lnotify == null) ? new NotifiesClass() : lnotify;

            DataFilled = false;
            _localTableNotify.Register4Info(TableInfoRaised);
            localNotify.Register4Info(InfoRaised);
            localNotify.Register4Error(ErrorRaised);
        }
Ejemplo n.º 6
0
        public IMPORTDataForm(Form parent, DBRegistrationClass drc)
        {
            InitializeComponent();
            this.MdiParent = parent;

            localNotify = new NotifiesClass()
            {
                ErrorGranularity = eMessageGranularity.never
            };
            localNotify.Register4Info(InfoRaised);
            localNotify.Register4Error(ErrorRaised);

            DBReg = drc;

            var tableObjects = StaticTreeClass.Instance().GetAllNonSystemTableObjectsComplete(DBReg);

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

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

            selTables.CheckChecks();
            SelectAllTableFields();
        }
Ejemplo n.º 7
0
 public MaintainanceForm(DBClass DB)
 {
     InitializeComponent();
     db = DB;
     nf.Register4Info(InfoRaised);
     nf.Register4Error(ErrorRaised);
 }
Ejemplo n.º 8
0
 public DBUserManagementForm(Form parent, DBRegistrationClass drc)
 {
     InitializeComponent();
     DBReg          = drc;
     this.MdiParent = parent;
     _localNotify.Register4Error(ErrorRaised);
     _localNotify.Register4Info(InfoRaised);
 }
Ejemplo n.º 9
0
 public XmlDesignForm(Form parent, DBRegistrationClass reg)
 {
     InitializeComponent();
     MdiParent = parent;
     _dbReg    = reg;
     _localNotify.Register4Info(InfoRaised);
     _localNotify.Register4Error(ErrorRaised);
     LanguageClass.Instance.RegisterChangeNotifiy(LanguageChanged);
 }
Ejemplo n.º 10
0
 public ReplicationDesignForm(Form parent, List <TableClass> tables, DBRegistrationClass dbReg)
 {
     InitializeComponent();
     this.MdiParent = parent;
     _tables        = tables;
     _dbReg         = dbReg;
     _localNotify.Register4Error(Notify_OnRaiseErrorHandler);
     _localNotify.Register4Info(Notify_OnRaiseInfoHandler);
 }
Ejemplo n.º 11
0
        public GeneratorForm(Form parent, DBRegistrationClass drc, TreeNode tn, ContextMenuStrip cm)
        {
            InitializeComponent();
            MdiParent = parent;
            Tn        = tn;
            Cm        = cm;
            var tc = (GeneratorClass)tn.Tag;

            GeneratorObject = tc;
            _dbReg          = drc;
            _localNotify.Register4Error(Notify_OnRaiseErrorHandler);
            _localNotify.Register4Info(Notify_OnRaiseInfoHandler);
        }
Ejemplo n.º 12
0
        public EventsForm(Form parent, DBRegistrationClass dbReg)
        {
            InitializeComponent();
            this.MdiParent = parent;
            _dbReg         = dbReg;

            _localNotify.Register4Error(Notify_OnRaiseErrorHandler);
            _localNotify.Register4Info(Notify_OnRaiseInfoHandler);

            string cn = ConnectionStrings.Instance.MakeConnectionString(dbReg);

            revent = new FbRemoteEvent(cn);
            revent.RemoteEventCounts += Revent_RemoteEventCounts;
        }
Ejemplo n.º 13
0
        public TriggerForm(Form parent, DBRegistrationClass drc, TreeNode tn, ContextMenuStrip cm, List <TableClass> tables)
        {
            FormEvents.DisableEvents(this, "TriggerForm");
            InitializeComponent();
            this.MdiParent = parent;
            Tn             = tn;
            TriggerClass tc = (TriggerClass)tn.Tag;

            Cm               = cm;
            _tables          = tables;
            TriggerObject    = tc;
            OrgTriggerObject = tc;
            _dbReg           = drc;
            _localNotify.Register4Error(Notify_OnRaiseErrorHandler);
            _localNotify.Register4Info(Notify_OnRaiseInfoHandler);
        }
Ejemplo n.º 14
0
        public ForeignKeyForm(Form parent, DBRegistrationClass dbReg, List <TableClass> tables, string tableName, ForeignKeyClass foreignKeys, int newNr)
        {
            InitializeComponent();
            this.MdiParent = parent;
            _tables        = tables;
            _foreignKeys   = foreignKeys;
            NewNr          = newNr;
            FKName         = (_foreignKeys == null) ? $@"FK_{TableName}_{NewNr}" : foreignKeys.Name;
            TableName      = tableName;
            DataFilled     = false;
            _dbReg         = dbReg;


            _localNotify.Register4Error(Notify_OnRaiseErrorHandler);
            _localNotify.Register4Info(Notify_OnRaiseInfoHandler);
        }
Ejemplo n.º 15
0
        public MeasurementClass(MeasurementConfigClass measConfig, bool worker)
        {
            mcc = measConfig;

            nf = new NotifiesClass();
            nf.Register4Info(InfoRaised);
            nf.Register4Error(ErrorRaised);
            if (worker)
            {
                measWorker = new System.ComponentModel.BackgroundWorker();
                this.measWorker.WorkerReportsProgress      = true;
                this.measWorker.WorkerSupportsCancellation = true;
                this.measWorker.DoWork             += new System.ComponentModel.DoWorkEventHandler(this.measWorker_DoWork);
                this.measWorker.ProgressChanged    += new System.ComponentModel.ProgressChangedEventHandler(this.measWorker_ProgressChanged);
                this.measWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.measWorker_RunWorkerCompleted);
            }
        }
Ejemplo n.º 16
0
        public FunctionForm(Form parent, DBRegistrationClass dbReg, List <TableClass> tables, TreeNode tn, ContextMenuStrip cm, StateClasses.EditStateClass.eBearbeiten mode)
        {
            InitializeComponent();
            this.MdiParent = parent;
            Cm             = cm;
            Tn             = tn;
            _tables        = tables;

            try
            {
                BearbeitenMode = mode;

                if (BearbeitenMode == StateClasses.EditStateClass.eBearbeiten.eInsert)
                {
                    FunctionObject      = new FunctionClass();
                    FunctionObject.Name = "NEW_FUNCTION";
                }
                else
                {
                    FunctionObject = (FunctionClass)tn.Tag;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            OldFunctionObject = (FunctionClass)FunctionObject.Clone();

            _dbReg = dbReg;
            _localNotify.Register4Error(Notify_OnRaiseErrorHandler);
            _localNotify.Register4Info(Notify_OnRaiseInfoHandler);

            cbDatatype.Items.Clear();

            DBTypeList dbList = new DBTypeList();

            foreach (DBDataTypes dt in dbList.Values)
            {
                cbDatatype.Items.Add(dt);
            }

            DoEvents = true;
        }
Ejemplo n.º 17
0
        public ProcedureForm(Form parent, DBRegistrationClass dbReg, List <TableClass> tables, TreeNode tn, ContextMenuStrip cm, StateClasses.EditStateClass.eBearbeiten mode)
        {
            InitializeComponent();
            this.MdiParent = parent;
            _tn            = tn;
            _cm            = cm;
            _tables        = tables;
            try
            {
                BearbeitenMode = mode;
                if (BearbeitenMode == StateClasses.EditStateClass.eBearbeiten.eInsert)
                {
                    _procedureObject      = new ProcedureClass();
                    _procedureObject.Name = "NEW_PROCEDURE";
                }
                else
                {
                    _procedureObject = (ProcedureClass)tn.Tag;
                }
            }
            catch
            {
            }
            _procedureObjectOld = (ProcedureClass)_procedureObject.Clone();

            _dbReg = dbReg;
            _localNotify.Register4Error(Notify_OnRaiseErrorHandler);
            _localNotify.Register4Info(Notify_OnRaiseInfoHandler);
            cbDatatype.Items.Clear();

            DBTypeList dbList = new DBTypeList();

            foreach (DBDataTypes dt in dbList.Values)
            {
                cbDatatype.Items.Add(dt);
            }
            _doEvents = true;
        }
Ejemplo n.º 18
0
        public VIEWManageForm(Form parent, DBRegistrationClass drc, TreeNode tnSelected)
        {
            InitializeComponent();
            this.MdiParent = parent;
            instance       = this;
            ViewClass viewObject = (ViewClass)tnSelected.Tag;

            _localNofity.ErrorGranularity = eMessageGranularity.never;
            _localNofity.Register4Info(MeldungRaised);
            _localNofity.Register4Error(ErrorRaised);

            TnSelected = tnSelected;
            ViewObject = (ViewClass)tnSelected.Tag;

            DBReg           = drc;
            txtMaxRows.Text = AppSettingsClass.Instance.SQLVariables.MaxRowsForSelect.ToString();
            this.GetDataWorker.WorkerReportsProgress      = true;
            this.GetDataWorker.WorkerSupportsCancellation = true;
            this.GetDataWorker.DoWork             += new System.ComponentModel.DoWorkEventHandler(this.bwGetData_DoWork);
            this.GetDataWorker.ProgressChanged    += new System.ComponentModel.ProgressChangedEventHandler(this.bwGetData_ProgressChanged);
            this.GetDataWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.bwGetData_RunWorkerCompleted);

            gridStore = new GridStoreClass(dgvResults);
        }
Ejemplo n.º 19
0
 public void RegisterNotify(NotifyInfos.RaiseNotifyHandler infoN)
 {
     _localNotify.Register4Info(infoN);
 }
Ejemplo n.º 20
0
        public PrimaryKeyForm(Form parent, List <TableClass> tables, TableClass tableObject, DBRegistrationClass dbReg)
        {
            InitializeComponent();
            this.MdiParent = parent;
            _dataFilled    = false;
            _dbReg         = dbReg;

            if (tableObject == null)
            {
                tableObject = new TableClass
                {
                    primary_constraint = new PrimaryKeyClass
                    {
                        Name       = "NEW_PK",
                        FieldNames = new Dictionary <string, string> {
                            { "ID", "ID" }
                        },
                        Sorting = eSort.ASC
                    }
                };
                BearbeitenMode = StateClasses.EditStateClass.eBearbeiten.eInsert;
            }
            else if (tableObject.primary_constraint == null)
            {
                //Tabelle hatte noch keine PK
                tableObject.primary_constraint = new PrimaryKeyClass
                {
                    Name       = "NEW_PK",
                    FieldNames = new Dictionary <string, string> {
                        { "ID", "ID" }
                    },
                    Sorting = eSort.ASC
                };
                BearbeitenMode = StateClasses.EditStateClass.eBearbeiten.eInsert;
            }
            else
            {
                BearbeitenMode = StateClasses.EditStateClass.eBearbeiten.eEdit;
            }
            _tableObject = tableObject;
            _localNotify.Register4Error(Notify_OnRaiseErrorHandler);
            _localNotify.Register4Info(Notify_OnRaiseInfoHandler);

            _tables = tables;



            FillTablesToCombo();
            FillSortingToCombo();
            FillTableFieldsToCombo();

            if (tableObject == null)
            {
                _tableObject = cbSourceTable.SelectedItem as TableClass;
                if (_tableObject.primary_constraint == null)
                {
                    _tableObject.primary_constraint            = new PrimaryKeyClass();
                    _tableObject.primary_constraint.Name       = "NEW_PK";
                    _tableObject.primary_constraint.FieldNames = new Dictionary <string, string>();
                    _tableObject.primary_constraint.FieldNames.Add(cbFields.Items[0].ToString(), cbFields.Items[0].ToString());
                    _tableObject.primary_constraint.Sorting = eSort.ASC;
                }
            }
            DataToEdit();
        }
Ejemplo n.º 21
0
 public MainForm()
 {
     InitializeComponent();
     nf.Register4Info(InfoRaised);
     nf.Register4Error(ErrorRaised);
 }
Ejemplo n.º 22
0
        public EXPORTDataForm(Form parent, DBRegistrationClass drc)
        {
            InitializeComponent();
            this.MdiParent = parent;

            localNotify = new NotifiesClass()
            {
                //NotifyType = eNotifyType.ErrorWithoutMessage,
                ErrorGranularity = eMessageGranularity.never
            };
            localNotify.Register4Info(InfoRaised);
            localNotify.Register4Error(ErrorRaised);

            DBReg = drc;

            var viewobjects      = StaticTreeClass.Instance().GetViewObjects(DBReg);
            var tableObjects     = StaticTreeClass.Instance().GetAllNonSystemTableObjectsComplete(DBReg);
            var domainObjects    = StaticTreeClass.Instance().GetDomainObjects(DBReg);
            var generatorObjects = StaticTreeClass.Instance().GetGeneratorObjects(DBReg);
            var indecesObjects   = StaticTreeClass.Instance().GetIndecesObjects(DBReg);
            var triggerObjects   = StaticTreeClass.Instance().GetTriggerObjects(DBReg);
            //var procedureObjects = StaticTreeClass.Instance().GetAllProcedureObjects(DBReg);
            var procedureObjects = StaticTreeClass.Instance().GetProcedureObjects(DBReg);
            var functionObjects  = StaticTreeClass.Instance().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());
        }