Beispiel #1
0
        protected void Application_Start(object sender, EventArgs e)
        {
            // Start logger
            XmlConfigurator.Configure();

            try
            {
                StaticSettings.GetSettings(ConfigurationManager.AppSettings["Key"]);
            }
            catch (Exception ex)
            {
                this.logger.Fatal("Error loading settings", ex);

                // TODO SHOW ERROR
            }
        }
Beispiel #2
0
        /// <summary>
        /// Populates a list of settings
        /// </summary>
        private void PopulateSettings()
        {
            try
            {
                // Retrieve updated settings
                StaticSettings.GetSettings(ConfigurationManager.AppSettings["Key"]);

                #region General

                txtCompanyName.Text       = StaticSettings.HostersName;
                cbEnableResellers.Checked = StaticSettings.ResellersEnabled;

                #endregion

                #region Active Directory

                txtHostingOU.Text        = StaticSettings.HostingOU;
                txtUsersOU.Text          = StaticSettings.UsersOU;
                txtDomainController.Text = StaticSettings.PrimaryDC;
                txtUsername.Text         = StaticSettings.Username;
                txtPassword.Text         = StaticSettings.Password;

                #endregion

                #region Security Groups

                txtSuperAdmins.Text   = StaticSettings.SuperAdmins;
                txtBillingAdmins.Text = StaticSettings.BillingAdmins;

                #endregion

                #region Exchange

                ListItem item = ddlExchConnectionType.Items.FindByValue(StaticSettings.ExchangeConnectionType);
                if (item != null)
                {
                    ddlExchConnectionType.SelectedValue = item.Value;
                }
                else
                {
                    ddlExchConnectionType.SelectedValue = "Basic";
                }

                ListItem item2 = ddlExchVersion.Items.FindByValue(StaticSettings.ExchangeVersion.ToString());
                if (item2 != null)
                {
                    ddlExchVersion.SelectedValue = item2.Value;
                }
                else
                {
                    ddlExchVersion.SelectedValue = "2013";
                }

                txtExchServer.Text    = StaticSettings.ExchangeServer;
                txtExchPFServer.Text  = StaticSettings.ExchangePublicFolderServer;
                txtExchDatabases.Text = StaticSettings.ExchangeDatabases;

                cbExchPFEnabled.Checked  = StaticSettings.PublicFoldersEnabled;
                cbExchSSLEnabled.Checked = StaticSettings.ExchangeSSLEnabled;

                #endregion

                #region Modules

                cbEnableExchange.Checked = true;
                cbEnableCitrix.Checked   = StaticSettings.CitrixEnabled;
                cbEnableLync.Checked     = StaticSettings.LyncEnabled;

                #endregion

                #region Notifications

                #endregion
            }
            catch (Exception ex)
            {
                alertmessage.SetMessage(Modules.Base.Enumerations.AlertID.FAILED, "Failed to load settings: " + ex.ToString());
            }
        }