private void silToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("Emin misiniz?", "SİL", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { int idds = int.Parse(dgv.SelectedRows[0].Cells[0].Value.ToString()); fihrist fihr = db.fihrists.First(f => f.id == idds); db.fihrists.DeleteOnSubmit(fihr); db.SubmitChanges(); db.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues, db.fihrists); doldur(); } }
private void btnguncelle_Click(object sender, EventArgs e) { if (txtAdg.Text != "" && txtBirimG.Text != "" && txttelG.Text != "") { fihrist fih = db.fihrists.First(f => f.id == int.Parse(frmMain.ids)); fih.ad = txtAdg.Text; fih.tel = txttelG.Text; fih.birim = txtBirimG.Text; db.SubmitChanges(); MessageBox.Show("Güncellendi"); this.Close(); } else { MessageBox.Show("Boş alan bırakmayınız. "); } }
private void btnekle_Click(object sender, EventArgs e) { if (txtad.Text != "" && txtbirim.Text != "" && txttel.Text != "") { fihrist fih = new fihrist() { ad = txtad.Text, birim = txtbirim.Text, tel = txttel.Text }; db.fihrists.InsertOnSubmit(fih); db.SubmitChanges(); MessageBox.Show("Eklendi"); this.Close(); } else { MessageBox.Show("Boş alan bırakmayınız. "); } }
partial void Deletefihrist(fihrist instance);
partial void Updatefihrist(fihrist instance);
partial void Insertfihrist(fihrist instance);