Exemplo n.º 1
0
        private void UCDBStructControl_Load(object sender, EventArgs e)
        {
            if (this.DesignMode)
            {
                return;
            }

            try
            {
                DBTableInfoEx.ShowFieldChanged = this.ShowFieldChanged;
                List <DatabaseConfig> items = DatabaseConfigManager.GetAllConfigItems();
                DropdownBoxHelper.BindingIEnumerableGenericToComboBox <DatabaseConfig>(comboBoxDB, items, nameof(DatabaseConfig.ConName));
                dgvTables.ShowData(this._tableBindingList.DataSource, "UCDBStructControl.dgvTables", null, null, new string[] { nameof(DBTableInfoEx.ShowField) });
                dgvTableFields.ShowData(this._fieldInfoBindingList.DataSource, "UCDBStructControl.dgvTableFields");
                dgvIndex.ShowData(this._indexInfoBindingList.DataSource, "UCDBStructControl.dgvIndex");
                this.checkMultTable_CheckedChanged(sender, e);
            }
            catch (Exception ex)
            {
                Loger.Error(ex);
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
        private void FTest_Load(object sender, EventArgs e)
        {
            if (this.DesignMode)
            {
                return;
            }

            var redirectAppenderToUI = (RedirectAppender)Loger.GetAppenderByName(null, "RedirectToUI");

            if (redirectAppenderToUI != null)
            {
                redirectAppenderToUI.RedirectOuput += RedirectAppenderToUI_RedirectOuput;;
            }


            List <DatabaseConfig> itemList = DatabaseConfigManager.GetAllConfigItems();

            DropdownBoxHelper.BindingIEnumerableGenericToComboBox <DatabaseConfig>(comboBoxDB, itemList, nameof(DatabaseConfig.ConName), itemList.Where(t => { return(t.DBID == _pssqlDbid); }).FirstOrDefault());

            EFDbContext.OutputLog = true;

            EFEntityTypeManager.RegisterEntityType(3, typeof(DotnetWinFormApp.DB.Stu));
            EFEntityTypeManager.RegisterEntityType(5, typeof(DotnetWinFormApp.DB.Stu));
        }