Exemplo n.º 1
0
        public static void UpdateAlertInfo(bool EnableAlerts, string FirstName, string LastName, string Email)
        {
            int UserId = -1;

            using (IDataReader reader = DBUser.GetUserInfoByLogin("alert"))
            {
                reader.Read();
                UserId = (int)reader["UserId"];
            }

            try
            {
                using (DbTransaction tran = DbTransaction.Begin())
                {
                    DBUser.UpdateUserInfo(UserId, "", FirstName, LastName, Email, "", "");
                    PortalConfig.EnableAlerts = EnableAlerts;
                    tran.Commit();
                }
            }
            catch (Exception exception)
            {
                if (exception is SqlException)
                {
                    SqlException sqlException = exception as SqlException;
                    if (sqlException.Number == 2627)
                    {
                        throw new EmailDuplicationException();
                    }
                }
                throw;
            }
            Alerts2.Init();
        }
Exemplo n.º 2
0
        private void Init3()
        {
            // OZ Initialize Company Web Site Semaphore
            CompanyWebSiteSemaphore.Initialize();

            DbHelper2.Init2();

            ValidateSqlServerVesion();
            _sqlServerEdition = (SqlServerEdition)DBCommon.GetSqlServerEdition();

            DatabaseState state = (DatabaseState)DBCommon.GetDatabaseState();

            if (state != DatabaseState.Ready)
            {
                throw new DatabaseStateException(state);
            }

            Alerts2.Init();
            PortalConfig.Current.Init();

            _host = PortalConfig.SystemHost;
            string scheme = PortalConfig.SystemScheme;
            string port   = PortalConfig.SystemPort;

            _companyType = PortalConfig.CompanyType;

            if (PortalConfig.CompanyEndDate.HasValue)
            {
                _endDate = PortalConfig.CompanyEndDate.Value;
            }
            else
            {
                _endDate = DateTime.MaxValue;
            }

            _portalLink = string.Format("{0}://{1}{2}", scheme, _host, !string.IsNullOrEmpty(port) ? (":" + port) : "");
            _serverLink = _portalLink + "/";

            _defaultLocale = DBCommon.GetDefaultLanguageName();


            _initialized = true;
        }