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

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

            return(ValidBox.Merge(box, newBox));
        }
示例#4
0
 /// <summary>
 /// 验证输入是否和目标ID元素的值不相等
 /// </summary>
 /// <param name="box">验证框</param>
 /// <param name="targetID">目标元素ID</param>    
 /// <returns></returns>
 public static ValidBox NotEqualTo(this ValidBox box, string targetID)
 {
     var newBox = new NotEqualToRule(targetID).ToValidBox();
     return ValidBox.Merge(box, newBox);
 }