Ejemplo n.º 1
0
        public async Task InsertAsync(Shop shop)
        {
            _user.Shops.Add(shop);
            await _usersContext.InsertOrUpdateAsync(_user);

            _messanger.Publish(new ShopCreatedMessage(shop, this));
            _geofenceService.SetGeofenceTrigger(shop.Latitude, shop.Longitude, shop.Radius,
                                                $"Entered into {shop.Name}", $"You leaved {shop.Name} Why ;-(!", shop.Name);
        }
Ejemplo n.º 2
0
        public async Task LoginAsync(string username, string password)
        {
            await _authenticationContext.LoginUserAsync(username, password);

            var user = await _usersContext.GetAsync(username.Base64Encode());

            //TODO check this null
            user.Shops    = user.Shops.Where(x => x != null).ToList();
            user.Products = user.Products.Where(x => x != null).ToList();

            _settingsRepository.User = user;

            foreach (var shop in user.Shops)
            {
                _geofenceService.SetGeofenceTrigger(shop.Latitude, shop.Longitude, shop.Radius,
                                                    $"Entered into {shop.Name}", $"You leaved {shop.Name} Why ;-(!", shop.Name);
            }
        }