예제 #1
0
        private void WriteEventAndNotify(BeaconDevice beaconDevice, EventType eventType)
        {
            var beacon = _sqlConnection.Table <Beacon> ().Where(b => b.DeviceId == beaconDevice.Id).FirstOrDefault();

            if (beacon == null)
            {
                return;
            }

            _sqlConnection.GetChildren(beacon);

            var ev = new BeaconEvent {
                Beacon = beacon,
                Type   = eventType,
                Time   = DateTime.Now
            };

            _sqlConnection.InsertWithChildren(ev);

            if (App.Settings.Common.IsNotificationsOnEvents)
            {
                _notificationService.Show(string.Format(Resources.Strings.NotificaionMessageFormat, eventType, beacon.Name));
            }
        }
예제 #2
0
		private void WriteEventAndNotify (BeaconDevice beaconDevice, EventType eventType)
		{
			var beacon = _sqlConnection.Table<Beacon> ().Where (b => b.DeviceId == beaconDevice.Id).FirstOrDefault ();
			if (beacon == null)
				return;
			
			_sqlConnection.GetChildren (beacon);

			var ev = new BeaconEvent {
				Beacon = beacon,
				Type = eventType,
				Time = DateTime.Now
			};

			_sqlConnection.InsertWithChildren (ev);

			if (App.Settings.Common.IsNotificationsOnEvents)
				_notificationService.Show (string.Format (Resources.Strings.NotificaionMessageFormat, eventType, beacon.Name));
		}