Beispiel #1
0
        private async void GetLocationAndQuantity(string slug)
        {
            var response = await service.GetLocationAndQuantity(slug);

            switch (response.Item1)
            {
            case 1:
                var res = response.Item2;
                foreach (var item in res)
                {
                    LocationDic.Add(item.location_id, item.quantity);
                }
                GetAllLocation();
                break;

            case 2:
            case 3:
                await App.Current.MainPage.DisplayAlert("錯誤", "系統錯誤", "確定");

                break;
            }
        }
Beispiel #2
0
        private async void GetAllLocation()
        {
            var response = await service.GetLocation();

            switch (response.Item1)
            {
            case 1:
                var res = response.Item2;
                foreach (var item in res)
                {
                    if (LocationDic.ContainsKey(item.id))
                    {
                        item.quantity = LocationDic[item.id];
                        Locations.Add(item);
                        LocationViewHeight += 56;
                    }
                }
                break;

            case 2:
            case 3:
                break;
            }
        }