private void btnEkle_Click(object sender, EventArgs e) { LinqTODataContext ctx = new LinqTODataContext(); Ogretmen ogrt = new Ogretmen(); ogrt.Adi = textAdi.Text; ogrt.Soyadi = textSoyadi.Text; ogrt.DogumTarihi = Convert.ToDateTime(dateTimePickerDogumTarihi.Value.Date); ogrt.DersID = (int)comboBoxDersAdi.SelectedValue; ogrt.AktifMi = checkBoxAktifMi.Checked; ctx.Ogretmens.InsertOnSubmit(ogrt); ctx.SubmitChanges(); LoadSonuc(); Clear(); }
private void btnsil_Click(object sender, EventArgs e) { if (dataGridView1.CurrentRow == null) { return; } int ogrtID = (int)dataGridView1.CurrentRow.Cells["OgretmenId"].Value; LinqTODataContext ctx = new LinqTODataContext(); Ogretmen ogrt = ctx.Ogretmens.SingleOrDefault(og => og.OgretmenId == ogrtID); ctx.Ogretmens.DeleteOnSubmit(ogrt); ctx.SubmitChanges(); LoadSonuc(); Clear(); }
private void btnguncelle_Click(object sender, EventArgs e) { LinqTODataContext ctx = new LinqTODataContext(); int id = (int)textAdi.Tag; Ogretmen ogrt = ctx.Ogretmens.SingleOrDefault(og => og.OgretmenId == id); ogrt.Adi = textAdi.Text; ogrt.Soyadi = textSoyadi.Text; ogrt.DogumTarihi = Convert.ToDateTime(dateTimePickerDogumTarihi.Value.Date); ogrt.DersID = (int)comboBoxDersAdi.SelectedValue; ogrt.AktifMi = checkBoxAktifMi.Checked; ctx.SubmitChanges(); LoadSonuc(); Clear(); }
partial void DeleteOgretmen(Ogretmen instance);
partial void UpdateOgretmen(Ogretmen instance);
partial void InsertOgretmen(Ogretmen instance);
private void detach_Ogretmens(Ogretmen entity) { this.SendPropertyChanging(); entity.Der = null; }
private void attach_Ogretmens(Ogretmen entity) { this.SendPropertyChanging(); entity.Der = this; }