private void btnDelete_Click(object sender, EventArgs e) { int id = Convert.ToInt32(dataGridView1.CurrentRow.Cells[0].Value); _productDal.Delete(id); ProductLoad(); }
private void btnDelete_Click(object sender, EventArgs e) { int id = Convert.ToInt32(dgwProducts.CurrentRow.Cells[0].Value); _productDal.Delete(id); LoadProducts(); }
private void btnRemove_Click(object sender, EventArgs e) { int id = Convert.ToInt32(dgwProducts.CurrentRow.Cells[0].Value); _productDal.Delete(id); MessageBox.Show("Deleted !"); }
//(98)//////////////////////// SİLME İŞEMİNİN YAPILMASI ////////////////////////////// private void btnRemove_Click(object sender, EventArgs e) //(98)Silme butonu yapıldı { int id = Convert.ToInt32(dgwProducts.CurrentRow.Cells[0].Value); //(98)oluşturulan id değişkenine gridin seçili satırının 0 dizinli hücresinin değeri atandı. _productDal.Delete(id); //(98)İşlemler Data Access Layer katmanı üzerinden yapılacağından,form içinde kullanılmak üzere implemente edilen bu _productDal nesnesi üzerinden Delete metodu çağrılarak parametre olarak id değişkeni gönderildi. LoadProducts(); //(98)Grid yeniden yüklendi. MessageBox.Show("Deleted!"); }
private void btnRemove_Click(object sender, EventArgs e) { int id = Convert.ToInt32(dgwProducts.CurrentRow.Cells[0].Value); //var olan id üzerine işlem yapılıyor. _productDal.Delete(id); LoadProducts(); MessageBox.Show("Deleted!"); }
private void button2_Click(object sender, EventArgs e) { int id = Convert.ToInt32(dgwProducts.CurrentRow.Cells[0].Value); _productDal.Delete(id); LoadProducts(); MessageBox.Show("Product Deleted"); }
private void btnRemove_Click(object sender, EventArgs e) { int id = Convert.ToInt32(dgwProducts.CurrentRow.Cells[0].Value); string removedItemName = dgwProducts.CurrentRow.Cells[1].Value.ToString(); _productDal.Delete(id); LoadProducts(); MessageBox.Show(removedItemName + " is Deleted!"); }
private void btnRemove_Click(object sender, EventArgs e) { int id = Convert.ToInt32(dgwProducts.CurrentRow.Cells[0].Value); DialogResult dr = MessageBox.Show($"Do you want to delete record with {id} numbers?", "Caution", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr == DialogResult.Yes) { _productDal.Delete(id); LoadProducts(); MessageBox.Show("Product is Deleted!"); } }
private void btnDelete_Click(object sender, EventArgs e) { _productDal.Delete(Convert.ToInt32(dgwProducts.CurrentRow.Cells[0].Value)); ShowAllItems(); MessageBox.Show("Deleted!"); }