123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System.Resources;
- namespace IPL.HRMS.Common.I18N
- {
- /// <summary>
- /// 数据验证消息国际化
- /// </summary>
- public class ValidateI18N
- {
- private static readonly ResourceManager _resourceManager = new ResourceManager(typeof(ValidateI18N));
- /// <summary>
- /// 必填
- /// </summary>
- public static string Required => GetString("Required");
- /// <summary>
- /// 最长
- /// </summary>
- public static string Max => GetString("Max");
- /// <summary>
- /// 最小
- /// </summary>
- public static string Min => GetString("Min");
- /// <summary>
- /// 电话号码
- /// </summary>
- public static string PhoneNumber => GetString("PhoneNumber");
- /// <summary>
- /// 邮箱
- /// </summary>
- public static string Email => GetString("Email");
- /// <summary>
- /// 日期格式
- /// </summary>
- public static string DateFormat => GetString("Unknown");
- /// <summary>
- /// 未知校验错误
- /// </summary>
- public static string Unknown => GetString("Unknown");
- /// <summary>
- /// 获取对应的I18N消息
- /// </summary>
- /// <param name="name"></param>
- /// <returns></returns>
- public static string GetString(string name)
- {
- return _resourceManager.GetString(name);
- }
- }
- }
|