Ejemplo n.º 1
0
        public override bool isComplete(List <string> additionalDetails = null)
        {
            try
            {
                object objectForRecordName = ((DatabaseDaemon)this.c.getDaemon(typeof(DatabaseDaemon))).GetObjectForRecordName(this.RecordName);
                if (objectForRecordName != null)
                {
                    object valueFromObject = ObjectSerializer.GetValueFromObject(objectForRecordName, this.FieldName);
                    try
                    {
                        double num1 = Convert.ToDouble(valueFromObject);
                        double num2 = Convert.ToDouble(this.TargetValue);
                        switch (this.Operation)
                        {
                        case ">":
                        case "greater":
                            return(num1 > num2);

                        case "<":
                        case "less":
                            return(num1 < num2);

                        case "=":
                        case "equals":
                            return(Math.Abs(num1 - num2) < 0.0001);
                        }
                    }
                    catch (FormatException ex)
                    {
                        if (valueFromObject == null)
                        {
                            return(false);
                        }
                        return(valueFromObject.ToString() == this.TargetValue);
                    }
                }
                return(false);
            }
            catch (Exception ex)
            {
                Utils.AppendToErrorFile(Utils.GenerateReportFromException(ex));
                return(true);
            }
        }