Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
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);
            }
        }
Ejemplo n.º 6
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);
            }
        }