Exemplo n.º 1
0
 /// <summary>
 /// 验证输入的值的范围
 /// </summary>
 /// <param name="box">验证框</param>       
 /// <param name="minValue">最小值</param>
 /// <param name="maxValue">最大值</param>
 /// <param name="errorMessage">提示信息</param>
 /// <returns></returns>
 public static ValidBox Range(this ValidBox box, int minValue, int maxValue, string errorMessage)
 {
     var newBox = new RangeAttribute(minValue, maxValue) { ErrorMessage = errorMessage }.ToValidBox();
     return ValidBox.Merge(box, newBox);
 }
Exemplo n.º 2
0
 /// <summary>
 /// 验证输入的值的范围
 /// </summary>
 /// <param name="box">验证框</param>       
 /// <param name="minValue">最小值</param>
 /// <param name="maxValue">最大值</param>       
 /// <returns></returns>
 public static ValidBox Range(this ValidBox box, int minValue, int maxValue)
 {
     var newBox = new RangeAttribute(minValue, maxValue).ToValidBox();
     return ValidBox.Merge(box, newBox);
 }