Example #1
0
 /// <summary>
 /// Remove game of a user
 /// </summary>
 /// <param name="user"></param>
 /// <returns></returns>
 public bool RemoveGameByUser(UserWcf user) 
 {
     DAL dal = new DAL();
     User dbUser = dal.GetUser(user.ID);
     if (dbUser != null)
     {
         Game game = dal.GetGame(dbUser);
         if(game != null)
         {
             dal.removeGame(game);
             return true;
         }
     }
     return false;
 }
Example #2
0
        /// <summary>
        /// remove game specified by IP
        /// </summary>
        /// <param name="IP"></param>
        public void RemoveGameByIP(String IP)
        {
            DAL dal = new DAL();
            Game game = dal.GetGame(IP);
            if(game != null)
                {
                    dal.removeGame(game);
                    WcfServiceCallback update = OperationContext.Current.GetCallbackChannel<WcfServiceCallback>();
                    update.updateGames("remove", gameToWCF(game)); // this should notify the cients that the lsit has been updatd
                }

        }