private void rellenarFormulario()
        {
            txtDocumento.Text        = paciente.nroDocumento.ToString();
            txtNombre.Text           = paciente.nombre;
            txtApellido.Text         = paciente.apellido;
            txtDomicilio.Text        = paciente.domicilio;
            dtpFechaNacimiento.Value = paciente.fechaNacimiento;
            txtObraSocial.Text       = paciente.obraSocial;
            txtPlan.Text             = paciente.plan;

            var odont = odontologosRepo.ObtenerOdontMatricula(paciente.odontologo.ToString());

            var tablaOdont = odontologosRepo.ObtenerOdontologosDT();

            cmbOdontologo.SelectedValue = odont.nombre;
            for (int i = 0; i < tablaOdont.Rows.Count; i++)
            {
                foreach (DataRow f in tablaOdont.Rows)
                {
                    if (f.ItemArray[0].ToString().Equals(paciente.odontologo.ToString()))
                    {
                        cmbOdontologo.SelectedText = odont.nombre;
                    }
                }
            }
        }
示例#2
0
 // constructor que recibe la matricula para modificar dicho odontologo
 // con el numero de matricula consulto la base datos y obtengo el odontologo
 public AgregarOdontologo(string matricula)
 {
     InitializeComponent();
     odontologosRepo = new OdontologosRepo();
     pacientesRepo   = new PacientesRepo();
     odont           = odontologosRepo.ObtenerOdontMatricula(matricula);
     nroMat          = matricula;
     RellenarFormEditable();
 }