private void Btnadd_Click(object sender, RoutedEventArgs e) { decimal.TryParse(txtSellPrice.Text, out Price); if (txtProductName.Text != "" && txtSellPrice.Text != "" && cbSubCategory.SelectedItem != null && Price != 0) { product.Name = txtProductName.Text; product.SellPrice = Price; product.CompanyID = id; product.SubCategoryID = services.SubID(cbSubCategory.Text); services.NewProduct(product); getlist(); MessageBox.Show("Başarıla Eklendi"); } else { MessageBox.Show("Bilgileri Doğru Giriniz!"); } }