예제 #1
0
        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));
                }
            }
        }
예제 #2
0
 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);
         }
     }
 }