public JsonResult GetAlarmGroups() { var alarms = AlarmsViewModel.OnGKObjectsStateChanged(null); var alarmGroupsViewModel = new AlarmGroupsViewModel(); alarmGroupsViewModel.Update(alarms); return Json(alarmGroupsViewModel, JsonRequestBehavior.AllowGet); }
public void BroadcastAlarms() { var alarms = AlarmsViewModel.OnGKObjectsStateChanged(null); var alarmsViewModel = new AlarmsViewModel(); alarmsViewModel.UpdateAlarms(alarms); var alarmGroupsViewModel = new AlarmGroupsViewModel(); alarmGroupsViewModel.Update(alarms); Clients.All.updateAlarms(new {alarms = alarmsViewModel, groups = alarmGroupsViewModel}); }