This commit is contained in:
2021-08-30 21:49:56 +08:00
parent 969c81925b
commit 8ce6070be5
110 changed files with 967 additions and 106 deletions
+15
View File
@@ -590,5 +590,20 @@ namespace BLL
}
}
#endregion
/// <summary>
/// 获取年龄
/// </summary>
/// <param name="birthDate"></param>
/// <param name="now"></param>
/// <returns></returns>
public static int CalculateAgeCorrect(DateTime birthDate)
{
DateTime now = DateTime.Now;
int age = now.Year - birthDate.Year;
if (now.Month < birthDate.Month || (now.Month == birthDate.Month && now.Day < birthDate.Day)) age--;
return age;
}
}
}
+4
View File
@@ -16,6 +16,10 @@ namespace BLL
/// <returns>验证成功为True,否则为False</returns>
public static bool CheckIDCard(string Id)
{
if (string.IsNullOrEmpty(Id))
{
return false;
}
if (Id.Length == 18)
{
bool check = CheckIDCard18(Id);