private async void LoadCityListForEvents()
        {
            try
            {
                List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >();
                parameters.Add(new KeyValuePair <string, string>("company_code", Constant.CompanyID));
                var jsonstr = await wrapper.GetResponseAsync(Constant.APIs[(int)Constant.APIName.EventLocationList], parameters);

                if (jsonstr.ToString() == "NoInternet")
                {
                    NoInternet.IsVisible = true;
                    MainFrame.IsVisible  = false;
                    //NewsDetailslbl.IsVisible = false;
                }
                else
                {
                    try
                    {
                        var CityItems = JsonConvert.DeserializeObject <EventRestCityListModel>(jsonstr);
                        LocationFilterPicker.ItemsSource = CityItems.data.city_list.Select(X => X.city).ToList();
                    }

                    catch (Exception ex)
                    {
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }
Esempio n. 2
0
        private async void Button_Clicked(object sender, EventArgs e)
        {
            activityIndicator.IsVisible = true;
            await Task.Delay(1000);

            HttpRequestWrapper wrapper = new HttpRequestWrapper();

            List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >();

            parameters.Add(new KeyValuePair <string, string>("company_code", "COM1000"));
            parameters.Add(new KeyValuePair <string, string>("phone_no", "8481807716"));
            parameters.Add(new KeyValuePair <string, string>("password", "123456"));
            parameters.Add(new KeyValuePair <string, string>("device_type", "Android"));
            parameters.Add(new KeyValuePair <string, string>("device_token", "1234567890"));
            parameters.Add(new KeyValuePair <string, string>("app_version", "1.1"));

            string data = await wrapper.GetResponseAsync(Constant.APIs[(int)Constant.APIName.Login], parameters);

            try
            {
                LabelText.Text = data.ToString();
                activityIndicator.IsVisible = false;
                DisplayAlert("Success", "Data Successfully Fetched", "OK", "Cancel");
            }
            catch (Exception ex)
            {
            }
        }
Esempio n. 3
0
        private async void InitialLoading(string seachText)
        {
            try
            {
                Loader.IsVisible = true;
                List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >()
                {
                    new KeyValuePair <string, string>("device_type", "ANDROID"),
                    new KeyValuePair <string, string>("app_version", "2.0"),
                    new KeyValuePair <string, string>("search", seachText),
                };

                var jsonstr = await wrapper.GetResponseAsync(Constant.APIs[(int)Constant.APIName.GetSellerListAPI], parameters);

                if (jsonstr.ToString() == "NoInternet")
                {
                    Loader.IsVisible     = false;
                    NoDataPage.IsVisible = true;
                }

                else
                {
                    var Items = JsonConvert.DeserializeObject <SellerListModel>(jsonstr);
                    SellersListView.ItemsSource = Items.data.sellers;
                    Loader.IsVisible            = false;
                }
            }
            catch (Exception ex)
            {
                Loader.IsVisible     = false;
                NoDataPage.IsVisible = true;
                var x = ex.Message;
            }
        }
        private async void Resend_Tapped(object sender, EventArgs e)
        {
            Loader.IsVisible = true;
            await Task.Delay(1000);

            HttpRequestWrapper wrapper = new HttpRequestWrapper();
            List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >();

            parameters.Add(new KeyValuePair <string, string>("company_code", Constant.CompanyID));
            parameters.Add(new KeyValuePair <string, string>("user_id", user_Id));

            try
            {
                string data = await wrapper.GetResponseAsync(Constant.APIs[(int)Constant.APIName.ResendOTP], parameters);

                if (data.ToString() == "NoInternet")
                {
                    await DisplayAlert("No Internet", "Please check your internet connection", "Cancel");
                }
                else
                {
                }
            }
            catch { }

            await DisplayAlert("Resend OTP", "OTP has been sent on your mobile no", "Cancel");

            Loader.IsVisible = false;
        }
        public async void UpdateRestList(string CategoryTypeID, string CuisineTypeId, string SearchText, string LocationValue)
        {
            Loader.IsVisible            = true;
            NoDataPage.IsVisible        = false;
            NoInternet.IsVisible        = false;
            RestaurantlstView.IsVisible = false;
            try
            {
                HttpRequestWrapper wrapper = new HttpRequestWrapper();
                List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >();
                parameters.Add(new KeyValuePair <string, string>("company_code", Constant.CompanyID));
                parameters.Add(new KeyValuePair <string, string>("search_text", SearchText));
                parameters.Add(new KeyValuePair <string, string>("category_id", CategoryTypeID));
                parameters.Add(new KeyValuePair <string, string>("cuisine_id", CuisineTypeId));
                parameters.Add(new KeyValuePair <string, string>("location_search", LocationValue));

                var jsonstr = await wrapper.GetResponseAsync(Constant.APIs[(int)Constant.APIName.RestaurantList], parameters);

                if (jsonstr.ToString() == "NoInternet")
                {
                    NoInternet.IsVisible = true;
                }
                else
                {
                    Items = JsonConvert.DeserializeObject <RestaurantListModel>(jsonstr);

                    RestListData = new ObservableCollection <_Restaurant_Data>();

                    if (Items.data.restaurants.restaurant_data.Count() == 0)
                    {
                        NoDataPage.IsVisible = true;
                        Loader.IsVisible     = false;
                    }
                    else
                    {
                        foreach (var x in Items.data.restaurants.restaurant_data)
                        {
                            x.RestBannerImg = x.restaurant_images.Select(Y => Y.imageURL).FirstOrDefault();
                            RestListData.Add(x);
                        }

                        RestaurantlstView.ItemsSource = RestListData;

                        RestaurantlstView.HeightRequest = (Items.data.restaurants.restaurant_data.Count() * RestaurantlstView.RowHeight) + 2;

                        if (Items.data.restaurants.current_page != Items.data.restaurants.total_pages)
                        {
                            LazyLoadingRestList(Items.data.restaurants.current_page + 1, SearchText, CategoryTypeID, CuisineTypeId, LocationValue);
                        }
                        RestaurantlstView.IsVisible = true;
                    }

                    Loader.IsVisible = false;
                }
            }
            catch (Exception ex)
            {
                NoDataPage.IsVisible = true;
            }
        }
Esempio n. 6
0
        private async void InitialLoading(string slug)
        {
            try
            {
                Loader.IsVisible = true;
                List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >()
                {
                    new KeyValuePair <string, string>("category_slug", slug),
                };

                var jsonstr = await wrapper.GetResponseAsync(Constant.APIs[(int)Constant.APIName.FirstLevelCategoryListAPI], parameters);

                if (jsonstr.ToString() == "NoInternet")
                {
                    Loader.IsVisible     = false;
                    NoDataPage.IsVisible = true;
                }
                else
                {
                    var Items = JsonConvert.DeserializeObject <MainCategoryListModel>(jsonstr);
                    SubCatDetailListView.ItemsSource = Items.data.categorys;
                    //  CategoryListView.ItemsSource = Items.data.categorys;

                    Loader.IsVisible = false;
                }
            }
            catch (Exception ex)
            {
                Loader.IsVisible     = false;
                NoDataPage.IsVisible = true;
            }
        }
        private async void LoadRestaurantDetails(string Id)
        {
            try
            {
                List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >();
                parameters.Add(new KeyValuePair <string, string>("company_code", Constant.CompanyID));
                parameters.Add(new KeyValuePair <string, string>("restaurant_id", Id));
                var jsonstr = await wrapper.GetResponseAsync(Constant.APIs[(int)Constant.APIName.RestaurantDetails], parameters);

                if (jsonstr.ToString() == "NoInternet")
                {
                    Loader.IsVisible     = false;
                    NoInternet.IsVisible = true;
                    MainFrame.IsVisible  = false;
                    //     Bannerimg.IsVisible = false;
                    //    BannerImgCarousel.IsVisible = false;
                    NoDataPage.IsVisible = false;
                }
                else
                {
                    try
                    {
                        var Items = JsonConvert.DeserializeObject <RestaurantDetailModel>(jsonstr);

                        var html = new HtmlWebViewSource
                        {
                            Html = Items.data.restaurant_details.description
                        };
                        RestDesc.Source             = html;
                        RestaurantHeading           = Items.data.restaurant_details.restaurant_name;
                        RestImgListView.ItemsSource = Items.data.restaurant_details.restaurant_images.ToList();
                        //    BannerImage = Items.data.restaurant_details.restaurant_images.Select(X => X.imageURL).FirstOrDefault();

                        var html1 = new HtmlWebViewSource
                        {
                            Html = "<iframe width=\"100%\" height=\"200\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src = \"https://maps.google.com/maps?q=" + Items.data.restaurant_details.restaurant_vanue.latitude + "," + Items.data.restaurant_details.restaurant_vanue.longitude + "&hl=es;z=14&amp;output=embed\" ></ iframe > "
                        };
                        Map.Source = html1;
                        //        Bannerimg.Source = BannerImage;
                        BindingContext      = Items.data.restaurant_details;
                        MainFrame.IsVisible = true;
                        Loader.IsVisible    = false;
                    }
                    catch (Exception ex)
                    {
                        MainFrame.IsVisible = false;
                        //         Bannerimg.IsVisible = false;
                        //         BannerimgCarousel.IsVisible = false;
                        NoInternet.IsVisible = false;
                        NoDataPage.IsVisible = true;
                    }
                }
            }
            catch (Exception ex)
            {
                Loader.IsVisible     = false;
                NoDataPage.IsVisible = true;
            }
        }
        private async void SubmitButton_Clicked(object sender, EventArgs e)
        {
            //App.Current.MainPage = new MasterDetailsPage();
            NoInternet.IsVisible = false;
            Loader.IsVisible     = true;
            await Task.Delay(1000);

            if (AppData.UserId != null)
            {
                HttpRequestWrapper wrapper = new HttpRequestWrapper();

                List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >();

                if (ChkNullAll() == true)
                {
                    if (!IsPasswordsEqual(Password.Text, RePassword.Text))
                    {
                        await DisplayAlert("Error", "Re-password does not matched!!", "Cancel");
                    }
                    else
                    {
                        parameters.Add(new KeyValuePair <string, string>("company_code", Constant.CompanyID));
                        parameters.Add(new KeyValuePair <string, string>("user_id", lblusrid.Text.Trim()));
                        parameters.Add(new KeyValuePair <string, string>("password", Password.Text));
                        //App.Current.MainPage = new MasterDetailsPage();
                        try
                        {
                            string data = await wrapper.GetResponseAsync(Constant.APIs[(int)Constant.APIName.ForgotPasswordUpdatePassword], parameters);

                            if (data.ToString() == "NoInternet")
                            {
                                NoInternet.IsVisible    = true;
                                MainContainer.IsVisible = false;
                            }
                            else
                            {
                                var des = JsonConvert.DeserializeObject <jsonResponseClass>(data);

                                if (des.responseText == "Success")
                                {
                                    await DisplayAlert("Success", "Password has been changed successfully.", "OK");

                                    App.Current.MainPage = new LoginPage();
                                }
                                else
                                {
                                    await DisplayAlert("Error", des.responseText, "Cancel");
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                }
            }
            Loader.IsVisible = false;
        }