Esempio n. 1
0
 private void SendCurrentSchedule(int?campaignId)
 {
     if (campaignId != null)
     {
         var schedule = clientScheduleService.GetCurrentSchedule((int)campaignId);
         if (schedule != null)
         {
             string message = clientScheduleService.GetScheduleAsString(schedule);
             Clients.Caller.test1(message);
         }
     }
 }
Esempio n. 2
0
        private void NotifyCampaignUpdate(List <int> clientIds, int campaignId)
        {
            var context = GlobalHost.ConnectionManager.GetHubContext <ContentHub>();

            var schedule = clientScheduleService.GetCurrentSchedule(campaignId);

            if (schedule != null)
            {
                string message = clientScheduleService.GetScheduleAsString(schedule);

                foreach (int id in clientIds)
                {
                    string connID = ContentHub.GetClientConnection(id);
                    if (connID != null)
                    {
                        context.Clients.Client(connID).test1(message);
                        //return true;
                    }
                    //else
                    //    return false;
                }
            }
        }