Пример #1
0
        public void Show(double databaseSize, double percent)
        {
            string description = string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}|{1}", (object)databaseSize, (object)percent);
            bool   isWarning   = percent < 90.0;
            Guid   typeId      = isWarning ? DatabaseLimitNotificationItemDAL.warningNotificationTypeGuid : DatabaseLimitNotificationItemDAL.reachedNotificationTypeGuid;
            DatabaseLimitNotificationItemDAL notificationItemDal = DatabaseLimitNotificationItemDAL.GetItem();

            if (notificationItemDal == null)
            {
                NotificationItemDAL.Insert(DatabaseLimitNotificationItemDAL.DatabaseLimitNotificationItemId, typeId, this.GetNotificationMessage(isWarning), description, false, (string)null, new DateTime?(), (string)null);
            }
            else
            {
                bool flag = double.Parse(notificationItemDal.Description.Split('|')[1], (IFormatProvider)CultureInfo.InvariantCulture) < 90.0;
                if (flag == isWarning)
                {
                    return;
                }
                if (flag != isWarning)
                {
                    notificationItemDal.SetNotAcknowledged();
                }
                notificationItemDal.TypeId      = typeId;
                notificationItemDal.Title       = this.GetNotificationMessage(isWarning);
                notificationItemDal.Description = description;
                notificationItemDal.Update();
            }
        }
        // Token: 0x060006C0 RID: 1728 RVA: 0x0002AE08 File Offset: 0x00029008
        public void Show(double databaseSize, double percent)
        {
            string description = string.Format(CultureInfo.InvariantCulture, "{0}|{1}", databaseSize, percent);
            bool   flag        = percent < 90.0;
            Guid   typeId      = flag ? DatabaseLimitNotificationItemDAL.warningNotificationTypeGuid : DatabaseLimitNotificationItemDAL.reachedNotificationTypeGuid;
            DatabaseLimitNotificationItemDAL item = DatabaseLimitNotificationItemDAL.GetItem();

            if (item == null)
            {
                NotificationItemDAL.Insert(DatabaseLimitNotificationItemDAL.DatabaseLimitNotificationItemId, typeId, this.GetNotificationMessage(flag), description, false, null, null, null);
                return;
            }
            bool flag2 = double.Parse(item.Description.Split(new char[]
            {
                '|'
            })[1], CultureInfo.InvariantCulture) < 90.0;

            if (flag2 == flag)
            {
                return;
            }
            if (flag2 != flag)
            {
                item.SetNotAcknowledged();
            }
            item.TypeId      = typeId;
            item.Title       = this.GetNotificationMessage(flag);
            item.Description = description;
            item.Update();
        }