edc41cd8f7
fatti installer SP ( prod/test )
73 lines
3.0 KiB
C#
73 lines
3.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using Microsoft.AspNet.SignalR;
|
|
using GMW_data;
|
|
|
|
namespace GMW_RT
|
|
{
|
|
/// <summary>
|
|
/// Classe gestione comunicazione Broadcast verso client RT
|
|
/// </summary>
|
|
public class Broad
|
|
{
|
|
/// <summary>
|
|
/// classe statica per invio messaggi a tutto il canale
|
|
/// </summary>
|
|
public static Broad cast = new Broad();
|
|
/// <summary>
|
|
/// contesto hub da usare
|
|
/// </summary>
|
|
protected IHubContext _hubContext;
|
|
/// <summary>
|
|
/// init classe
|
|
/// </summary>
|
|
protected Broad()
|
|
{
|
|
_hubContext = GlobalHost.ConnectionManager.GetHubContext<ChatHub>();
|
|
}
|
|
/// <summary>
|
|
/// metodo di invio messaggio...
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="messaggio"></param>
|
|
public void sendMess(string sender, string messaggio)
|
|
{
|
|
//var hubContext = GlobalHost.ConnectionManager.GetHubContext<ChatHub>();
|
|
//hubContext.Clients.All.broadcastMessage("BroadCast", messaggio);
|
|
_hubContext.Clients.All.broadcastMessage(sender, messaggio);
|
|
|
|
// non va cross domain, va fatto un setup + complesso...
|
|
//http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-javascript-client#crossdomain
|
|
}
|
|
/// <summary>
|
|
/// metodo invio messaggio a pagina tablet
|
|
/// </summary>
|
|
/// <param name="text01">Testo primario (codice UDC)</param>
|
|
/// <param name="text02">Testo secondario (particolare)</param>
|
|
/// <param name="text03">Note per utente</param>
|
|
/// <param name="text04">num pezzi caricati</param>
|
|
/// <param name="text05">num pezzi tot</param>
|
|
/// <param name="text06">num pezzi restanti</param>
|
|
/// <param name="css1">Classe css blocco 1</param>
|
|
/// <param name="css2">Classe css blocco 2</param>
|
|
/// <param name="css3">Classe css blocco 3</param>
|
|
public void updateTablet(string text01, string text02, string text03, string text04, string text05, string text06, string css1, string css2, string css3)
|
|
{
|
|
// salvo su DB i valori segnalati...
|
|
utils.obj.taRTPV.upsert("PostLiquidi", "text01", text01);
|
|
utils.obj.taRTPV.upsert("PostLiquidi", "text02", text02);
|
|
utils.obj.taRTPV.upsert("PostLiquidi", "text03", text03);
|
|
utils.obj.taRTPV.upsert("PostLiquidi", "text04", text04);
|
|
utils.obj.taRTPV.upsert("PostLiquidi", "text05", text05);
|
|
utils.obj.taRTPV.upsert("PostLiquidi", "text06", text06);
|
|
utils.obj.taRTPV.upsert("PostLiquidi", "css1", css1);
|
|
utils.obj.taRTPV.upsert("PostLiquidi", "css2", css2);
|
|
utils.obj.taRTPV.upsert("PostLiquidi", "css3", css3);
|
|
// invio le stringhe alla pagina via signalR
|
|
_hubContext.Clients.All.sendPanelUpdate(text01, text02, text03, text04, text05, text06, css1, css2, css3);
|
|
}
|
|
|
|
}
|
|
} |