Files
Mapo-IOB-WIN/EgwProxy.Gomba.Test/Program.cs
T
Samuele E. Locatelli 38b9ed255d Update test GOMBA
2023-09-12 11:13:42 +02:00

56 lines
2.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace EgwProxy.Gomba.Test
{
internal class Program
{
static void Main(string[] args)
{
// gestire da conf se saltare certificato
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
string linea = "-----------------------------";
Console.WriteLine(linea);
Console.WriteLine("Test comunicazione Gomba");
Console.WriteLine(linea);
Console.WriteLine();
string escimi = "N";
// init proxy SOAP
GombaServ.lwpServiceClient gombaConn = new GombaServ.lwpServiceClient();
//GombaServ.lwpServiceClient gombaConn = new GombaServ.lwpServiceClient("lwpServicePortBinding", new System.ServiceModel.EndpointAddress("https://308gomba:8000/ws"));
int idxReq = 5;
Console.WriteLine("Vuoi inviare richiesta peso? (S/N)");
escimi = Console.ReadLine().ToUpper();
if (escimi == "S")
{
gombaConn.memWeight("IN", $"{idxReq}", $"ODL000000{idxReq}", "INGRESSO", "15000", "PROVA", "2023.09.12", "11.00");
gombaConn.memWeight("OUT", $"{idxReq}", $"ODL000000{idxReq}", "USCITA", "25000", "PROVA", "2023.09.12", "12.00");
}
// lettura
Console.WriteLine("Pronto per ciclo lettura, premere un tasto per continuare");
Console.ReadLine();
escimi = "N";
while (escimi != "S")
{
var results = gombaConn.reqWeightList("ALL", "01/01/2023", "12/09/2023");
foreach (var item in results)
{
string pesata = $"rm: {item.rm} | DI: {item.dateIn} | DO: {item.dateOut} | BI: {item.balanceIn} | BO: {item.balanceOut} | WI: {item.weightIn} | WO: {item.weightOut} | net: {item.net} | MI: {item.idMemIn} | MO: {item.idMemOut} | Feed: {item.feedback} | note: {item.notes}";
Console.WriteLine(pesata);
}
Console.WriteLine("Vuoi uscrire? (S/N)");
escimi = Console.ReadLine().ToUpper();
}
}
}
}