//----------------------------------- public override CResultAErreur GetDatas(CEasyQuerySource source) { CResultAErreur result = CResultAErreur.True; DataTable table = source.GetTable(this); result.Data = table; return(result); }
//----------------------------------- public override CResultAErreur GetDatas(CEasyQuerySource source, params string[] strIdsColonnesSources) { CResultAErreur result = CResultAErreur.True; List <string> strCols = new List <string>(); foreach (IColumnDefinition col in Columns) { CColumnDefinitionSNMP colSnmp = col as CColumnDefinitionSNMP; if (colSnmp != null) { if (strIdsColonnesSources.Contains(colSnmp.Id)) { strCols.Add(colSnmp.OIDString); } } } DataTable table = source.GetTable(this, strCols.ToArray()); result.Data = table; return(result); }
//----------------------------------- public override CResultAErreur GetDatas(CEasyQuerySource source, params string[] strIdsColonnesSources) { CResultAErreur result = CResultAErreur.True; List <string> strCols = new List <string>(); foreach (IColumnDefinition col in Columns) { CColumnDefinitionSNMP colSnmp = col as CColumnDefinitionSNMP; if (colSnmp != null) { if (strIdsColonnesSources.Contains(colSnmp.Id)) { strCols.Add(colSnmp.OIDString); } } } DataTable table = source.GetTable(this, strCols.ToArray()); if (table != null) { //Vérifie les types de colonnes, pour éviter les pbs de déclaration dans la mib (merci assentria) foreach (IColumnDefinition col in Columns) { CColumnDefinitionSNMP colSnmp = col as CColumnDefinitionSNMP; if (colSnmp != null) { DataColumn colDeTable = table.Columns[colSnmp.ColumnName]; if (colDeTable != null && colDeTable.DataType != col.DataType) { colSnmp.SnmpType = null; colSnmp.DataType = colDeTable.DataType; } } } } object a = Columns; result.Data = table; return(result); }