public static int?ToInt(object obj) { if (obj == null || obj == DBNull.Value || !CheckTools.isNumber(obj.ToString())) { return(null); } int result = default(int); int.TryParse(obj.ToString(), out result); return(result); }
public static int?ToInt(object obj) { if (obj == null || obj == DBNull.Value || !CheckTools.isNumber(obj.ToString())) { return(null); } int result = default(int); int.TryParse(obj.ToString(), out result); return(result); }