private void BtnUpdate_Click(object sender, RoutedEventArgs e) { decimal.TryParse(txtSellPrice.Text, out price); if (txtProductName.Text != "" && price != 0 && cbSubCategory.Text != null && dtgridProduct.SelectedItem != null) { product.Name = txtProductName.Text; product.SellPrice = price; product.SubCategoryID = services.SubID(cbSubCategory.Text); services.updateProduct(product, product.ID); GetLists(); } else { MessageBox.Show("Bütün Bilgileri Doğru Giriniz"); } }
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!"); } }