private void btnSil_Click(object sender, EventArgs e) { try { int idd = int.Parse(dgv.SelectedRows[0].Cells[4].Value.ToString()); codesharp cod = db.codesharps.First(d => d.id == idd); db.codesharps.DeleteOnSubmit(cod); db.SubmitChanges(); db.Refresh(RefreshMode.OverwriteCurrentValues, db.codesharps); fill(); } catch { MessageBox.Show("NO DATA"); } }
private void btngunce_Click(object sender, EventArgs e) { if (rtxtacdeg.Text != "" && rtxtaddeg.Text != "" && rtxtkoddeg.Text != "") { codesharp cod = db.codesharps.First(d => d.id == frmMain.ids); cod.name = rtxtaddeg.Text; cod.text = rtxtkoddeg.Text; cod.descr = rtxtacdeg.Text; cod.lang = rtxtlandeg.Text; cod.pack = rtxtpackdeg.Text; db.SubmitChanges(); MessageBox.Show("Güncellendi"); this.Close(); } else { MessageBox.Show("Güncellenmendi.(Boş alan bırakmayınız) "); } }
private void btnbitir_Click(object sender, EventArgs e) { if (rtxtacgir.Text != "" && rtxtadgir.Text != "" && rtxtkodgir.Text != "" && rtxtdilgir.Text != "") { codesharp cod = new codesharp() { name = rtxtadgir.Text, descr = rtxtacgir.Text, text = rtxtkodgir.Text, lang = rtxtdilgir.Text, pack = rtxtpackgir.Text }; db.codesharps.InsertOnSubmit(cod); db.SubmitChanges(); MessageBox.Show("Eklendi"); this.Close(); } else { MessageBox.Show("Boş alan bırakmayınız. "); } }
partial void Deletecodesharp(codesharp instance);
partial void Updatecodesharp(codesharp instance);
partial void Insertcodesharp(codesharp instance);