Integration :

- lettura parametri macchina ora filtrata con Id configurazione corrente.
This commit is contained in:
Dario Sassi
2019-12-23 16:44:41 +00:00
parent 4b85e596da
commit 5bf6d86aed
+8 -4
View File
@@ -802,13 +802,15 @@ namespace ib.essetre.integration.egaltech
DataSet dsOffsets = new DataSet() ;
string sqlOffsets = "SELECT [group], [key], [value] " +
"FROM [ESSETRE].[dbo].[vw_MachineParam] " +
"WHERE [group] = 'OFFSETS' " ;
"FROM [ESSETRE].[dbo].[vw_MachineParam] " +
"WHERE [group] = 'OFFSETS' AND configurationId = @ConfigId" ;
// Connessione al DB ed esecuzione query
using ( SqlConnection cn = new SqlConnection(_SqlConnectionStr)) {
cn.Open() ;
using ( SqlCommand cmd = new SqlCommand(sqlOffsets, cn)) {
cmd.Parameters.Add( "@ConfigId", SqlDbType.Int) ;
cmd.Parameters["@ConfigId"].Value = parameters.ConfigurationId ;
var dataAdapter = new SqlDataAdapter( cmd) ;
// Lettura DB e riempimento DataSet
dsOffsets.Clear() ;
@@ -821,13 +823,15 @@ namespace ib.essetre.integration.egaltech
DataSet dsTrave = new DataSet() ;
string sqlTrave = "SELECT [group], [key], [value] " +
"FROM [ESSETRE].[dbo].[vw_MachineParam] " +
"WHERE [group] = 'TRAVE' " ;
"FROM [ESSETRE].[dbo].[vw_MachineParam] " +
"WHERE [group] = 'TRAVE' AND configurationId = @ConfigId" ;
// Connessione al DB ed esecuzione query
using ( SqlConnection cn = new SqlConnection(_SqlConnectionStr)) {
cn.Open() ;
using ( SqlCommand cmd = new SqlCommand( sqlTrave, cn)) {
cmd.Parameters.Add( "@ConfigId", SqlDbType.Int) ;
cmd.Parameters["@ConfigId"].Value = parameters.ConfigurationId ;
var dataAdapter = new SqlDataAdapter( cmd) ;
// Lettura DB e riempimento DataSet
dsTrave.Clear() ;