Beispiel #1
0
        /// <summary>
        /// Saves the new settings to the database
        /// </summary>
        private void SaveSettings()
        {
            try
            {
                #region General

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

                #endregion

                #region Active Directory

                StaticSettings.HostingOU = txtHostingOU.Text;
                StaticSettings.UsersOU   = txtUsersOU.Text;
                StaticSettings.PrimaryDC = txtDomainController.Text;
                StaticSettings.Username  = txtUsername.Text;
                StaticSettings.Password  = DataProtection.Encrypt(txtPassword.Text, ConfigurationManager.AppSettings["Key"]);

                #endregion

                #region Security Groups

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

                #endregion

                #region Billing


                #endregion

                #region Exchange

                StaticSettings.ExchangeConnectionType     = ddlExchConnectionType.SelectedValue;
                StaticSettings.ExchangeVersion            = int.Parse(ddlExchVersion.SelectedValue);
                StaticSettings.ExchangeServer             = txtExchServer.Text;
                StaticSettings.ExchangePublicFolderServer = txtExchPFServer.Text;
                StaticSettings.ExchangeDatabases          = txtExchDatabases.Text;
                StaticSettings.PublicFoldersEnabled       = cbExchPFEnabled.Checked;
                StaticSettings.ExchangeSSLEnabled         = cbExchSSLEnabled.Checked;

                #endregion

                #region Modules

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

                #endregion

                // Commit changes
                StaticSettings.CommitSettings(ConfigurationManager.AppSettings["Key"]);

                // Audit
                AuditGlobal.AddAudit(WebSessionHandler.SelectedCompanyCode, WebSessionHandler.Username, Modules.Base.Enumerations.ActionID.SaveSettings, "", "");

                // Show Success
                alertmessage.SetMessage(Modules.Base.Enumerations.AlertID.SUCCESS, "Successfully saved settings");
            }
            catch (Exception ex)
            {
                alertmessage.SetMessage(Modules.Base.Enumerations.AlertID.FAILED, ex.Message);
            }
        }