Esempio n. 1
0
        public override bool Change(string newValue, SolicitationType solicitationType)
        {
            if (this.NextMonitoring.HasValue && DateTime.Now < this.NextMonitoring.Value)
            {
                return(false);
            }

            if (!string.IsNullOrEmpty(newValue) && !this.Value.Equals(newValue))
            {
                SystemArchivesService.ChangeValue(this.Name, newValue: newValue);

                this.LastValue         = this.Value;
                this.Value             = newValue;
                this.MonitoredAt       = DateTime.Now;
                this.AboutCurrentValue = solicitationType.ToString();
                this.NextMonitoring    = null;
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        public override bool VerifyChanges()
        {
            if (this.NextMonitoring.HasValue && DateTime.Now < this.NextMonitoring.Value)
            {
                return(false);
            }

            var value = SystemArchivesService.GetCurrentValue(this.Name);

            if (this.Value.Equals(value))
            {
                return(false);
            }

            this.LastValue         = this.Value;
            this.Value             = value;
            this.MonitoredAt       = DateTime.Now;
            this.AboutCurrentValue = "Alterado sistematicamente.";
            this.NextMonitoring    = null;
            return(true);
        }