Ejemplo n.º 1
0
 /// <summary>
 /// 获取某单元格的某校验类型集合
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="col"></param>
 /// <param name="typeFilterInfo"></param>
 /// <returns></returns>
 public static List <T> GetFilterAttrs <T>(this ExcelDataCol col, TypeFilterInfo typeFilterInfo)
     where T : BaseFilterAttribute
 {
     return(typeFilterInfo.PropertyFilterInfos.SingleOrDefault(a => a.PropertyName.Equals(col.PropertyName, StringComparison.CurrentCultureIgnoreCase))?.
            FilterAttrs?.Where(e => e.GetType() == typeof(T)).Cast <T>().ToList());
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 是否是日期
 /// </summary>
 /// <param name="col"></param>
 /// <returns></returns>
 public static bool IsDateTime(this ExcelDataCol col)
 {
     return(DateTime.TryParse(col.ColValue, out DateTime dt));
 }