public void Initialize(string agencyId, string roleId, string userId) { // NotifierEntity = NotifierEntity.FromJson(value); var contexts = _connections.GetConnections(Context.User.Identity.Name).Where(x => x.ConnectionId == Context.ConnectionId).ToList(); contexts.ForEach(x => { x.AgencyId = agencyId; x.RoleId = roleId; x.UserId = userId; }); Parallel.ForEach(contexts, (current) => { _connections.Add(Context.User.Identity.Name, current); }); NotifierEntity = new NotifierEntity(); NotifierEntity.SqlConnectionString = ConfigurationManager.ConnectionStrings[FingerprintsData.connection.ConnectionString].ConnectionString; NotifierEntity.SqlQuery = "SELECT [YakkrId],[ClientId],[StaffID],[StaffIDR] from [dbo].[YakkrRouting]"; NotifierEntity.SqlParameters = new List <SqlParameter>(); //if (NotifierEntity == null) // return; Action <String> dispatcher = (t) => { DispatchToClient(); }; PushSqlDependency.Instance(NotifierEntity, dispatcher); }
public void Initialize(string value) { NotifierEntity = NotifierEntity.FromJson(value); if (NotifierEntity == null) { return; } Action <string> dispatcher = (t) => { DispatchToClient(); }; PushSqlDependency.Instance(NotifierEntity, dispatcher); }
public void Initialize(String userName) { if (!string.IsNullOrEmpty(userName)) { NotifierEntity = db.GetNotifierEntity <Messages>(db.Messages.Where(x => x.ApplicationUser.UserName == userName && !x.Status)); if (NotifierEntity == null) { return; } Action <String> dispatcher = (t) => { DispatchToClient(); }; PushSqlDependency.Instance(NotifierEntity, dispatcher); } }
public void SetNotificationEntry() { NotifierEntity = new NotifierEntity(); NotifierEntity.SqlConnectionString = ConfigurationManager.ConnectionStrings[FingerprintsData.connection.ConnectionString].ConnectionString; NotifierEntity.SqlQuery = "SELECT [ClientId],[AttendanceDate],[CenterID],[ClassroomId] from [dbo].[ClientAttendance]"; NotifierEntity.SqlParameters = new List <SqlParameter>(); Action <String> dispatcher = (t) => { _executiveDashboardTicker.BroadCastExecutiveDashboardTicker(); }; PushSqlDependency.Instance(NotifierEntity, dispatcher); }
private void SetNotificationEntry() { NotifierEntity = new NotifierEntity(); NotifierEntity.SqlConnectionString = ConfigurationManager.ConnectionStrings[FingerprintsData.connection.ConnectionString].ConnectionString; NotifierEntity.SqlQuery = "SELECT [YakkrId],[ClientId],[StaffID],[StaffIDR] from [dbo].[YakkrRouting]"; NotifierEntity.SqlParameters = new List <SqlParameter>(); Action <String> dispatcher = (t) => { _yakkrTicker.BroadcastYakkrTicker(); }; PushSqlDependency.Instance(NotifierEntity, dispatcher); }