Inheritance: System.Web.UI.WebControls.BaseCompareValidator
Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
	    /// <summary>
		/// Disable default ctor.
		/// </summary>
//		private ValidationUtil(){}

        static ValidationUtil()
	    {
	        _validator = new MyValidator();
	    }
Ejemplo n.º 3
0
        /// <summary>
        /// Disable default ctor.
        /// </summary>
//		private ValidationUtil(){}

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