public static TableField Parse(PropertyInfo property, DatabaseType type) { if (property.PropertyType == typeof(uint?)) { return(new UintField(property.Name, null)); } if (property.PropertyType == typeof(int?)) { return(new IntField(property.Name, null)); } if (property.PropertyType == typeof(string)) { return(new StringField(property.Name, null)); } if (property.PropertyType == typeof(double?) || property.PropertyType == typeof(float?)) { return(new DoubleField(property.Name, null)); } if (property.PropertyType == typeof(DateTime?)) { return(new DateTimeField(property.Name, null, DbLinkGateway.CreateFactory(type).CreateDateTimeFormater())); } throw new Exception($"不支持的类型{property.PropertyType}"); }
public void SetDatabaseConnection(DatabaseType databaseType, string connectionStr) { _databaseType = databaseType; DbLinkFactory factory = DbLinkGateway.CreateFactory(databaseType); DatabaseDrive = factory.CreateDatabaseDrive(connectionStr); _dataBaseFields = new List <TableField>(); _tableFieldPropertyMap = new TableFieldPropertyMap(this); CreateTableFields(); _primaryKeyField = FindTableFieldByName(_primaryKeyName); }
public DateDiffLessThanMinutesCondition(string fieldName, DateTime?dateTimeReference, int?timeSpanInMinute, DatabaseType dbType) : base(fieldName) { _dateTimeReference = dateTimeReference; _timeSpanInMinute = timeSpanInMinute; _formater = DbLinkGateway.CreateFactory(dbType).CreateDateTimeFormater(); }
} //初始化之后应立即设置formater public DateTimeBetweenCloseInterval(string fieldName, DateTime?begin, DateTime?end, DatabaseType dbType) : base(fieldName) { _begin = begin; _end = end; DateTimeFormater = DbLinkGateway.CreateFactory(dbType).CreateDateTimeFormater(); }
} //初始化之后应立即设置formater public DateEqual(string fieldName, DateTime?dateTime, DatabaseType dbType) : base(fieldName) { _dateTime = dateTime; DateTimeFormater = DbLinkGateway.CreateFactory(dbType).CreateDateTimeFormater(); }