Ejemplo n.º 1
0
        public async Task ExecuteLoadPaymentTypesAsync()
        {
            try
            {
                IsBusy = true;

                PaymentTypeList.Clear();

                List <PaymentType> listPaymentType = _userSettings.GetPaymentTypesLocal();
                if (listPaymentType == null)
                {
                    listPaymentType = await _expenseTrackerService.GetPaymentTypeListAsync();
                }

                foreach (PaymentType pt in listPaymentType)
                {
                    PaymentTypeList.Add(pt.Name);
                }
            }
            catch (Exception ex)
            {
                await base.ShowErrorMessageAsync("Error getting payment type list : " + ex.Message);
            }
            finally
            {
                IsBusy = false;
            }
        }
Ejemplo n.º 2
0
        public async void ExecuteLoadPaymentTypes()
        {
            try
            {
                IsBusy = true;

                PaymentTypeList.Clear();

                List <PaymentType> listPaymentType = await _expenseTrackerWebApiService.GetPaymentTypeList();

                foreach (PaymentType pt in listPaymentType)
                {
                    PaymentTypeList.Add(pt.Name);
                }
            }
            catch (Exception ex)
            {
                await base.ShowErrorMessage("Cannot connect to server. " + ex.Message);
            }
            finally
            {
                IsBusy = false;
            }
        }