private void Construct()
        {
            if (!this.DesignMode)
            {
                Configuration config = Configuration.GetNewInstance();
                Epi.DataSets.Config.SettingsRow settings = Configuration.GetNewInstance().Settings;
                this.btnMissing.Text = settings.RepresentationOfMissing;
                this.btnYes.Text     = settings.RepresentationOfYes;
                this.btnNo.Text      = settings.RepresentationOfNo;

                this.btnOK.Click       += new System.EventHandler(this.btnOK_Click);
                this.btnSaveOnly.Click += new System.EventHandler(this.btnSaveOnly_Click);

                if (this.EpiInterpreter.Context.CurrentProject != null && this.EpiInterpreter.Context.CurrentProject.Views.Exists(this.EpiInterpreter.Context.CurrentRead.Identifier))
                {
                    rdbPermDeletion.Checked = false;
                    rdbMarkDel.Checked      = true;
                    rdbMarkDel.Enabled      = true;
                }
                else
                {
                    rdbMarkDel.Checked      = false;
                    rdbPermDeletion.Checked = true;
                    rdbMarkDel.Enabled      = false;
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Saves the current settings to the configuration file.
        /// </summary>
        public void GetSettings(Configuration newConfig)
        {
            Epi.DataSets.Config.SettingsRow settings = newConfig.Settings;

            settings.AutoTouchKeyboard = autoTouchKeyboard.Checked;
            settings.SparseConnection  = checkBoxSparseConnection.Checked;

            // Representation of boolean values ...
            settings.RepresentationOfYes     = cmbYesAs.Text;
            settings.RepresentationOfNo      = cmbNoAs.Text;
            settings.RepresentationOfMissing = cmbMissingAs.Text;

            // HTML output options ...
            settings.ShowCompletePrompt = cbxShowPrompt.Checked;
            settings.ShowSelection      = cbxSelectCriteria.Checked;
            settings.ShowPercents       = cbxPercents.Checked;
            settings.ShowGraphics       = cbxGraphics.Checked;
            settings.ShowTables         = cbxTablesOutput.Checked;
            settings.ShowHyperlinks     = cbxHyperlinks.Checked;

            // Statistics Options
            settings.StatisticsLevel        = int.Parse(WinUtil.GetSelectedRadioButton(gbxStatistics).Tag.ToString());
            settings.PrecisionForStatistics = numericUpDownPrecision.Value;

            // Record Processing
            settings.RecordProcessingScope = int.Parse(WinUtil.GetSelectedRadioButton(gbxProcessRecords).Tag.ToString());
            settings.IncludeMissingValues  = cbxIncludeMissing.Checked;
        }
Beispiel #3
0
        public static string RenderHtml(Rule_Context pContext, string commandName, string fileName, string tableName, int rowCount)
        {
            StringBuilder sb = new StringBuilder();

            Epi.DataSets.Config.SettingsRow settings = Configuration.GetNewInstance().Settings;
            sb.Append(HTML.Italics(SharedStrings.CURRENT_VIEW + ":&nbsp;"));
            sb.Append(HTML.Bold(String.Format("{0}:{1}", fileName.Trim(new char[] { '\'' }), tableName)));
            if (pContext.CurrentRead.RelatedTables != null)
            {
                foreach (string table in pContext.CurrentRead.RelatedTables)
                {
                    sb.Append(HTML.Tag("br"));
                    sb.Append(HTML.Italics("&nbsp&nbsp&nbsp&nbspRelate:&nbsp;"));
                    sb.Append(HTML.Bold(table));
                }
            }
            if (pContext.DataInfo.SelectCriteria != String.Empty)
            {
                sb.Append(HTML.Tag("br"));
                sb.Append(HTML.Italics("Selection:&nbsp;&nbsp;"));
                sb.Append("&nbsp;");
                sb.Append(HTML.Bold(EpiExpression(pContext, pContext.DataInfo.SelectCriteria)));
            }
            if (pContext.DataInfo.GetSqlStatementPartSortBy() != String.Empty)
            {
                sb.Append(HTML.Tag("br"));
                sb.Append(HTML.Italics("Sort By:&nbsp;&nbsp;"));
                sb.Append(HTML.Bold(EpiExpression(pContext, pContext.DataInfo.GetSqlStatementPartSortBy())));
            }
            sb.Append(HTML.Tag("br"));
            sb.Append(HTML.Italics(SharedStrings.RECORD_COUNT + ":&nbsp;&nbsp;"));
            sb.Append(HTML.Bold(rowCount.ToString()));
            string scope = string.Empty;

            switch (settings.RecordProcessingScope)
            {
            case 1:
                scope = SharedStrings.DELETED_RECORDS_EXCLUDED;
                break;

            case 2:
                scope = SharedStrings.DELETED_RECORDS_ONLY;
                break;

            default:
                scope = SharedStrings.DELETED_RECORDS_INCLUDED;
                break;
            }
            sb.Append("&nbsp;");
            sb.Append(HTML.Italics("(" + scope + ")&nbsp;&nbsp;&nbsp;"));
            sb.Append(HTML.Italics("Date:"));
            sb.Append("&nbsp;&nbsp;");
            sb.Append(HTML.Bold(DateTime.Now.ToString()));
            sb.Append(HTML.Tag("br"));
            sb.Append(HTML.Tag("br"));


            return(sb.ToString());
        }
Beispiel #4
0
        public void GetSettings(Configuration newConfig)
        {
            Epi.DataSets.Config.SettingsRow settings = newConfig.Settings;

            settings.DateFormat     = cmbDateFormat.Text;
            settings.TimeFormat     = cmbTimeFormat.Text;
            settings.DateTimeFormat = cmbDateTimeFormat.Text;
        }
Beispiel #5
0
        public void ShowSettings()
        {
            Configuration config = Configuration.GetNewInstance();

            Epi.DataSets.Config.SettingsRow settings = config.Settings;

            cmbDateFormat.SelectedItem     = settings.DateFormat;
            cmbTimeFormat.SelectedItem     = settings.TimeFormat;
            cmbDateTimeFormat.SelectedItem = settings.DateTimeFormat;
        }
Beispiel #6
0
        private void Construct()
        {
            if (!this.DesignMode)
            {
                Configuration config = Configuration.GetNewInstance();
                Epi.DataSets.Config.SettingsRow settings = Configuration.GetNewInstance().Settings;
                this.btnMissing.Text = settings.RepresentationOfMissing;
                this.btnYes.Text     = settings.RepresentationOfYes;
                this.btnNo.Text      = settings.RepresentationOfNo;

                this.btnOK.Click       += new System.EventHandler(this.btnOK_Click);
                this.btnSaveOnly.Click += new System.EventHandler(this.btnSaveOnly_Click);
            }
        }
        /// <summary>
        /// Loads the dialog
        /// </summary>
        private void Construct()
        {
            VariableType scopeWord = VariableType.Standard | VariableType.Global |
                                     VariableType.DataSource | VariableType.DataSourceRedefined | VariableType.Permanent;

            FillVariableCombo(cmbAvailVar, scopeWord);
            FillVariableCombo(cmbAssignVar, scopeWord);
            this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
            Configuration config = Configuration.GetNewInstance();

            Epi.DataSets.Config.SettingsRow settings = Configuration.GetNewInstance().Settings;
            this.btnMissing.Text = settings.RepresentationOfMissing;
            this.btnYes.Text     = settings.RepresentationOfYes;
            this.btnNo.Text      = settings.RepresentationOfNo;
        }
        /// <summary>
        /// Loads the settings from the configuration file.
        /// </summary>
        public void ShowSettings(Configuration pConfig = null)
        {
            Configuration config = null;

            if (pConfig == null)
            {
                config = Configuration.GetNewInstance();
            }
            else
            {
                config = pConfig;
            }



            Epi.DataSets.Config.SettingsRow settings = config.Settings;

            // Representation of boolean values ...
            cmbYesAs.SelectedItem     = settings.RepresentationOfYes;
            cmbNoAs.SelectedItem      = settings.RepresentationOfNo;
            cmbMissingAs.SelectedItem = settings.RepresentationOfMissing;

            // HTML output options ...
            cbxShowPrompt.Checked     = settings.ShowCompletePrompt;
            cbxSelectCriteria.Checked = settings.ShowSelection;
            cbxPercents.Checked       = settings.ShowPercents;
            cbxGraphics.Checked       = settings.ShowGraphics;
            cbxHyperlinks.Checked     = settings.ShowHyperlinks;
            cbxTablesOutput.Checked   = settings.ShowTables;

            // Statistics Options
            WinUtil.SetSelectedRadioButton(settings.StatisticsLevel.ToString(), gbxStatistics);
            numericUpDownPrecision.Value = settings.PrecisionForStatistics;

            // Record Processing
            WinUtil.SetSelectedRadioButton(settings.RecordProcessingScope.ToString(), gbxProcessRecords);
            cbxIncludeMissing.Checked = settings.IncludeMissingValues;
        }
Beispiel #9
0
        /// <summary>
        /// Loads the working directory set by the user
        /// </summary>
        private void ShowSettings(Configuration pConfig = null)
        {
            Configuration config = null;

            if (pConfig == null)
            {
                config = Configuration.GetNewInstance();
            }
            else
            {
                config = pConfig;
            }

            Epi.DataSets.Config.SettingsRow settings = config.Settings;

            try
            {
                autoTouchKeyboard.Checked = settings.AutoTouchKeyboard;
            }
            catch { }

            try
            {
                checkBoxSparseConnection.Checked = settings.SparseConnection;
            }
            catch { }

            // Representation of boolean values ...
            cmbYesAs.SelectedItem     = settings.RepresentationOfYes;
            cmbNoAs.SelectedItem      = settings.RepresentationOfNo;
            cmbMissingAs.SelectedItem = settings.RepresentationOfMissing;

            // HTML output options ...
            cbxShowPrompt.Checked     = settings.ShowCompletePrompt;
            cbxSelectCriteria.Checked = settings.ShowSelection;
            cbxPercents.Checked       = settings.ShowPercents;
            cbxGraphics.Checked       = settings.ShowGraphics;
            cbxHyperlinks.Checked     = settings.ShowHyperlinks;
            cbxTablesOutput.Checked   = settings.ShowTables;

            // Statistics Options
            WinUtil.SetSelectedRadioButton(settings.StatisticsLevel.ToString(), gbxStatistics);
            numericUpDownPrecision.Value = settings.PrecisionForStatistics;

            // Record Processing
            WinUtil.SetSelectedRadioButton(settings.RecordProcessingScope.ToString(), gbxProcessRecords);
            cbxIncludeMissing.Checked = settings.IncludeMissingValues;
            //settingsPanel.ShowSettings();
            txtWorkingDirectory.Text = config.Directories.Working;

            try
            {
                txtMapKey.Text = config.Settings.MapServiceKey;
            }
            catch { }

            try
            {
                txtIOCoding.Text = config.Settings.IOCodeFile;
            }
            catch { }

            object selectedItem = null;

            foreach (object item in lbxLanguages.Items)
            {
                if (((DropDownListItem)item).Key.Equals(config.Settings.Language))
                {
                    selectedItem = item;
                    break;
                }
            }
            lbxLanguages.SelectedItem          = selectedItem;
            cmbDatabaseFormat.SelectedValue    = config.Settings.DefaultDataDriver;
            cmbDefaultDataFormat.SelectedValue = config.Settings.DefaultDataFormatForRead;

            /*if (config.Settings.WebServiceAuthMode == null)
             * {
             *  rbUseWindows.Checked = false;
             *  rbNoWindows.Checked = true;
             * }
             * else
             * {*/

            if (config.Settings.WebServiceAuthMode == 1)
            {
                rbUseWindows.Checked = true;
            }
            else
            {
                rbNoWindows.Checked = true;
            }
            try
            {
                if (config.Settings.EWEServiceAuthMode == 1)
                {
                    EWErbUseWindows.Checked = true;
                }
                else
                {
                    EWErbNoWindows.Checked = true;
                }
            }
            catch (Exception)
            {
                Configuration _config = Configuration.GetNewInstance();
                _config.Settings.EWEServiceAuthMode = 0;     // 0 = Anon, 1 = NT
                Configuration.Save(_config);
            }
            //}
            try {
                if (config.Settings.WebServiceBindingMode == "wshttp")
                {
                    rbWSHTTP.Checked = true;
                }
                else
                {
                    rbBasic.Checked = true;
                }
                if (config.Settings.EWEServiceBindingMode == "wshttp")
                {
                    EWErbWSHTTP.Checked = true;
                }
                else
                {
                    EWErbBasic.Checked = true;
                }
            }
            catch (Exception ex)
            {
                rbBasic.Checked = true;
            }

            txtEndpoint.Text        = config.Settings.WebServiceEndpointAddress;
            EWEEndPointTextBox.Text = config.Settings.EWEServiceEndpointAddress;
        }