Beispiel #1
0
        static bool RightelValidation(string mobile, PhoneFormatType type)
        {
            var regexgen = new PhoneReqularExpressionFactory(type);

            var regex = new Regex(regexgen.RightelExpressionMaker());

            return(regex.IsMatch(mobile));
        }
Beispiel #2
0
 public PhoneReqularExpressionFactory(PhoneFormatType phoneFormat)
 {
     _phoneFormat = phoneFormat;
 }
Beispiel #3
0
        public static bool IsValidMobile(this string mobile, OpratorType oprator = OpratorType.AllOpprator, PhoneFormatType type = PhoneFormatType.StartWithZero)
        {
            switch (oprator)
            {
            default:
            case OpratorType.AllOpprator:
                return(HamrahavalValidation(mobile, type) || IrancellValidation(mobile, type) ||
                       RightelValidation(mobile, type));

            case OpratorType.HamrahAval:
                return(HamrahavalValidation(mobile, type));

            case OpratorType.IranCell:
                return(IrancellValidation(mobile, type));

            case OpratorType.Rightel:
                return(RightelValidation(mobile, type));
            }
        }