Ejemplo n.º 1
0
        private async void sendCurrentLocation(Account logAccount)
        {
            int counter = 0;

            while (exitloop == 0)
            {
                System.Diagnostics.Debug.WriteLine(" In the send Current location loop " + DateTime.Now.ToLocalTime().ToString());
                cdCallAPI  mycallAPI = new cdCallAPI();
                cdLocation myloc     = new cdLocation();
                setCurrentLoc();
                myloc.cdLatitude  = csPosLat;
                myloc.cdLongitude = csPosLang;
                myloc.driverID    = logAccount.UserName;
                myloc.cddatetime  = logAccount.UserName + DateTime.Now.ToShortDateString();
                myloc.TripID      = logAccount.UserName + DateTime.Now.ToLocalTime().ToString();
                myloc.seqNumber   = counter;
                myloc.Attr1       = "NA";
                myloc.Attr2       = "NA";
                myloc.Attr3       = "NA";
                myloc.Attr4       = "NA";
                myloc.Attr5       = "NA";
                myloc.Attr6       = "NA";
                myloc.Attr7       = "NA";
                myloc.Attr8       = "NA";
                myloc.Attr9       = "NA";
                myloc.Attr10      = "NA";
                var jsreponse = await mycallAPI.cdSendLocation(myloc);

                counter = counter + 1;
                await Task.Delay(5000);
            }
        }
Ejemplo n.º 2
0
        public async Task <JToken> cdSendLocation(cdLocation dloc)
        {
            System.Diagnostics.Debug.WriteLine("  Location is " + dloc.cdLongitude + " " + dloc.cdLatitude);
            System.Diagnostics.Debug.WriteLine("  Trip ID is " + dloc.TripID);
            cdCallAPI mycallAPI = new cdCallAPI();
            var       response  = await mycallAPI.cdCallPutAPI(App.cdTrackLocPutPost, dloc, App.cdDriverLocationKey);

            return(response);
        }