private void Init( )
        {
            DataTable          dataSources;
            SupportedProviders providers;

            dataSources = new DataTable( );

            dataSources.Columns.Add("SourceName", typeof(string));
            dataSources.Columns.Add("SourceValue", typeof(string));
            dataSources.Columns.Add("Description", typeof(string));

            providers = ConfigurationData.GetSupportedProvider( );

            if ((providers & SupportedProviders.SqlClient) == SupportedProviders.SqlClient)
            {
                dataSources.Rows.Add(new object [] { "Microsoft SQL Server",
                                                     ConnectionProviders.SqlServerProvider.Name,
                                                     "Use this selection to connect to Microsoft SQL Server 2000 or above using the .NET Framework Data Provider for SQL Server." });
            }

            if ((providers & SupportedProviders.SqlServerCe) == SupportedProviders.SqlServerCe)
            {
                dataSources.Rows.Add(new object [] { "Microsoft SQL Server Compact 3.5",
                                                     ConnectionProviders.SqlCeProvider.Name,
                                                     "Use this selection to connect to Microsoft SQL Compact 3.5 database file." });
            }

            dataSourceListBox.DataSource    = dataSources;
            dataSourceListBox.DisplayMember = "SourceName";
            dataSourceListBox.ValueMember   = "SourceValue";

            descriptionLabel.DataBindings.Add(new Binding("Text", dataSources, "Description"));

            ConnectionProviders[] connectionProviders;


            connectionProviders = ConnectionProviders.FromProvider(providers);

            if (connectionProviders != null && connectionProviders.Length > 0)
            {
                if (connectionProviders.Contains(ConnectionProviders.SqlCeProvider))
                {
                    dataSourceListBox.SelectedValue = ConnectionProviders.SqlCeProvider.Name;
                }
                else if (connectionProviders.Contains(ConnectionProviders.SqlServerProvider))
                {
                    dataSourceListBox.SelectedValue = ConnectionProviders.SqlServerProvider.Name;
                }
            }
        }
Exemplo n.º 2
0
        private void Init()
        {
            string userName;


            userName = Environment.UserName;

            __DatbasesOptions = new List <Control>();

            StorageServerDbCheckBox.Tag = DatabaseComponents.StorageServer;

            LoadBalancePanel.Tag         = DatabaseComponents.StorageServerOptions;
            PatientUpdaterDbCheckBox.Tag = DatabaseComponents.PatientUpdater;

            LoggingDbCheckBox.Tag        = DatabaseComponents.Logging;
            StorageDbCheckBox.Tag        = DatabaseComponents.Storage;
            WorklistDbCheckBox.Tag       = DatabaseComponents.Worklist;
            MediaCreationDbCheckBox.Tag  = DatabaseComponents.MediaCreation;
            WorkstationDbCheckBox.Tag    = DatabaseComponents.Workstation;
            UserManagementDbCheckBox.Tag = DatabaseComponents.UserManagement;

            __DatbasesOptions.Add(StorageServerDbCheckBox);
            __DatbasesOptions.Add(LoadBalancePanel);
            __DatbasesOptions.Add(LoggingDbCheckBox);
            __DatbasesOptions.Add(StorageDbCheckBox);
            __DatbasesOptions.Add(WorklistDbCheckBox);
            __DatbasesOptions.Add(MediaCreationDbCheckBox);
            __DatbasesOptions.Add(WorkstationDbCheckBox);
            __DatbasesOptions.Add(UserManagementDbCheckBox);

            __DatbasesOptions.Add(PatientUpdaterDbCheckBox);


            SupportedDatabases = DatabaseComponents.None;

            WorkstationUserNameTextBox.Text            = userName;
            WorkstationUserPasswordTextBox.Text        = userName;
            WorkstationUserPasswordConfirmTextBox.Text = userName;

            if (!(ConnectionProviders.FromProvider(ConfigurationData.GetSupportedProvider()).Length > 1))
            {
                ShowPasswordCheckBox.Checked = false;
                ShowPasswordCheckBox.Visible = false;
            }

            UserManagementDbCheckBox_CheckedChanged(this, EventArgs.Empty);
            ShowPasswordCheckBox_CheckedChanged(this, EventArgs.Empty);
        }