예제 #1
0
        public async void AddBeacon (View view)
        {
            if (client == null || string.IsNullOrWhiteSpace (textNewToDo.Text)) {
                return;
            }

            // Create a new item
            var beacon = new Beacon {
              
                //add collum = value
                //for each collumn
                //leave complete it is nessecary for the localdb

                //this may need to wait for the gui integration

                Complete = false
            };

            try {
                await beaconTable.InsertAsync(beacon); // insert the new item into the local database
                await SyncAsync(); // send changes to the mobile service

                if (!beacon.Complete) {
                    adapter.Add (beacon);
                }
            } catch (Exception e) {
                CreateAndShowDialog (e, "Error");
            }

            textNewToDo.Text = "";
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CaaPa.Beacon"/> class.
 /// </summary>
 /// <param name="BeaconId ">BeaconId .</param>
 /// <param name="BeaconBluetoothKey ">BeaconBluetoothKey .</param>
 /// <param name="BeaconName ">BeaconName .</param>
 /// <param name="BeaconDesc">BeaconDesc.</param>
 /// <param name="LoationId">LocationID.</param>
 public BeaconWrapper(Beacon beacon)
 {
     Beacon = beacon;
 }
예제 #3
0
        public async Task CheckBeacon (Beacon beacon)
        {
            if (client == null) {
                return;
            }

            // Set the item as completed and update it in the table
            beacon.Complete = true;
            try {
                await beaconTable.UpdateAsync(beacon); // update the new item in the local database
                await SyncAsync(); // send changes to the mobile service

                if (beacon.Complete)
                    adapter.Remove (beacon);

            } catch (Exception e) {
                CreateAndShowDialog (e, "Error");
            }
        }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CaaPa.Beacon"/> class.
 /// </summary>
 /// <param name="BeaconId ">BeaconId .</param>
 /// <param name="BeaconBluetoothKey ">BeaconBluetoothKey .</param>
 /// <param name="BeaconName ">BeaconName .</param>
 /// <param name="BeaconDesc">BeaconDesc.</param>
 /// <param name="LoationId">LocationID.</param>
 public BeaconWrapper(Beacon beacon)
 {
     Beacon = beacon;
 }