Exemplo 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);
            }
        }