private void registrarModifyVisitButton_Click(object sender, EventArgs e) { if (dataGridViewRegistrar.CurrentRow != null) { if (dataGridViewRegistrar.SelectedRows.Count == 1) { int visitIndex = dataGridViewRegistrar.CurrentRow.Index; int id_visit = (int)dataGridViewRegistrar.Rows[visitIndex].Cells[0].Value; RegistrarAddModifyForm registrarModifyVisit = new RegistrarAddModifyForm(id_visit); registrarModifyVisit.setModifyTrueAddFalse(true); registrarModifyVisit.ShowDialog(this); registrarModifyVisit.updateVisit(id_visit); } else { MessageBox.Show("Please select ONE visit !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { //MessageBox.Show("Please select visit first"); MessageBox.Show("Please select visit !", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } refreshGrid(); }
private void resgistrarAddVisitButton_Click(object sender, EventArgs e) { //add visit //RegistrarAddVisitDataGridView if (RegistrarAddVisitDataGridView.SelectedRows.Count == 1 && RegistrarAddVisitDataGridView.Rows.Count > 0) { int curRowIndex = RegistrarAddVisitDataGridView.CurrentCell.RowIndex; int IdPatient = Int32.Parse(RegistrarAddVisitDataGridView.Rows[curRowIndex].Cells[0].Value.ToString()); // var name = RegistrarAddVisitDataGridView.Rows[curRowIndex].Cells[2].Value.ToString(); RegistrarAddModifyForm registrarAddFrom = new RegistrarAddModifyForm(IdPatient, id_reg); registrarAddFrom.setModifyTrueAddFalse(false); registrarAddFrom.ShowDialog(this); } else { MessageBox.Show("Select patient !", "Select row ...", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }