Пример #1
0
        private async void UpdateInventoryItemAmount()
        {
            CurrentInventoryItem.Amount = InventoryItem.Amount;

            try
            {
                int statusCode = await _backendConnection.SetQuantity(CurrentInventoryItem);
            }
            catch (ApiException exception)
            {
                MessageBox.Show($"Fejl {exception.StatusCode}", "Error!");
            }
            catch (HttpRequestException exception)
            {
                MessageBox.Show($"Der er ingen forbindele til serveren", "Error!");
            }
        }
        private async Task <int> UpdateInventoryItemQuantity()
        {
            int temp = 0;

            try
            {
                temp = await _backendConnection.SetQuantity(CurrentInventoryItem);
            }
            catch (ApiException e)
            {
                MessageBox.Show($"Fejl {e.StatusCode}", "Error!");
            }
            catch (HttpRequestException exception)
            {
                MessageBox.Show($"Der er ingen forbindele til serveren", "Error!");
            }

            return(temp);
        }