...
This commit is contained in:
@@ -38,7 +38,19 @@ namespace Common.Validation
|
||||
public static bool CheckUsername(this string Username)
|
||||
=> (Username.Length == 11 && Username.StartsWith("09"))
|
||||
|| (Username.Length == 9 && Username.StartsWith("E/"));
|
||||
public static bool CheckMobile(this string Mobile) => Mobile.Length == 11 && Mobile.StartsWith("09");
|
||||
public static bool CheckMobile(this string Mobile)
|
||||
{
|
||||
bool pars = true;
|
||||
foreach (var item in Mobile.ToCharArray())
|
||||
{
|
||||
if(!Int32.TryParse(item.ToString(),out int _))
|
||||
{
|
||||
pars = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return pars && Mobile.Length == 11 && Mobile.StartsWith("09");
|
||||
}
|
||||
public static bool IsValidEmail(this string email)
|
||||
{
|
||||
// الگوی ساده اما معتبر برای بررسی ایمیل
|
||||
|
Reference in New Issue
Block a user