Exemplo n.º 1
0
 /// <summary>
 /// 验证输入是否和目标ID元素的值相等
 /// </summary>
 /// <param name="box">验证框</param>      
 /// <param name="targetID">目标元素ID</param>
 /// <param name="errorMessage">提示信息</param>
 /// <returns></returns>
 public static ValidBox EqualTo(this ValidBox box, string targetID, string errorMessage)
 {
     var newBox = new EqualToRule(targetID) { ErrorMessage = errorMessage }.ToValidBox();
     return ValidBox.Merge(box, newBox);
 }
Exemplo n.º 2
0
 /// <summary>
 /// 验证输入是否和目标ID元素的值相等
 /// </summary>
 /// <param name="box">验证框</param>      
 /// <param name="targetID">目标元素ID</param>    
 /// <returns></returns>
 public static ValidBox EqualTo(this ValidBox box, string targetID)
 {
     var newBox = new EqualToRule(targetID).ToValidBox();
     return ValidBox.Merge(box, newBox);
 }