コード例 #1
0
        private async void btnSave_Click(object sender, RoutedEventArgs e)
        {
            SoftwareDetailDto software = new SoftwareDetailDto()
            {
                Name           = txtName.Text,
                ManufacturerId = ((ManufacturerDto)cmbManufacturer.SelectedItem).Id,
                GenreId        = (int)cmbGenre.SelectedItem,
                Description    = null
            };

            bool?success;

            using (var client = new SoftwaresClient(Global.Properties.BaseUrl))
            {
                success = await client.PostSoftware(software);
            }
            if (success == null)
            {
                throw new NotImplementedException();
            }
            if (!success.HasValue)
            {
                throw new NotImplementedException();
            }
            if (!success.Value)
            {
                throw new NotImplementedException();
            }
            this.Close();
        }