Exemple #1
0
        private void AdminUI_Load(object sender, System.EventArgs e)
        {
            this.databaseLbl.Font         = UIFont.StringFont;
            this.cleanUpBtn.Font          = UIFont.StringFont;
            this.deleteRangeBtn.Font      = UIFont.StringFont;
            this.deleteBtn.Font           = UIFont.StringFont;
            this.conferencesTreeView.Font = UIFont.StringFont;
            this.refreshBtn.Font          = UIFont.StringFont;
            this.basicButtons.Font        = UIFont.StringFont;
            this.serviceButtons.Font      = UIFont.StringFont;

            this.databaseLbl.Text    = Strings.ArchiveDatabase;
            this.cleanUpBtn.Text     = Strings.CleanUp;
            this.deleteRangeBtn.Text = Strings.DeleteRangeEllipsis;
            this.deleteBtn.Text      = Strings.Delete;
            this.refreshBtn.Text     = Strings.Refresh;
            this.Text = Strings.CXPArchiveServiceManager;

            // Connect to service
            string name = ConfigurationManager.AppSettings["ServiceName"];

            if (name != null)
            {
                serviceButtons.ServiceName = name;
            }
            bool serviceFound = serviceButtons.ConnectToService();

            // Verify that we're connected to the service
            if (!serviceFound)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.ErrorConnectingToServiceText, this.Text), Strings.ErrorConnectingToServiceTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                Close();
                return; // early return to skip the code below
            }

            // Connect to the DB
            conferencesTreeView.Connect();

            // Report errors about both connections in one dialog
            if (!conferencesTreeView.Connected)
            {
                RtlAwareMessageBox.Show(this, string.Format(CultureInfo.CurrentCulture,
                                                            Strings.ErrorConnectingToDatabaseText, this.Text), Strings.ErrorConnectingToDatabaseTitle,
                                        MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                Close();
            }
        }
Exemple #2
0
        private void AdminUI_Load(object sender, System.EventArgs e)
        {
            // Connect to service
            string name = ConfigurationManager.AppSettings["ServiceName"];

            if (name != null)
            {
                serviceButtons.ServiceName = name;
            }
            bool serviceFound = serviceButtons.ConnectToService();

            // Verify that we're connected to the service
            if (!serviceFound)
            {
                MessageBox.Show(this,
                                "The " + this.Text + " could not connect to the windows servce \n" +
                                "\"ConferenceXP Archive Service\". Please check to make sure that the ServiceName \n" +
                                "specified in the application configuration file is correct.",
                                "Error Connecting to Service", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
                return; // early return to skip the code below
            }

            // Connect to the DB
            conferencesTreeView.Connect();

            // Report errors about both connections in one dialog
            if (!conferencesTreeView.Connected)
            {
                MessageBox.Show(this,
                                "The " + this.Text + " could not connect to the Microsoft \n" +
                                "SQL database. Ensure that the database is properly created and that the \n" +
                                "SqlConnectionString specified in the application configuration file is correct.",
                                "Error Connecting to Database", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
            }
        }