Exemple #1
0
        public async Task AddSearch(NavigatorSearch search)
        {
            if (!Searches.ContainsKey(search.Id))
            {
                await _dao.AddPlayerSearchAsync(search, _player.Id);

                Searches.Add(search.Id, search);
            }
        }
Exemple #2
0
        internal async Task <Dictionary <int, NavigatorSearch> > ReadPlayerSearchesAsync(int id)
        {
            Dictionary <int, NavigatorSearch> searches = new Dictionary <int, NavigatorSearch>();

            await SelectAsync(async reader =>
            {
                while (await reader.ReadAsync())
                {
                    NavigatorSearch search = new NavigatorSearch(reader);
                    if (searches.ContainsKey(search.Id))
                    {
                        searches.Add(search.Id, search);
                    }
                }
            }, "SELECT * FROM `habbo_saved_searches` WHERE `user_id` = @0", id);

            return(searches);
        }
Exemple #3
0
 internal async Task AddPlayerSearchAsync(NavigatorSearch search, int userId)
 {
     search.Id = await InsertAsync("INSERT INTO `habbo_saved_searches` (`page`, `code`, `user_id`) VALUES (@0, @1, @2);", search.Page, search.Code, userId);
 }