Exemple #1
0
        private async void btnAdd_Click(object sender, EventArgs e)
        {
            Product product = new Product()
            {
                ProductName  = txtProductName.Text,
                CategoryId   = (int)cmbCategories.SelectedValue,
                UnitPrice    = decimal.Parse(txtUnitPrice.Text),
                UnitsInStock = short.Parse(txtUnitsInStock.Text)
            };

            bool result = await _productPrecessor.AddProduct(product);

            await GetList();
        }