コード例 #1
0
        async void Handle_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            if (e.Item == null)
            {
                return;
            }
            ShowTravelSpecs showobj = (ShowTravelSpecs)e.Item;

            await Navigation.PushModalAsync(new TravelInfoPage(showobj.travelerSpecs));

            //Deselect Item
            ((ListView)sender).SelectedItem = null;
        }
コード例 #2
0
        public async void ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                App.WaitScreenStart(Translator.getText("Loading"));
                ApiService _apiService = new ApiService();
                LstItems     = new ObservableCollection <TravelerSpecs>();
                LstItemsShow = new ObservableCollection <ShowTravelSpecs>();

                LstItems = await _apiService.GetTravelsAsync(email, vmstatus);

                foreach (TravelerSpecs item in LstItems)
                {
                    item.CountryCodeFrom = item.CountryCodeFrom + " - " + ProvideCountries.GetCountryName(item.CountryCodeFrom);
                    item.CountryCodeTo   = item.CountryCodeTo + " - " + ProvideCountries.GetCountryName(item.CountryCodeTo);



                    sts = new ShowTravelSpecs();
                    sts.travelerSpecs = new TravelerSpecs();
                    sts.travelerSpecs = item;
                    sts.imageShow     = ShowImage;

                    LstItemsShow.Add(sts);
                }


                IsBusy = false;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                App.WaitScreenStop();
                IsBusy = false;
            }
        }
コード例 #3
0
        async void Handle_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            if (e.Item == null)
            {
                return;
            }
            ShowTravelSpecs showobj = (ShowTravelSpecs)e.Item;

            //if (Convert.ToDateTime(showobj.travelerSpecs.ToDate.ToShortDateString()) < Convert.ToDateTime(DateTime.Now.ToShortDateString()))
            //{
            //    await DisplayAlert(Translator.getText("Notice"), Translator.getText("TravelNotAvailable"), "Ok");
            //    return;
            //}

            await Navigation.PushAsync(new ListCodeAdminPage(showobj.travelerSpecs));

            //Deselect Item
            ((ListView)sender).SelectedItem = null;
        }
コード例 #4
0
        public async void ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                App.WaitScreenStart(Translator.getText("Loading"));
                ApiService _apiService = new ApiService();
                LstItems     = new ObservableCollection <TravelerSpecs>();
                LstItemsShow = new ObservableCollection <ShowTravelSpecs>();

                LstItems = await _apiService.GetTravelsAsync(email, vmstatus);

                foreach (TravelerSpecs item in LstItems)
                {
                    ShowImage = (item.DeliveredAt == "1") ? true : false;

                    try
                    {
                        if (Application.Current.Properties["notifiedItemRoute"] != null)
                        {
                            string NotifiedBoxlist = (string)Application.Current.Properties["notifiedItemRoute"];
                            string travelinf       = item.CountryCodeFrom + ">" + item.CountryCodeTo;
                            if (NotifiedBoxlist.Contains(travelinf))
                            {
                                ShowImage = true;
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Application.Current.Properties["notified"] = "False";

                        Application.Current.Properties["Goto"] = "";
                    }

                    item.CountryCodeFrom = item.CountryCodeFrom + " - " + ProvideCountries.GetCountryName(item.CountryCodeFrom);
                    item.CountryCodeTo   = item.CountryCodeTo + " - " + ProvideCountries.GetCountryName(item.CountryCodeTo);



                    sts = new ShowTravelSpecs();
                    sts.travelerSpecs = new TravelerSpecs();
                    sts.travelerSpecs = item;
                    sts.imageShow     = ShowImage;

                    LstItemsShow.Add(sts);
                }
                Application.Current.Properties["notifiedItemRoute"] = "";
                await Application.Current.SavePropertiesAsync();

                IsBusy = false;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                App.WaitScreenStop();
                IsBusy = false;
            }
        }