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();
        }
Example #4
0
 partial void DeleteOgretmen(Ogretmen instance);
Example #5
0
 partial void UpdateOgretmen(Ogretmen instance);
Example #6
0
 partial void InsertOgretmen(Ogretmen instance);
Example #7
0
 private void detach_Ogretmens(Ogretmen entity)
 {
     this.SendPropertyChanging();
     entity.Der = null;
 }
Example #8
0
 private void attach_Ogretmens(Ogretmen entity)
 {
     this.SendPropertyChanging();
     entity.Der = this;
 }