Esempio n. 1
0
        private async void btnAddCountry_Click(object sender, EventArgs e)
        {
            var addCountryResponse = await Infrastructure.AddCountry(tbNewCountry.Text);

            if (addCountryResponse.ErrorCode)
            {
                var metadetaErrorModel = await Infrastructure.GetMetadata();

                MetaDataResponse metadata = (MetaDataResponse)metadetaErrorModel.Object;
                Metadata = metadata;

                ShowCountriesAddNewWine();
                cbOriginCountry.SelectedIndex = cbOriginCountry.FindStringExact(tbNewCountry.Text);
            }
            else if (!string.IsNullOrEmpty(addCountryResponse.Message))
            {
                MessageBox.Show(addCountryResponse.Message, "Fel");
            }
        }