示例#1
0
        private void dgvEmpleados_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                txtDni.Text      = dgvEmpleados.CurrentRow.Cells[0].Value.ToString();
                txtApellido.Text = dgvEmpleados.CurrentRow.Cells[1].Value.ToString();
                txtNombre.Text   = dgvEmpleados.CurrentRow.Cells[2].Value.ToString();
                txtCuil.Text     = dgvEmpleados.CurrentRow.Cells[4].Value.ToString();
                txtMail.Text     = dgvEmpleados.CurrentRow.Cells[3].Value.ToString();
                cbbtipoempleado.SelectedIndex = cbbtipoempleado.FindString(dgvEmpleados.CurrentRow.Cells[5].Value.ToString());

                EmpleadoNegocio negocio = new EmpleadoNegocio();

                Telefono telefono = new Telefono();
                telefono        = negocio.buscarTelefono(Convert.ToInt32(txtDni.Text));
                txtIdTel.Text   = telefono.Id.ToString();
                txtNumTel.Text  = telefono.Numero.ToString();
                txtTipoTel.Text = telefono.TipoDeTelefono;

                Domicilio domicilio = new Domicilio();
                domicilio                = negocio.buscarDomicilio(Convert.ToInt32(txtDni.Text));
                txtId.Text               = domicilio.Id.ToString();
                txtCalle.Text            = domicilio.Calle;
                txtNumero.Text           = domicilio.Altura.ToString();
                txtCalle.CharacterCasing = CharacterCasing.Upper;
                txtCodPostal.Text        = domicilio.CodigoPostal.ToString();
                txtlocalidad.Text        = domicilio.Localidad;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }