Inheritance: System.Web.UI.WebControls.BaseCompareValidator
示例#1
0
        /// <summary>
        /// Compare two values using provided operator and data type.
        /// </summary>
        /// <param name="leftText"></param>
        /// <param name="rightText"></param>
        /// <param name="op"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public static bool CompareValues(string leftText, string rightText, ValidationCompareOperator op, ValidationDataType type)
        {
            System.Web.UI.WebControls.ValidationCompareOperator vco =
                (System.Web.UI.WebControls.ValidationCompareOperator)Enum.Parse(
                    typeof(System.Web.UI.WebControls.ValidationCompareOperator),
                    op.ToString());

            System.Web.UI.WebControls.ValidationDataType vdt =
                (System.Web.UI.WebControls.ValidationDataType)Enum.Parse(
                    typeof(System.Web.UI.WebControls.ValidationDataType),
                    type.ToString());

            //if(rightText=="" && op==ValidationCompareOperator.Equal)
            //{
            //    return String.Equals("", leftText);
            //}
            return(MyValidator.CompareValues(leftText, rightText, vco, vdt));
        }
	    /// <summary>
		/// Disable default ctor.
		/// </summary>
//		private ValidationUtil(){}

        static ValidationUtil()
	    {
	        _validator = new MyValidator();
	    }
示例#3
0
        /// <summary>
        /// Disable default ctor.
        /// </summary>
//		private ValidationUtil(){}

        static ValidationUtil()
        {
            _validator = new MyValidator();
        }