Ejemplo n.º 1
0
        private void dtgResponsables_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                ServicioGeneralClient servicioGeneral = new ServicioGeneralClient();

                intCodigoResponsable              = Convert.ToInt32(dtgResponsables.Rows[e.RowIndex].Cells["CODIGO"].Value);
                txtBarrio.Text                    = Convert.ToString(dtgResponsables.Rows[e.RowIndex].Cells["BARRIO"].Value);
                txtDireccion.Text                 = Convert.ToString(dtgResponsables.Rows[e.RowIndex].Cells["DIRECCION"].Value);
                txtEmail.Text                     = Convert.ToString(dtgResponsables.Rows[e.RowIndex].Cells["EMAIL"].Value);
                txtIdentificacion.Text            = Convert.ToString(dtgResponsables.Rows[e.RowIndex].Cells["IDENTIFICACION"].Value);
                txtNombrePila.Text                = Convert.ToString(dtgResponsables.Rows[e.RowIndex].Cells["NOMBRE_PILA"].Value);
                txtNombreResponsable.Text         = Convert.ToString(dtgResponsables.Rows[e.RowIndex].Cells["NOMBRE"].Value);
                txtTelefonoCelular.Text           = Convert.ToString(dtgResponsables.Rows[e.RowIndex].Cells["TELEFONO_CELULAR"].Value);
                txtTelefonoFijo.Text              = Convert.ToString(dtgResponsables.Rows[e.RowIndex].Cells["TELEFONO_FIJO"].Value);
                cboClaseResponsable.SelectedValue = Convert.ToInt32(dtgResponsables.Rows[e.RowIndex].Cells["COD_CLR"].Value);
                var ciudad = servicioGeneral.getCiudadesTabla(5, 0, Convert.ToInt32(dtgResponsables.Rows[e.RowIndex].Cells["COD_CIU"].Value));
                if (ciudad.CODIGO > 0)
                {
                    cboPais.SelectedValue = ciudad.CODIGO_PAIS;
                    cargaDepto();
                    cboDepto.SelectedValue = ciudad.CODIGO_DEPARTAMENTO;
                    cargaCiudad();
                    cboCiudad.SelectedValue = Convert.ToInt32(dtgResponsables.Rows[e.RowIndex].Cells["COD_CIU"].Value);
                }

                if (Convert.ToString(dtgResponsables.Rows[e.RowIndex].Cells["ESTADO"].Value) == "ACTIVO")
                {
                    rbnActivo.Checked   = true;
                    rbnInactivo.Checked = false;
                }
                else if (Convert.ToString(dtgResponsables.Rows[e.RowIndex].Cells["ESTADO"].Value) == "INACTIVO")
                {
                    rbnInactivo.Checked = true;
                    rbnActivo.Checked   = false;
                }
                else
                {
                    rbnActivo.Checked   = true;
                    rbnInactivo.Checked = true;
                }
            }
        }