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