public InternalTk5DbSqlEasySearch(SqlEasySearchConfig config) : base(config.Sql, config.IdField, config.NameField, CreateDbContext(config.Context)) { ContextName = config.Context; OrderBy = config.OrderBy; if (config.TopCount > 0) { TopCount = config.TopCount; } if (!string.IsNullOrEmpty(config.PyField)) { PinyinField = this[config.PyField]; } if (!string.IsNullOrEmpty(config.NameExpression)) { NameExpression = config.NameExpression; } if (!string.IsNullOrEmpty(config.DisplayNameExpression)) { DisplayNameExpression = config.DisplayNameExpression; } FilterSql = config.FilterSql; if (config.DataRight != null) { DataRight = config.DataRight.CreateObject(this); } SearchMethod = SearchPlugInFactory.CreateSearch(config.SearchMethod, false); }
internal Tk5DbEasySearch(BaseEasySearchConfig config) : base(MetaDataUtil.ConvertToTableScheme(config.CreateScheme()), config.IdField, config.NameField) { ContextName = config.Context; OrderBy = config.OrderBy; if (config.TopCount > 0) { TopCount = config.TopCount; } if (!string.IsNullOrEmpty(config.PyField)) { PinyinField = this[config.PyField]; } if (!string.IsNullOrEmpty(config.NameExpression)) { NameExpression = config.NameExpression; } if (!string.IsNullOrEmpty(config.DisplayNameExpression)) { DisplayNameExpression = config.DisplayNameExpression; } FilterSql = config.FilterSql; if (config.DataRight != null) { DataRight = config.DataRight.CreateObject(this); } SetActiveData(SourceScheme.Convert <Tk5DataXml>()); SearchMethod = SearchPlugInFactory.CreateSearch(config.SearchMethod, false); }