Пример #1
0
 public Models.GameTable GetGameTable(int id)
 {
     using (GameTableManagementServiceClient proxy = new GameTableManagementServiceClient()) {
         GameTableServiceReference.GameTable serviceGameTable = proxy.GetGameTableById(id);
         Models.GameTable clientGameTable = GameTableModelConverter.ConvertFromServiceGameTableToClientGameTable(serviceGameTable);
         return(clientGameTable);
     }
 }
Пример #2
0
 public GameTableModel GetById(int tableId)
 {
     using (GameTableManagementServiceClient proxy = new GameTableManagementServiceClient()) {
         var serviceGameTable = proxy.GetGameTableById(tableId);
         Models.GameTableModel clientGameTable = GameTableModelConverter.ConvertFromServiceGameTableToClientGameTable(serviceGameTable);
         return(clientGameTable);
     }
 }
Пример #3
0
        public Models.GameTable JoinGameTable(string userId, int tableId)
        {
            UserManagementServiceAccess userManagement = new UserManagementServiceAccess();

            using (GameTableManagementServiceClient proxy = new GameTableManagementServiceClient()) {
                Models.CGUser user = userManagement.GetUserByUserId(userId);
                GameTableServiceReference.CGUser    serviceUser      = GameTableModelConverter.ConvertFromClientUserToServiceUser(user);
                GameTableServiceReference.GameTable serviceTable1    = proxy.GetGameTableById(tableId);
                GameTableServiceReference.GameTable serviceGameTable = proxy.JoinGameTable(serviceUser, serviceTable1);
                Models.GameTable clientGameTable = GameTableModelConverter.ConvertFromServiceGameTableToClientGameTable(serviceGameTable);
                return(clientGameTable);
            }
        }