예제 #1
0
        private async Task <bool> SendSymptoms(Symptoms symptoms)
        {
            Report report = new Report(symptoms);

            report.id = await LocationsAggregator.RetrieveId();

            if (report.id == null)
            {
                return(false);
            }

            string data    = JsonConvert.SerializeObject(report);
            bool   success = await NetworkLayer.SendDataToServer(data);

            return(success);
        }
예제 #2
0
        private async void SendDataToServer()
        {
            // Before sending, make sure we have an Id. Do not send if we can't retrieve it
            DeviceLocationsBundle.id = await RetrieveId();

            if (DeviceLocationsBundle.id == null)
            {
                return;
            }

            string data    = JsonConvert.SerializeObject(DeviceLocationsBundle);
            bool   success = await NetworkLayer.SendDataToServer(data);

            if (success)
            {
                DeviceLocationsBundle.ClearLocations();
            }
        }