Esempio n. 1
0
 /// <summary>
 /// 验证精度(小数点数)
 /// </summary>
 /// <param name="box">验证框</param>
 /// <param name="min">最小精度</param>
 /// <param name="max">最大精度</param>
 /// <param name="errorMessage">提示信息</param>
 /// <returns></returns>
 public static ValidBox Precision(this ValidBox box, int min, int max, string errorMessage)
 {
     var newBox = new PrecisionAttribute(min, max) { ErrorMessage = errorMessage }.ToValidBox();
     return ValidBox.Merge(box, newBox);
 }
Esempio n. 2
0
 /// <summary>
 /// 验证精度(小数点数)
 /// </summary>
 /// <param name="box">验证框</param>
 /// <param name="min">最小精度</param>
 /// <param name="max">最大精度</param>     
 /// <returns></returns>
 public static ValidBox Precision(this ValidBox box, int min, int max)
 {
     var newBox = new PrecisionAttribute(min, max).ToValidBox();
     return ValidBox.Merge(box, newBox);
 }