Exemple #1
0
        /// <summary>
        /// Cuando entra en la fila carga el paciente como seleccionado y lo muestra en el label
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dgvPacientes_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            int n = e.RowIndex;

            StringBuilder sb = new StringBuilder();


            if (n != -1)
            {
                int id = (int)dgvPacientes.Rows[n].Cells[0].Value;
                pacienteSeleccionado = clinica.GetPacienteById(id);
                string apellido = (string)dgvPacientes.Rows[n].Cells[2].Value;
                string nombre   = (string)dgvPacientes.Rows[n].Cells[3].Value;

                sb.AppendFormat("Paciente: {0}, {1}", apellido, nombre);

                txtPaciente.Text = sb.ToString();
            }
        }