private void button2_Click(object sender, EventArgs e) { int id = (int)textBox1.Tag; Firmalar sil = baglanti.FirmalarSet.SingleOrDefault(f => f.firma_id == id); baglanti.FirmalarSet.Remove(sil); baglanti.SaveChanges(); dataGridView1.DataSource = baglanti.FirmalarSet.ToList(); }
private void button4_Click(object sender, EventArgs e) { int id = (int)textBox1.Tag; Firmalar guncel = baglanti.FirmalarSet.SingleOrDefault(f => f.firma_id == id); guncel.FirmaTipi = textBox1.Text.ToString(); baglanti.SaveChanges(); dataGridView1.DataSource = baglanti.FirmalarSet.ToList(); }
private void button1_Click(object sender, EventArgs e) { Firmalar ekle = new Firmalar(); ekle.FirmaTipi = textBox1.Text.ToString(); baglanti.FirmalarSet.Add(ekle); baglanti.SaveChanges(); dataGridView1.DataSource = baglanti.FirmalarSet.ToList(); textBox1.Text = ""; }