51 lines
2.0 KiB
C#
51 lines
2.0 KiB
C#
namespace LaaProduction.Console
|
|
{
|
|
using LaaPackages.HttpClient;
|
|
using LaaPackages.SqlClient;
|
|
using LaaProduction.Data.Cordonel;
|
|
using LaaProduction.Data.Cordonel.Sentinel;
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
using System;
|
|
using System.IO;
|
|
|
|
public class Program
|
|
{
|
|
public static void Main()
|
|
{
|
|
var sentinel = new Sentinel(
|
|
new HttpConnection("http://10.49.40.25/")
|
|
, new HttpConnection("localhost")
|
|
, new CordonelDbContext(
|
|
new SqlConnection("Server=SLASQL01.emea.sensus.net; Database=Auftrag; User ID=sa; Password=sqlserver;")));
|
|
var sentinelDataFile = @"..\..\sentinel-data.json";
|
|
|
|
var result = sentinel.CheckVFMStatus(212120036);
|
|
|
|
Console.WriteLine("=========================================================");
|
|
foreach (var kvp in result)
|
|
{
|
|
Console.WriteLine($"{kvp.Key}: {kvp.Value}");
|
|
}
|
|
Console.WriteLine("=========================================================");
|
|
|
|
if (result.Succeeded && result.ContainsKey("UsedData"))
|
|
{
|
|
var jsonSerializerSettings = new JsonSerializerSettings
|
|
{
|
|
Formatting = Formatting.Indented,
|
|
TypeNameHandling = TypeNameHandling.Objects | TypeNameHandling.Arrays,
|
|
TypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple
|
|
};
|
|
|
|
var json = JsonConvert.SerializeObject(result["UsedData"], jsonSerializerSettings);
|
|
File.WriteAllText(sentinelDataFile, json);
|
|
}
|
|
}
|
|
|
|
//const string URL_PATTERN = "https://nodes.sms-esaap.com/keygenproxy/api/v2/keys/devices?orderNumber={0}&radioaddress={1}";
|
|
//const string X_NODE_TOKEN_HEADER = "X-Node-Token";
|
|
//const string X_NODE_TOKEN = "d5b8c0b2-81f6-4421-80d0-44eb2093e616";
|
|
}
|
|
} |