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