private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { secilenId = Int32.Parse(dataGridView1.CurrentRow.Cells[1].Value.ToString()); Ilce i = ft.ilceler.Find(secilenId); textBox1.Text = i.IlceAdi; }
private void btnEkle_Click(object sender, EventArgs e) { Ilce ilce = new Ilce(); ilce.Ilid = (int)comboBox1.SelectedValue; ilce.IlceAdi = textBox1.Text; ft.ilceler.Add(ilce); ft.SaveChanges(); Listele(); }
private void button3_Click(object sender, EventArgs e) { try { Ilce i = ft.ilceler.Find(secilenId); ft.ilceler.Remove(i); ft.SaveChanges(); Listele(); } catch (Exception) { } }
private void button2_Click(object sender, EventArgs e) { try { Ilce i = ft.ilceler.Find(secilenId); i.IlceAdi = textBox1.Text; ft.SaveChanges(); Listele(); } catch (Exception) { } }