private void silToolStripMenuItem_Click(object sender, EventArgs e) { int id = Convert.ToInt32(dataGridView1.CurrentRow.Cells["Id"].Value); if (id <= 0) { MessageBox.Show("Silinecek oda yoktur"); } else { Odalar o = new Odalar(); o.Id = id; bool sonuc = odaOrm.Delete(o); if (sonuc) { MessageBox.Show("Oda Silindi", "Oda Silme", MessageBoxButtons.OK, MessageBoxIcon.Information); dataGridView1.DataSource = odaOrm.Select(); dataGridView1.Focus(); } else { MessageBox.Show("Oda Silinmedi\n", "Oda Silme", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } }
private void silToolStripMenuItem_Click(object sender, EventArgs e) { Odalar oda = new Odalar(); oda.Id = Convert.ToInt16(dataGridView1.CurrentRow.Cells["Id"].Value.ToString()); bool sonuc = odaORM.Delete(oda); if (sonuc) { MessageBox.Show("Silindi"); dataGridView1.DataSource = odaORM.Select(); } else { MessageBox.Show("Hata"); } }