Beispiel #1
0
        protected void Getlocationdetails(object sender, EventArgs e)
        {
            location.Service1Client locationobject = new location.Service1Client();
            string locationdetails = locationobject.GetlocationdetailsAPI(locationtextbox.Text);

            string[] details = locationdetails.Split(',');
            longitudelabel.Text = details[1];
            latitudelabel.Text  = details[0];
            zipcodelabel.Text   = details[2];
            return;
        }
Beispiel #2
0
        protected void GetCrimedataOfthePlace(object sender, EventArgs e)
        {
            location.Service1Client locationservicesobject = new location.Service1Client();
            string[]        latlong     = locationservicesobject.GetlocationdetailsAPI(placetextbox.Text).Split(',');
            HttpWebRequest  request     = (HttpWebRequest)WebRequest.Create("http://webstrar27.fulton.asu.edu/page1/service1.svc/GetCrimeData?latitude=" + latlong[0] + "&longitude=" + latlong[1]);
            HttpWebResponse response    = (HttpWebResponse)request.GetResponse();
            dynamic         parsed_JSON = JsonConvert.DeserializeObject <dynamic>(new StreamReader(response.GetResponseStream()).ReadToEnd());

            string[] data = Convert.ToString(parsed_JSON).Split(',');
            voilentcrimeslabel.Text  = Convert.ToString(data[0]);
            propertycrimeslabel.Text = Convert.ToString(data[1]);
            return;
        }
Beispiel #3
0
        protected void Getdistance(object sender, EventArgs e)
        {
            location.Service1Client locationobject = new location.Service1Client();
            string origindetails = locationobject.GetlocationdetailsAPI(origintextbox.Text);

            string[] details            = origindetails.Split(',');
            double   lat1               = Convert.ToDouble(details[0]);
            double   long1              = Convert.ToDouble(details[1]);
            string   destinationdetails = locationobject.GetlocationdetailsAPI(destinationtextbox.Text);

            string[] details2 = destinationdetails.Split(',');
            double   lat2     = Convert.ToDouble(details2[0]);
            double   long2    = Convert.ToDouble(details2[1]);

            Distance.Service1Client distanceobject = new Distance.Service1Client();
            string[] Distance = distanceobject.GetDistance(lat1, long1, lat2, long2);
            distancelabel.Text = "Distance Between " + origintextbox.Text + " and " + destinationtextbox.Text + " is " + Distance[0] + " Kilometers  or<br>" + Distance[2] + " Miles";
            return;
        }