public async void Search_Clicked(object sender, System.EventArgs e)
 {
     if (AppStatics.CheckInternetConnection())
     {
         if (TbSearch.Icon.File == "top_search_icon.png")
         {
             SearchhStack.HeightRequest = 45;
             SearchhStack.IsVisible     = true;
             TbSearch.Icon = "menu_drawer_close_icon.png";
         }
         else
         {
             SearchhStack.HeightRequest = 0;
             SearchhStack.IsVisible     = false;
             TbSearch.Icon           = "top_search_icon.png";
             lstWalkTour.ItemsSource = _walktourList;
             txtbxSearch.Text        = "";
             lblNoRecord.IsVisible   = false;
             DependencyService.Get <VadodaraByFoot.Interface.IDissmissKeyboard>().DismissKeyboard();
             //txtbxSearch.Unfocus();
         }
     }
     else
     {
         AppStatics.Loading(loading, false);
         await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
     }
 }
        public async Task CallWebserviceAboutUs()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    RootObjectAboutUs response = await CallWebservice.GetResponse_Get <RootObjectAboutUs>(WebServiceURL.Url_AboutUs);

                    if (response != null)
                    {
                        if (response._resultflag == "1")
                        {
                            DetailData              = response;
                            imgHeader.Source        = response.is_image;
                            lblTourDescription.Text = response.content;
                            lblTourName.Text        = AppResources.AppResources.LAbt_Vadodara_By_Foot;
                            ContentLayout.IsVisible = true;
                        }
                    }
                    else
                    {
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
            AppStatics.Loading(loading, false);
        }
Esempio n. 3
0
        public async Task CallWebserviceFAQ()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    RootObjectFAQ response = await CallWebservice.GetResponse_Get <RootObjectFAQ>(WebServiceURL.Url_FAQ);

                    if (response != null)
                    {
                        if (response._resultflag == "1")
                        {
                            for (int i = 0; i < response.faqlist.Count; i++)
                            {
                                var objFAQ = new Faqlist();
                                objFAQ.TapId           = i.ToString();
                                objFAQ.expand_collapse = "faq_plus.png";
                                objFAQ.ObjIsVisible    = false;
                                objFAQ.title           = response.faqlist[i].title;
                                objFAQ.content         = response.faqlist[i].content;
                                objFAQ.TitleFontSize   = AppStatics.GetFontSizeMedium();
                                objFAQ.DetailFontSize  = AppStatics.GetFontSizeSmall();
                                ListFAQ.Add(objFAQ);
                            }
                            lstFAQ.ItemsSource = ListFAQ;
                            AppStatics.Loading(loading, false);
                        }
                    }
                    else
                    {
                        AppStatics.Loading(loading, false);
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
        public async Task CallWebserviceWalkTourList()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    RootObjectWalkTourList response = await CallWebservice.GetResponse_Get <RootObjectWalkTourList>(WebServiceURL.Url_walktourlst);

                    if (response != null)
                    {
                        if (response._resultflag == "1")
                        {
                            foreach (var tourobj in response.Walktour)
                            {
                                tourobj.TitleFontSize = AppStatics.GetFontSizeMedium();
                            }
                            lstWalkTour.ItemsSource = response.Walktour;
                            _walktourList           = response.Walktour;
                            AppStatics.Loading(loading, false);
                            foreach (var objwalktour in response.Walktour)
                            {
                                objwalktour.title              = objwalktour.title.ToUpper();
                                objwalktour.EndColorGradient   = new Xamarin.Forms.Color(0, 0, 0, 0.8);
                                objwalktour.StartColorGradient = Xamarin.Forms.Color.Transparent;
                            }
                        }
                    }
                    else
                    {
                        AppStatics.Loading(loading, false);
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
Esempio n. 5
0
        public async System.Threading.Tasks.Task CallWebserviceFeedback()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    AppStatics.Loading(loading, true);
                    List <KeyValuePair <string, string> > values = new List <KeyValuePair <string, string> >();
                    values.Add(new KeyValuePair <string, string>("your-name", txtbxFullName.Text));
                    values.Add(new KeyValuePair <string, string>("your-email", txtbxEmail.Text));
                    values.Add(new KeyValuePair <string, string>("your-subject", txtbxSubject.Text));
                    values.Add(new KeyValuePair <string, string>("your-message", txtbxMessage.Text));
                    values.Add(new KeyValuePair <string, string>("mobile-no", "9898898989"));
                    var response = await CallWebservice.GetResponse_Post <RootObjectFeedback>(WebServiceURL.Url_Feedback, values);

                    AppStatics.Loading(loading, false);
                    if (response != null)
                    {
                        await DisplayAlert(AppResources.AppResources.LMessage, response.message, AppResources.AppResources.LOk);

                        if (response._resultflag == "1")
                        {
                            txtbxFullName.Text = "";
                            txtbxEmail.Text    = "";
                            txtbxSubject.Text  = "";
                            txtbxMessage.Text  = "";
                        }
                    }
                    else
                    {
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
Esempio n. 6
0
        public async Task CallWebserviceWalkTourDetail()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    RootObjectWalkTourDetail response = await CallWebservice.GetResponse_Get <RootObjectWalkTourDetail>(WebServiceURL.Url_walktourdetail + _tourId);

                    if (response != null)
                    {
                        if (response._resultflag == "1")
                        {
                            DetailData = response;
                            lblTourDescription.Text = response.Walktourdetail.excerpt;
                            lblTourName.Text        = response.Walktourdetail.title.ToUpper();

                            #region
                            await CallMapDataPoints();

                            #endregion

                            /*   AppStatics.Loading(loading, false);
                             * ContentLayout.IsVisible = true;
                             * imgPlaceDetail.IsVisible = true;*/
                        }
                    }
                    else
                    {
                        AppStatics.Loading(loading, false);
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
        public async System.Threading.Tasks.Task CallWebserviceForgotPassUser()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    AppStatics.Loading(loading, true);
                    List <KeyValuePair <string, string> > values = new List <KeyValuePair <string, string> >();
                    values.Add(new KeyValuePair <string, string>("user_login", txtbxForgotPass.Text));

                    var response = await VadodaraByFoot.ServiceLayer.CallWebservice.GetResponse_Post <RootObjectUserForgotPass>(WebServiceURL.Url_userForgotPass, values);

                    AppStatics.Loading(loading, false);
                    if (response != null)
                    {
                        await DisplayAlert(AppResources.AppResources.LMessage, response.message, AppResources.AppResources.LOk);
                    }
                    else
                    {
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }

            ForgotPassPopupStack.IsEnabled      = false; ForgotPassPopupStack.IsVisible = false;
            LoginPageScrollView.Opacity         = 1;
            LoginPageScrollView.IsEnabled       = true;
            LoginPageScrollView.BackgroundColor = Color.Transparent;
        }
Esempio n. 8
0
        public async void PlaceDetail_Clicked(object sender, System.EventArgs e)
        {
            AppStatics.Loading(loading, true);
            //   await Navigation.PushAsync(new VadodaraByFoot.View.WalkTourModule.RouteCoversPage(DetailData, MapDataObject , imgHeader.Source));
            UserData _userdata = AppStatics.LoadIsolatedData();

            if (_userdata != null)
            {
                var stack = Navigation.NavigationStack;
                if (stack[stack.Count - 1].GetType() != typeof(RouteCoversPage))
                {
                    await Navigation.PushAsync(new VadodaraByFoot.View.WalkTourModule.RouteCoversPage(DetailData, MapDataObject, imgHeader.Source));
                }
            }
            else
            {
                var stack = Navigation.NavigationStack;
                if (stack[stack.Count - 1].GetType() != typeof(VadodaraByFoot.View.LoginModule.LoginPage))
                {
                    await Navigation.PushAsync(new VadodaraByFoot.View.LoginModule.LoginPage());
                }
            }
        }
Esempio n. 9
0
        public async System.Threading.Tasks.Task CallWebserviceForgotPassUser()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    AppStatics.Loading(loading, true);
                    List <KeyValuePair <string, string> > values = new List <KeyValuePair <string, string> >();
                    values.Add(new KeyValuePair <string, string>("username", txtbxForgotPass.Text));

                    var response = await VadodaraByFoot.ServiceLayer.CallWebservice.GetResponse_Post <RootObjectUserForgotPass>(WebServiceURL.Url_userForgotPass, values);

                    AppStatics.Loading(loading, false);
                    if (response != null)
                    {
                        await DisplayAlert(AppResources.AppResources.LMessage, response.message, AppResources.AppResources.LOk);

                        await Navigation.PopAsync();
                    }
                    else
                    {
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
        public async Task CallWebserviceLoginUser()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    AppStatics.Loading(loading, true);
                    List <KeyValuePair <string, string> > values = new List <KeyValuePair <string, string> >();
                    values.Add(new KeyValuePair <string, string>("username", txtbxEmail.Text));

                    #region  Password Encryption

                    byte[] PasswordBytes        = Encoding.UTF8.GetBytes(txtbxPassword.Text);
                    string base64StringPassword = Convert.ToBase64String(PasswordBytes);


                    var chars       = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
                    var stringChars = new char[8];
                    var random      = new Random();

                    for (int i = 0; i < stringChars.Length; i++)
                    {
                        stringChars[i] = chars[random.Next(chars.Length)];
                    }

                    var    finalString = new String(stringChars);
                    string EncryptPass = finalString + base64StringPassword + finalString;

                    byte[] EncryptedPasswordBytes  = Encoding.UTF8.GetBytes(EncryptPass);
                    string SendEncryptedStringPass = Convert.ToBase64String(EncryptedPasswordBytes);
                    #endregion

                    values.Add(new KeyValuePair <string, string>("password", SendEncryptedStringPass));

                    var response = await VadodaraByFoot.ServiceLayer.CallWebservice.GetResponse_Post <RootObjectUserLogin>(WebServiceURL.Url_userLogin, values);

                    AppStatics.Loading(loading, false);
                    if (response != null)
                    {
                        if (response._resultflag == "1")
                        {
                            UserData _userdata = new UserData()
                            {
                                username    = response.username,
                                name        = response.name,
                                first_name  = response.first_name,
                                last_name   = response.last_name,
                                nickname    = response.nickname,
                                slug        = response.slug,
                                URL         = response.URL,
                                avatar      = response.avatar,
                                mobile      = response.mobile,
                                description = response.description,
                                registered  = response.registered,
                                email       = response.email,
                                ID          = response.ID
                            };
                            AppStatics.SaveIsolatedData(_userdata);

                            await Navigation.PopAsync();
                        }
                        else
                        {
                            await DisplayAlert(AppResources.AppResources.LMessage, response.message, AppResources.AppResources.LOk);
                        }
                    }
                    else
                    {
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }
Esempio n. 11
0
 protected override void OnDisappearing()
 {
     AppStatics.Loading(loading, false);
 }
Esempio n. 12
0
        private List <MapResponse.LatiLong> DecodePolylinePoints(string encodedPoints)
        {
            if (encodedPoints == null || encodedPoints == "")
            {
                return(null);
            }
            List <MapResponse.LatiLong> poly = new List <MapResponse.LatiLong>();

            char[] polylinechars = encodedPoints.ToCharArray();
            int    index         = 0;

            int currentLat = 0;
            int currentLng = 0;
            int next5bits;
            int sum;
            int shifter;

            try
            {
                while (index < polylinechars.Length)
                {
                    // calculate next latitude
                    sum     = 0;
                    shifter = 0;
                    do
                    {
                        next5bits = (int)polylinechars[index++] - 63;
                        sum      |= (next5bits & 31) << shifter;
                        shifter  += 5;
                    } while (next5bits >= 32 && index < polylinechars.Length);

                    if (index >= polylinechars.Length)
                    {
                        break;
                    }

                    currentLat += (sum & 1) == 1 ? ~(sum >> 1) : (sum >> 1);

                    //calculate next longitude
                    sum     = 0;
                    shifter = 0;
                    do
                    {
                        next5bits = (int)polylinechars[index++] - 63;
                        sum      |= (next5bits & 31) << shifter;
                        shifter  += 5;
                    } while (next5bits >= 32 && index < polylinechars.Length);

                    if (index >= polylinechars.Length && next5bits >= 32)
                    {
                        break;
                    }

                    currentLng += (sum & 1) == 1 ? ~(sum >> 1) : (sum >> 1);
                    MapResponse.LatiLong p = new MapResponse.LatiLong();
                    p.lat = Convert.ToDouble(currentLat) / 100000.0;
                    p.lng = Convert.ToDouble(currentLng) / 100000.0;
                    poly.Add(p);
                }
            }
            catch (Exception ex)
            {
                // logo it
            }
            AppStatics.Loading(loading, false);
            ContentLayout.IsVisible  = true;
            imgPlaceDetail.IsVisible = true;
            return(poly);
        }
Esempio n. 13
0
        public async Task CallWebserviceRegisterUser()
        {
            if (AppStatics.CheckInternetConnection())
            {
                try
                {
                    AppStatics.Loading(loading, true);
                    List <KeyValuePair <string, string> > values = new List <KeyValuePair <string, string> >();
                    values.Add(new KeyValuePair <string, string>("first_name", txtbxFirstName.Text));
                    values.Add(new KeyValuePair <string, string>("last_name", txtbxLastName.Text));
                    values.Add(new KeyValuePair <string, string>("username", txtbxName.Text));

                    #region  Password Encryption

                    byte[] PasswordBytes        = Encoding.UTF8.GetBytes(txtbxPass.Text);
                    string base64StringPassword = Convert.ToBase64String(PasswordBytes);


                    var chars       = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
                    var stringChars = new char[8];
                    var random      = new Random();

                    for (int i = 0; i < stringChars.Length; i++)
                    {
                        stringChars[i] = chars[random.Next(chars.Length)];
                    }

                    var    finalString = new String(stringChars);
                    string EncryptPass = finalString + base64StringPassword + finalString;

                    byte[] EncryptedPasswordBytes  = Encoding.UTF8.GetBytes(EncryptPass);
                    string SendEncryptedStringPass = Convert.ToBase64String(EncryptedPasswordBytes);
                    #endregion

                    values.Add(new KeyValuePair <string, string>("password", SendEncryptedStringPass));

                    values.Add(new KeyValuePair <string, string>("confirmpassword", SendEncryptedStringPass));


                    //values.Add(new KeyValuePair<string, string>("password", txtbxPass.Text));
                    values.Add(new KeyValuePair <string, string>("email", txtbxEmail.Text));
                    values.Add(new KeyValuePair <string, string>("mobile", txtbxMobNum.Text));
                    var response = await CallWebservice.GetResponse_Post <RootObjectUserRegistration>(WebServiceURL.Url_userReg, values);

                    AppStatics.Loading(loading, false);
                    if (response != null)
                    {
                        await DisplayAlert(AppResources.AppResources.LMessage, response.message, AppResources.AppResources.LOk);

                        if (response._resultflag == 1)
                        {
                            Navigation.PopAsync();
                        }
                    }
                    else
                    {
                        await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LWebserverNotResponding, AppResources.AppResources.LOk);
                    }
                }
                catch (Exception e)
                {
                    AppStatics.Loading(loading, false);
                    await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LSomethingWentWrong, AppResources.AppResources.LOk);
                }
            }
            else
            {
                AppStatics.Loading(loading, false);
                await DisplayAlert(AppResources.AppResources.LError, AppResources.AppResources.LNoInternetConnection, AppResources.AppResources.LOk);
            }
        }