private void Dgvpr_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { Btndelete.Visible = true; Btnupdate.Visible = true; int idperson = Convert.ToInt32(Dgvpr.Rows[e.RowIndex].Cells[0].Value); selectedperson = _context.person_infos.Find(idperson); Txtn.Text = selectedperson.Name; Txts.Text = selectedperson.Surname; Txte.Text = selectedperson.Email; Txtp.Text = selectedperson.Phone; }
private void Btnadd_Click(object sender, EventArgs e) { person_infos pr = new person_infos { Name = Txtname.Text, Surname = Txtsur.Text, Email = Txtml.Text, Phone = Txtph.Text }; this._context.person_infos.Add(pr); this._context.SaveChanges(); MessageBox.Show("Info Added", MessageBoxButtons.OK.ToString()); }