示例#1
0
        private void CurrentSQLConnectionStore_EvntConfigChanged(object sender, BoolEventArgs args)
        {
            ISQLConnectionSettings oldSettings = currentSQLConnectionStore?.GetPrevious();
            ISQLConnectionSettings newSettings = currentSQLConnectionStore?.GetCurrent();

            if (!(string.IsNullOrWhiteSpace(newSettings?.Database)) && File.Exists(newSettings?.Database))
            {
                try { dBOperations.EvntInfoMessage -= AddLineAtTextBoxResultShow; } catch { }
                dBOperations = SQLSelector.SetConnector(newSettings);
                dBOperations.EvntInfoMessage += new SqlAbstractConnector.Message <TextEventArgs>(AddLineAtTextBoxResultShow);
            }

            if (oldSettings == null)
            {
                tableStore.Set(SQLSelector.GetTables(newSettings));
            }
            else
            {
                if (oldSettings.Name != newSettings.Name && oldSettings.Database != newSettings.Database)
                {
                    tableStore.Set(SQLSelector.GetTables(newSettings));
                }
            }

            if (!string.IsNullOrWhiteSpace(newSettings?.Database) && !string.IsNullOrWhiteSpace(newSettings?.Table))
            {
                SetAdminStatusLabelText($"Текущая база: {newSettings?.Database}, таблица: {newSettings?.Table}");
            }
        }
示例#2
0
        private void TableStore_EvntCollectionChanged(object sender, BoolEventArgs e)
        {
            //for correct clear from a previous list of tables
            cmbTables.DataSource = null;
            cmbTables.Items.Clear();

            if (tableStore?.ToList()?.Count > 0)
            {
                cmbTables.DataSource = tableStore.ToList();
            }
        }
示例#3
0
 private void Uploader_StatusFinishedUploading(object sender, BoolEventArgs e)
 {
     if (e.Status)
     {
         EvntStatus?.Invoke(this, new TextEventArgs($"Обновление на сервер в: {_serverUpdateURI} загружено успешно!"));
     }
     else
     {
         EvntStatus?.Invoke(this, new TextEventArgs($"Ошибка! Обновление не загружено в: {_serverUpdateURI}"));
     }
 }
示例#4
0
        private void ModelCommon_EvntHeaderReady(object sender, BoolEventArgs e)
        {
            IModels header = readerModelCommon.columnNames;

            //make DB and tables by header of text table
            (dBOperations as SQLiteModelDBOperations).PrepareTablesForCommonModel(header);

            //write into Log status info
            AddLineAtTextBoxResultShow($"Количество столбцов в заголовке: {header.ToList().Count}");
            AddLineAtTextBoxResultShow(header.ToString());
        }
示例#5
0
        private async void ModelCommon_collectionFull(object sender, BoolEventArgs e)
        {
            if (e.Status)
            {
                IList <IModels> listModels = readerModelCommon.listCommonModels.ToList();
                int             readRows   = readerModelCommon.importedRows;
                await Task.Run(() => (dBOperations as SQLiteModelDBOperations).WriteModelInTable(listModels));

                AddLineAtTextBoxResultShow($"Эта часть записана:");
                await Task.Run(() => WriteFewModelsInLog(listModels, readRows));
            }
        }
示例#6
0
        private void TableStore_EvntCollectionChanged(object sender, BoolEventArgs e)
        {
            comboBoxTable.DataSource = null;
            comboBoxTable.Items.Clear();

            comboBoxTable.DataSource = tableStore?.ToList();

            if (tableStore?.ToList()?.Count > 0)
            {
                comboBoxTable.SelectedIndex = 0;
            }
        }
示例#7
0
        private void CurrentSQLConnectionStore_EvntConfigChanged(object sender, BoolEventArgs args)
        {
            ISQLConnectionSettings oldSettings = currentSQLConnectionStore?.GetPrevious();
            ISQLConnectionSettings newSettings = currentSQLConnectionStore?.GetCurrent();

            if (oldSettings != null)
            {
                if (oldSettings.Name == newSettings.Name)
                {
                    return;
                }
                if (oldSettings.Database == newSettings.Database)
                {
                    return;
                }
            }

            ModelCommonStringStore tables = SQLSelector.GetTables(currentSQLConnectionStore?.GetCurrent());

            tableStore.Set(tables);
        }
示例#8
0
 private void SampleStore_EvntCollectionChanged(object sender, BoolEventArgs e)
 {
     listBoxSample.DataSource = sampleStore?.ToList();
     listBoxSample.Refresh();
 }
示例#9
0
 private void ColumnDeleteStore_EvntCollectionChanged(object sender, BoolEventArgs e)
 {
     listBoxColumn.DataSource = columnDeleteStore.ToList();
     listBoxColumn.Sorted     = true;
 }