private void notifyTicketsBought(Show show) { IEnumerable <Employee> users = userRepository.FindAll(); logger.Debug("Server: notifyTicketsBought Observer"); foreach (Employee us in users) { if (loggedClients.ContainsKey(us.Username)) { IAppObserver chatClient = loggedClients[us.Username]; Task.Run(() => chatClient.notifyTicketSold(show)); } } }
private void handleUpdate(Response response) { if (response.Type() == ResponseType.UPDATED_SHOWS) { // this is the handler for the TICKETS_SOLD request Show show = DTOUtils.getFromDTO((ShowDTO)response.Data()); try { client.notifyTicketSold(show); } catch (ServicesException e) { Console.WriteLine(e.StackTrace); } } }