Integration 2.2e1 :

- aggiunta gestione dati utente (vw_ConfigurationParam).
This commit is contained in:
Dario Sassi
2020-05-21 12:22:58 +00:00
parent 593d9f577d
commit b957b51fa4
2 changed files with 44 additions and 5 deletions
+42 -3
View File
@@ -1050,7 +1050,30 @@ namespace ib.essetre.integration.egaltech
}
}
// Apro file
// Preparazione interrogazione per Dati Utente del DB
_SqlConnectionStr = parameters.ConnectionString;
DataSet dsUser = new DataSet();
string sqlUser = "SELECT [group], [key], [value] " +
"FROM [ESSETRE].[dbo].[vw_ConfigurationParam] " +
"WHERE [group] <> 'TEXTS' AND [group] <> 'PARAMS' AND configurationId = @ConfigId";
// Connessione al DB ed esecuzione query
using (SqlConnection cn = new SqlConnection(_SqlConnectionStr))
{
cn.Open();
using (SqlCommand cmd = new SqlCommand(sqlUser, cn))
{
cmd.Parameters.Add("@ConfigId", SqlDbType.Int);
cmd.Parameters["@ConfigId"].Value = parameters.ConfigurationId;
var dataAdapter = new SqlDataAdapter(cmd);
// Lettura DB e riempimento DataSet
dsUser.Clear();
dataAdapter.Fill(dsUser);
}
}
// Apro file
using ( var tw = new StreamWriter( DataPath, false)) {
// Scrittura intestazione
@@ -1083,8 +1106,24 @@ namespace ib.essetre.integration.egaltech
tw.WriteLine( "}") ;
tw.WriteLine( "") ;
// Scrittura tabella da restituire
tw.WriteLine( "local Machine = { Offsets=Offsets, Trave=Trave}") ;
// Scrittura dei dati di Utente
tw.WriteLine("local User = {");
foreach (DataTable table in dsUser.Tables)
{
foreach (DataRow row in table.Rows)
{
String Group = row["group"].ToString();
String Key = row["key"].ToString();
String Value = row["value"].ToString();
tw.WriteLine(" " + Group + "_" + Key + "=" + Value + ",");
}
}
tw.WriteLine(" Zzz=1");
tw.WriteLine("}");
tw.WriteLine("");
// Scrittura tabella da restituire
tw.WriteLine( "local Machine = { Offsets=Offsets, Trave=Trave, User=User}") ;
tw.WriteLine( "return Machine") ;
}
@@ -36,5 +36,5 @@ using System.Runtime.InteropServices;
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// usando l'asterisco '*' come illustrato di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.2.2.2")]
[assembly: AssemblyFileVersion("2.2.2.2")]
[assembly: AssemblyVersion("2.2.5.1")]
[assembly: AssemblyFileVersion("2.2.5.1")]