/// <summary> /// Link table /// 关联表 /// </summary> /// <param name="IncludeColumnName">包含列 include field</param> /// <param name="ExcludeColumnName">排除列 exclude field</param> /// <param name="ForeignTable">外联表名</param> /// <param name="LocalField">关联字段</param> /// <param name="ForeignField">外联字段</param> /// <param name="ForeignName">外联集合名</param> /// <returns></returns> public IHashTable TableLink(List <String> IncludeColumnName, List <String> ExcludeColumnName, String ForeignTable, String LocalField, String ForeignField, String ForeignName) { if (filterDefinition == null) { throw new Exception("filter cannot null"); } //数据库连接 if (_connectionConfig.IsAutoCloseConnection == false) { if (_database.CheckStatus() == false) { throw new Exception("databse connect not open"); } } if (_connectionConfig.IsAutoCloseConnection == true) { _database.Open(); } List <Hashtable> hr = _database.TableLink(_databasename, _TableName, filterDefinition, IncludeColumnName, ExcludeColumnName , ForeignTable, LocalField, ForeignField, ForeignName); if (_connectionConfig.IsAutoCloseConnection == true) { _database.Close(); } IHashTable DT = new IHashTable(hr); return(DT); }
/// <summary> /// get all data /// 得到表中所有数据 /// </summary> /// <param name="IncludeColumnName">包含列 include field</param> /// <param name="ExcludeColumnName">排除列 exclude field</param> /// <returns></returns> public IHashTable Data(List <String> IncludeColumnName, List <String> ExcludeColumnName) { //数据库连接 if (_connectionConfig.IsAutoCloseConnection == false) { if (_database.CheckStatus() == false) { throw new Exception("databse connect not open"); } } if (_connectionConfig.IsAutoCloseConnection == true) { _database.Open(); } List <Hashtable> hr; if (filterDefinition != null) { hr = _database.GetColumnDataSet(_databasename, _TableName, IncludeColumnName, ExcludeColumnName, filterDefinition); } else { hr = _database.GetColumnDataSet(_databasename, _TableName, IncludeColumnName, ExcludeColumnName, new BsonDocument()); } if (_connectionConfig.IsAutoCloseConnection == true) { _database.Close(); } IHashTable DT = new IHashTable(hr); return(DT); }
/// <summary> /// get recordnumber data by filter /// 得到指定数据的指定内容 /// </summary> /// <param name="StartNumber">开始行 Start line</param> /// <param name="RecordNumber">记录数 Record number</param> /// <returns></returns> public IHashTable Page(Int32 StartNumber, Int32 RecordNumber) { //数据库连接 if (_connectionConfig.IsAutoCloseConnection == false) { if (_database.CheckStatus() == false) { throw new Exception("databse connect not open"); } } if (_connectionConfig.IsAutoCloseConnection == true) { _database.Open(); } List <Hashtable> hr; if (filterDefinition != null) { hr = _database.GetTopPageRecordsData(_databasename, _TableName, new BsonDocument(), StartNumber, RecordNumber); } else { hr = _database.GetTopPageRecordsData(_databasename, _TableName, filterDefinition, StartNumber, RecordNumber); } if (_connectionConfig.IsAutoCloseConnection == true) { _database.Close(); } IHashTable DT = new IHashTable(hr); return(DT); }