Exemplo n.º 1
0
 public CheckParameter(CheckMethod method, CheckOperator op, object failedvalue, object warningvalue, string description)
 {
     this.Method       = method;
     this.Operator     = op;
     this.FailedValue  = failedvalue;
     this.WarningValue = warningvalue;
     this.Description  = description;
 }
Exemplo n.º 2
0
        private string getOperatorName(CheckOperator op)
        {
            switch (op)
            {
            case CheckOperator.GreaterThan:
                return("大于");

            case CheckOperator.LessThan:
                return("小于");

            case CheckOperator.Equal:
                return("等于");

            case CheckOperator.NotEqual:
                return("不等于");

            default:
                return("--");
            }
        }
Exemplo n.º 3
0
        private bool compareValue(CheckOperator op, double value, double threshold)
        {
            switch (op)
            {
            case CheckOperator.GreaterThan:
                if (value > threshold)
                {
                    return(true);
                }
                break;

            case CheckOperator.LessThan:
                if (value < threshold)
                {
                    return(true);
                }
                break;

            case CheckOperator.Equal:
                if (value == threshold)
                {
                    return(true);
                }
                break;

            case CheckOperator.NotEqual:
                if (value != threshold)
                {
                    return(true);
                }
                break;

            default:
                throw new Exception("比较操作符未定义");
            }

            return(false);
        }
Exemplo n.º 4
0
 public CheckExpression Or(Column thisColumn, CheckOperator checkOperator, Column thatColumn)
 {
     SqlDefinition = string.Concat(SqlDefinition.Trim(), " OR ", $"[{thisColumn.Name}] {checkOperator.GetStringValue()} [{thatColumn.Name}]");
     return(this);
 }
Exemplo n.º 5
0
 public CheckExpression Or(Column column, CheckOperator checkOperator, object value)
 {
     SqlDefinition = string.Concat(SqlDefinition.Trim(), " OR ", $"[{column.Name}] {checkOperator.GetStringValue()} {value.ToString()}");
     return(this);
 }
Exemplo n.º 6
0
 public CheckExpression(Column thisColumn, CheckOperator checkOperator, Column thatColumn) : this(thisColumn, checkOperator, $"[{thatColumn.Name}]")
 {
 }
Exemplo n.º 7
0
 public CheckExpression(Column column, CheckOperator checkOperator, object value) : this($"[{column.Name}] {checkOperator.GetStringValue()} {value.ToString()}")
 {
 }
Exemplo n.º 8
0
 public static bool IsMatch(CheckOperator checkOperator, string input)
 {
     return(checkOperator.CanCheck(CellOperationValue.Make(new TypedValue(null)),
                                   TestUtils.CreateCell(input)));
 }
Exemplo n.º 9
0
 public StackOperatorBlock(CheckOperator op)
 => this.op = op;
Exemplo n.º 10
0
 public static bool IsMatch(CheckOperator checkOperator, string input)
 {
     return checkOperator.CanCheck(CellOperationValue.Make(new TypedValue(null)),
                                                     TestUtils.CreateCell(input));
 }
Exemplo n.º 11
0
 public OperatorBlock(CheckOperator op, int index)
 {
     OP    = op;
     Index = index;
 }