protected void ChangeColumnType()
        {
            if (lvDynamicColumns.SelectedItems.Count != 1)
            {
                return;
            }

            var sourceDynamicColumnRow = (MainDataSet.DynamicColumnsRow)lvDynamicColumns.SelectedItems[0].Tag;

            if (sourceDynamicColumnRow.Type == (int)DynamicColumnType.FreeText)
            {
                MessageBox.Show("Free text column cannot be converted", MainForm.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            var dlgres = MessageBox.Show("Do you wish to convert this column to free text?", MainForm.AppName, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (dlgres == DialogResult.Yes)
            {
                this.Enabled = false;

                var formProgress = new FormGenericProgress("Converting column...", DoChangeColumnType, sourceDynamicColumnRow, true);
                formProgress.ShowDialog();

                _views.MainForm.sourceDocuments.ResetBindings(true);

                ShowColumnPropsEditor(sourceDynamicColumnRow, true);

                this.Enabled = true;
            }
        }
Example #2
0
        public void CalcScores()
        {
            regExpDataGridView.EndEdit(DataGridViewDataErrorContexts.Commit);

            _views.MainForm.sourceDocuments.RaiseListChangedEvents = false;
            _views.MainForm.sourceRegExp.RaiseListChangedEvents    = false;

            FormGenericProgress formGenericProgress = new FormGenericProgress("Calculating scores, please wait...", new LengthyOperation(DoCalcScores), null, true);

            formGenericProgress.ShowDialog();

            if (formGenericProgress.Result)
            {
                MessageBox.Show("Calculation finished successfully", MainForm.AppName, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }

            _views.MainForm.sourceRegExp.RaiseListChangedEvents    = true;
            _views.MainForm.sourceDocuments.RaiseListChangedEvents = true;

            _views.MainForm.sourceDocuments.ResetBindings(false);
        }
Example #3
0
        protected void CalculateScores()
        {
            _views.MainForm.sourceDocuments.RaiseListChangedEvents = false;
            _views.MainForm.sourceRegExp.RaiseListChangedEvents    = false;

            ///////////////////////////////////////////////////////////////////////////////

            var formGenericProgress = new FormGenericProgress("Calculating scores, please wait...", DoCalcScores, null, true);

            formGenericProgress.ShowDialog();

            if (formGenericProgress.Result)
            {
                MessageBox.Show("Calculation finished successfully", MainForm.AppName, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }

            ///////////////////////////////////////////////////////////////////////////////

            _views.MainForm.sourceRegExp.RaiseListChangedEvents    = true;
            _views.MainForm.sourceDocuments.RaiseListChangedEvents = true;
        }
Example #4
0
        private void menuDeleteAllValues_Click(object sender, EventArgs e)
        {
            try
            {
                var menuItem        = (MenuItem)sender;
                var dynamicColumnID = _views.DocumentsService.GetDynamicColumnID(((TabSetting)menuItem.Tag).ColumnName);

                _views.MainForm.sourceDocuments.RaiseListChangedEvents = false;

                var classRow     = _views.MainForm.datasetMain.DynamicColumns.FirstOrDefault(x => x.ID == dynamicColumnID);
                var formProgress = new FormGenericProgress("Deleting values...", new LengthyOperation(DoDeleteColumnValues), classRow, false);
                formProgress.ShowDialog();

                _views.MainForm.sourceDocuments.RaiseListChangedEvents = true;
                _views.MainForm.sourceDocuments.ResetBindings(false);

                UpdatePane();
            }
            catch (Exception ex)
            {
                MainForm.ShowExceptionMessage(ex);
            }
        }