private void btnAddDoctor_Click(object sender, EventArgs e) { frmAddOrEditDoctor frm = new frmAddOrEditDoctor(); if (frm.ShowDialog() == DialogResult.OK) { BindGrid(); } }
private void btnEditDoctor_Click(object sender, EventArgs e) { if (dgvDoctor.CurrentRow != null) { int id = int.Parse(dgvDoctor.CurrentRow.Cells[0].Value.ToString()); frmAddOrEditDoctor frm = new frmAddOrEditDoctor(); frm.id = id; if (frm.ShowDialog() == DialogResult.OK) { BindGrid(); } } else { RtlMessageBox.Show($"یک شخص را انخاب کنید!", "خطا", MessageBoxButtons.OK, MessageBoxIcon.Error); } }