private void btnguncelle_Click(object sender, EventArgs e) { int kargotakipid = Convert.ToInt32(tbguncelle.Text); kargotakip a = kargo.kargotakip.Where(x => x.ktid == kargotakipid).FirstOrDefault(); a.ktyer = comboBox2.Text; a.ktdurum = comboBox3.Text; a.gid = Convert.ToInt32(comboBox1.Text); kargo.SaveChanges(); listele(); }
private void btnkaydet_Click(object sender, EventArgs e) { kargotakip kt = new kargotakip(); kt.ktyer = comboBox2.Text; kt.ktdurum = comboBox3.Text; kt.gid = Convert.ToInt32(comboBox1.Text); kargo.kargotakip.Add(kt); kargo.SaveChanges(); listele(); }
private void btnsil_Click(object sender, EventArgs e) { int kargotakipid = Convert.ToInt32(tbguncelle.Text); kargotakip a = kargo.kargotakip.Where(x => x.ktid == kargotakipid).FirstOrDefault(); //if (a != null) //{ kargo.kargotakip.Remove(a); kargo.SaveChanges(); //} //else //{ // MessageBox.Show("ID'ye ait veri bulunamadı"); //} listele(); }