private async void loginclick(object sender, TappedRoutedEventArgs e)
        {
            show s = new show()
            {
                email = textBox1.Text
            };
            String pwd = textBox2.Password;

            try
            {
                DBserviceSoapClient db = new DBserviceSoapClient();
                var a = await db.logincheckAsync(textBox1.Text, pwd);

                if (a.Body.logincheckResult == 0)
                {
                    textBox.Content = "login failed";
                }
                else
                {
                    this.Frame.Navigate(typeof(rideoptions), s);
                }
            }
            catch (Exception ex)
            {
                textBox.Content = "Server Error Try again";
            }
        }
        private async void registerclick(object sender, TappedRoutedEventArgs e)
        {
            textBox_Copy.Content = "";
            String pwd             = textBox6.Password;
            String pwd1            = textBox7.Password;
            bool   iss             = true;
            DBserviceSoapClient db = new DBserviceSoapClient();

            if (textBox8.Text.Length == 0)
            {
                textBox_Copy1.Content = "Maker/Brand Field is Empty";
                iss = false;
            }
            if (textBox9.Text.Length == 0)
            {
                textBox_Copy1.Content = "Car Name field is empty";
                iss = false;
            }
            if (textBox10.Text.Length == 0)
            {
                textBox_Copy1.Content = "Mileage Field is empty";
                iss = false;
            }
            if (textBox11.Text.Length == 0)
            {
                textBox_Copy1.Content = "Variant Field is empty";
                iss = false;
            }
            if (IsDigitsOnly(textBox10.Text) == false)
            {
                textBox_Copy1.Content = "Mileage Field contains characters";
                iss = false;
            }
            if (iss == true)
            {
                try
                {
                    var a = await db.InsertDataAsync(textBox3.Text, textBox4.Text, Int64.Parse(textBox5.Text), pwd, textBox8.Text, textBox9.Text, int.Parse(textBox10.Text), textBox11.Text);

                    if (a.Body.InsertDataResult == 1)
                    {
                        textBox_Copy1.Content = "Email or phonenumber already registered";
                        reg2panel.Visibility  = Visibility.Collapsed;
                        reg1panel.Visibility  = Visibility.Visible;
                    }
                    else
                    {
                        reg2panel.Visibility  = Visibility.Collapsed;
                        loginpanel.Visibility = Visibility.Visible;
                    }
                }
                catch (Exception ex)
                {
                    textBox_Copy1.Content = "Server error... Click the register button again";
                }
            }
        }
        private async void setridefin(object sender, TappedRoutedEventArgs e)
        {
            int  mi    = timepick.Time.Minutes;
            int  hrs   = timepick.Time.Hours;
            int  day   = DateTime.Now.Date.Day;
            int  month = DateTime.Now.Date.Month;
            int  year  = DateTime.Now.Date.Year;
            bool boo   = true;

            if (textBox.Text.Length == 0)
            {
                button_Copy2.Content = "Starting place field is empty";
                boo = false;
            }
            if (textBox2.Text.Length == 0)
            {
                button_Copy2.Content = "Destination field is empty";
                boo = false;
            }
            if (textBox2_Copy.Text.Length == 0)
            {
                button_Copy2.Content = "No. of persons allowed field is empty";
                boo = false;
            }


            DBserviceSoapClient db = new DBserviceSoapClient();

            string addressToGeocode  = textBox.Text;
            string addressToGeocode1 = textBox2.Text;

            BasicGeoposition queryHint = new BasicGeoposition();

            queryHint.Latitude  = 20.5937;
            queryHint.Longitude = 79.9629;
            Geopoint hintPoint             = new Geopoint(queryHint);
            MapLocationFinderResult result = await MapLocationFinder.FindLocationsAsync(addressToGeocode, hintPoint, 3);

            String lat = result.Locations[0].Point.Position.Latitude.ToString();
            String lon = result.Locations[0].Point.Position.Longitude.ToString();

            decimal          orglat, orglon, orglat1, orglon1;
            BasicGeoposition queryHint1 = new BasicGeoposition();

            queryHint1.Latitude  = 20.5937;
            queryHint1.Longitude = 79.9629;
            Geopoint hintPoint1             = new Geopoint(queryHint1);
            MapLocationFinderResult result1 = await MapLocationFinder.FindLocationsAsync(addressToGeocode1, hintPoint, 3);

            String lat1 = result1.Locations[0].Point.Position.Latitude.ToString();
            String lon1 = result1.Locations[0].Point.Position.Longitude.ToString();

            orglat  = decimal.Parse(lat);
            orglon  = decimal.Parse(lon);
            orglat1 = decimal.Parse(lat1);
            orglon1 = decimal.Parse(lon1);

            orglat  = Math.Round(orglat, 4);
            orglon  = Math.Round(orglon, 4);
            orglat1 = Math.Round(orglat1, 4);
            orglon1 = Math.Round(orglon1, 4);

            int cap = int.Parse(textBox2_Copy.Text);

            if (result1.Status == MapLocationFinderStatus.Success && result.Status == MapLocationFinderStatus.Success)
            {
                if (boo == true)
                {
                    try
                    {
                        await db.arraythingAsync(day, year, month);

                        var a = await db.setrideAsync(textBox.Text, textBox2.Text, orglat, orglon, orglat1, orglon1, hrs, mi, day, month, year, emails, "set", cap);

                        var bb = await db.arrlengthAsync(day);

                        /* String [] s = new String[bb];
                         * for(int jj=0;jj< bb;jj++)
                         * {
                         *   s[jj] = b.Body.arraythingResult[jj];
                         * }
                         */
                        button_Copy2.Content = "sucess";
                    }
                    catch (Exception ex)
                    {
                        textBox.Text         = "";
                        textBox2.Text        = "";
                        textBox2_Copy.Text   = "";
                        button_Copy2.Content = "Server error...Re-enter";
                    }
                }
            }
            else
            {
                button_Copy2.Content = "Invalid Place";
            }
        }
 private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress()
 {
     return(DBserviceSoapClient.GetEndpointAddress(EndpointConfiguration.DBserviceSoap));
 }
 private static System.ServiceModel.Channels.Binding GetDefaultBinding()
 {
     return(DBserviceSoapClient.GetBindingForEndpoint(EndpointConfiguration.DBserviceSoap));
 }
 public DBserviceSoapClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(DBserviceSoapClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
 public DBserviceSoapClient(EndpointConfiguration endpointConfiguration) :
     base(DBserviceSoapClient.GetBindingForEndpoint(endpointConfiguration), DBserviceSoapClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
 public DBserviceSoapClient() :
     base(DBserviceSoapClient.GetDefaultBinding(), DBserviceSoapClient.GetDefaultEndpointAddress())
 {
     this.Endpoint.Name = EndpointConfiguration.DBserviceSoap.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }