Ejemplo n.º 1
0
        private void preencheFicha()
        {
            OperacaoBanco operacao = new OperacaoBanco();

            System.Data.SqlClient.SqlDataReader dados = operacao.Select("select Nome,Filiacao_Pai,Filiacao_Mae,Nascimento,FotoDataURI,Naturalidade,Nacionalidade," +
                                                                        "RG,RG_Data_Exped,CPF,PIS,NIT,CEI,RGP,CTPS,RGP_Registro " +
                                                                        "from Tbl_Associados " +
                                                                        "where ID_Associado = " + lblIDAssociado.Text);

            while (dados.Read())
            {
                lblNome.Text = Convert.ToString(dados[0]);

                lblPai.Text        = Convert.ToString(dados[1]);
                lblMae.Text        = Convert.ToString(dados[2]);
                lblNascimento.Text = Convert.ToString(dados[3]);

                lblNatural.Text  = Convert.ToString(dados[5]);
                lblNacional.Text = Convert.ToString(dados[6]);

                lblRG.Text      = Convert.ToString(dados[7]);
                lblEmissao.Text = Convert.ToString(dados[8]);

                lblCPF.Text = Convert.ToString(dados[9]);
                lblPIS.Text = Convert.ToString(dados[10]);

                lblNIT.Text = Convert.ToString(dados[11]);
                lblCEI.Text = Convert.ToString(dados[12]);

                lblRGP.Text  = Convert.ToString(dados[13]);
                lblCTPS.Text = Convert.ToString(dados[14]);

                lbladmiss.Text = Convert.ToString(dados[15]);



                //monta foto
                //string ScriptFoto = "<script language=javascript>document.getElementById('results').innerHTML = '<img src=\"" + Convert.ToString(dados[4]) + "\"/>';</script>";
                //ClientScript.RegisterStartupScript(this.GetType(), "montafoto", ScriptFoto);
            }
        }
Ejemplo n.º 2
0
        private void dadosCorpo()
        {
            string datastatus   = DateTime.Now.ToString("yyyy-MM-dd");
            string stringselect = @"select ID_Associado , Nome, tempo_associado , AreaAtuacao  , Arte_Principal, Categoria   " +
                                  " from Tbl_Associados  where ID_Colonia = " + IDColPesq +
                                  " order by Nome";
            int TotalRegistros = 0;

            OperacaoBanco operacao = new OperacaoBanco();

            System.Data.SqlClient.SqlDataReader dados = operacao.Select(stringselect);

            string bt1a = "", bt1b = "";

            while (dados.Read())
            {
                string Coluna0 = Convert.ToString(dados[0]);
                string Coluna1 = Convert.ToString(dados[1]);
                string Coluna2 = Convert.ToString(dados[2]);
                string Coluna3 = Convert.ToString(dados[3]);
                string Coluna4 = Convert.ToString(dados[4]);
                string Coluna5 = Convert.ToString(dados[5]);

                bt1a = "<a href='RedirectPesquisa.aspx?v1=" + Coluna0 + "&v2=" + Coluna1 + "' target='_blank'>";
                bt1b = "</a>";

                string stringcomaspas = "******" +
                                        "<td>" + bt1a + Coluna1 + bt1b + "</td>" +
                                        "<td>" + Coluna2 + "</td>" +
                                        "<td>" + Coluna3 + "</td>" +
                                        "<td>" + Coluna4 + "</td>" +
                                        "<td>" + Coluna5 + "</td>" +
                                        "</tr>";

                str.Append(stringcomaspas);
                TotalRegistros++;
            }
            ConexaoBancoSQL.fecharConexao();
        }
        protected void BtSalvar(object sender, EventArgs e)
        {
            string FotoDataUri = Request["fotouri"].ToString();
            string emissao     = DateTime.Now.ToString("dd/MM/yyyy");

            string stringinsert = @"INSERT INTO Tbl_Associados (ID_Colonia,Nome,Apelido,Colonia, " +
                                  "Endereco,Bairro,CEP,Cidade,UF,Filiacao_Pai,Filiacao_Mae,Nascimento,Naturalidade,Nacionalidade,Escolaridade," +
                                  "CPF,RG,RG_Orgao,RG_Data_Exped,PIS,NIT, " +
                                  "Titulo,Titulo_Zona,Titulo_Secao,CEI,Estado_Civil,Telefone,email,Sexo,   " +
                                  "CTPS,RGP,RGP_Registro,RGP_emissor,Profissao,Categoria, " +
                                  "AreaAtuacao,Relacao_Trabalho,Embarcacao_Utiliza,Embarcacao_Nome,Embarcacao_Prop,Embarcacao_Tipo, " +
                                  "Embarcacao_Tamanho,Embarcacao_PRopulsao,Embarcacao_capitania,RGP_MPA,Arte_Principal,Arte_Dono,  " +
                                  "Arte_Esepcies,Arte_locais_venda,Arte_comercializado,Trabalho_dias,Trabalho_duracao,Trabalho_producao, " +
                                  "Trabalho_valor_venda,Trabalho_consumido, " +
                                  "Dependentes,Filhos_Escola,Seguro_Defeso,Bolsa_Familia,Tipo_Resid,possui_Agua_Encanada,  " +
                                  "possui_Energia,possui_Telefone,possui_esgoto,possui_computador,pessoas_Resid, pessoas_Menores, " +
                                  "pessoas_aposentados,renda_mensal,outra_atividade,renda_outra,valor_Seguro_desemprego,valor_bolsa_familia, " +
                                  "total_renda_familiar ,tempo_associado,mensalidade_em_dias,valor_mensalidade ,motivo_inadimp, satisfeito,opniao, CTPS_Serie, FotoDataURI  " +
                                  ") VALUES (" + lblIDCol.Text +
                                  ",'" + txtNome.Text + "', '" + txtApelido.Text + "', '" + lblColonia.Text + "', '" + txtEndereco.Text +
                                  "', '" + txtBairro.Text + "', '" + txtCEP.Text + "', '" + txtMunicipio.Text + "', '" + lblUF.Text + "', '" + txtPai.Text + "', " +
                                  "'" + txtMae.Text + "', '" + txtNascimento.Text + "', '" + txtNaturalidade.Text + "', '" + txtNacionalidade.Text + "', " +
                                  "'" + txtEscolaridade.Text + "', " +
                                  "'" + txtCPF.Text + "', " +
                                  "'" + txtRG.Text + "', " +
                                  "'" + txtEmissor.Text + "', " +
                                  "'" + txtEmissao.Text + "', " +
                                  "'" + txtPIS.Text + "', " +
                                  "'" + txtNIT.Text + "', " +
                                  "'" + txtTitulo.Text + "', " +
                                  "'" + txtZOna.Text + "', " +
                                  "'" + txtSecao.Text + "', " +
                                  "'" + txtCEI.Text + "', " +
                                  "'" + txtEstCivil.Text + "', " +
                                  "'" + txtTelefone.Text + "', " +
                                  "'" + txtemail.Text + "', " +
                                  "'" + txtsexo.Text + "', " +
                                  "'" + txtCTPS.Text + "', " +
                                  "'" + txtRGPAtual.Text + "', " +
                                  "'" + txtRGPRegistro.Text + "', " +
                                  "'" + txtRGPEmissor.Text + "', " +
                                  "'" + txtProf.Text + "', " +
                                  "'" + txtCat.Text + "', " +
                                  "'" + txtAtuacao.Text + "', " +
                                  "'" + txtRelacao.Text + "', " +
                                  "'" + txtutilizaEmbarca.Text + "', " +
                                  "'" + txtNomeEmbarca.Text + "', " +
                                  "'" + txtPropietario.Text + "', " +
                                  "'" + txtTipo.Text + "', " +
                                  "'" + txtTamanho.Text + "', " +
                                  "'" + txtProp.Text + "', " +
                                  "'" + txtCapitania.Text + "', " +
                                  "'" + txtRGPMPA.Text + "', " +
                                  "'" + txtArtes.Text + "', " +
                                  "'" + txtDonoArtes.Text + "', " +
                                  "'" + txtPRincipais.Text + "', " +
                                  "'" + txtLocais.Text + "', " +
                                  "'" + txtComoComerc.Text + "', " +
                                  "'" + txtDiasTrab.Text + "', " +
                                  "'" + txtDuracao.Text + "', " +
                                  "'" + txtProdMedia.Text + "', " +
                                  "'" + txtVEndaPRod.Text + "', " +
                                  "'" + txtQuantConsumido.Text + "', " +
                                  "'" + txtDependentes.Text + "', " +
                                  "'" + txtfilhosescola.Text + "', " +
                                  "'" + txtsegdefeso.Text + "', " +
                                  "'" + txtBolsafamilia.Text + "', " +
                                  "'" + txtCasaPropia.Text + "', " +
                                  "'" + txtAguaEncan.Text + "', " +
                                  "'" + txtpossuiEnergia.Text + "', " +
                                  "'" + txtpossuiTelefone.Text + "', " +
                                  "'" + txtpossuiEsgoto.Text + "', " +
                                  "'" + txtPossuiCOmput.Text + "', " +
                                  "'" + txtQuantPessoas.Text + "', " +
                                  "'" + txtQuantMenores.Text + "', " +
                                  "'" + txtAposentado.Text + "', " +
                                  "'" + txtRendaAtividade.Text + "', " +
                                  "'" + TxtExerceOutra.Text + "', " +
                                  "'" + txtRendaOutra.Text + "', " +
                                  "'" + txtVAlorDefeso.Text + "', " +
                                  "'" + txtValorBolsaFam.Text + "', " +
                                  "'" + txtRendaFamil.Text + "', " +
                                  "'" + txtTempoAssoc.Text + "', " +
                                  "'" + txtEmdias.Text + "', " +
                                  "'" + txtValorMens.Text + "', " +
                                  "'" + txtMotivoInadimp.Text + "', " +
                                  "'" + txtSatisfeito.Text + "', " +
                                  "'" + txtOpniao.Text + "', " +
                                  "'" + emissao + "', " +
                                  "'" + FotoDataUri + "' " +
                                  ")";

            OperacaoBanco operacao = new OperacaoBanco();
            bool          inserir  = operacao.Insert(stringinsert);

            ConexaoBancoSQL.fecharConexao();

            if (inserir == true)
            {
                VerificaID();
            }
            else
            {
                Response.Write("<script>alert('Problemas ao Salvar. Verifique os Dados');</script>");
            }
        }
        private void preencheFicha()
        {
            OperacaoBanco operacao = new OperacaoBanco();

            System.Data.SqlClient.SqlDataReader dados = operacao.Select("select Nome,apelido,Endereco,Bairro,cep,cidade,uf, " +
                                                                        "Filiacao_Pai,Filiacao_Mae,Nascimento,Naturalidade,Nacionalidade,Escolaridade, " +
                                                                        "CPF,RG,RG_Data_Exped,RG_Orgao, " +
                                                                        "Titulo,Titulo_Zona,Titulo_Secao, " +
                                                                        "PIS,NIT,CEI, " +
                                                                        "Sexo,Estado_Civil,Telefone,email, " +
                                                                        "CTPS,RGP,RGP_Registro,RGP_emissor, " +
                                                                        "Profissao,Categoria,AreaAtuacao,   " +
                                                                        "Relacao_Trabalho,Embarcacao_Utiliza,Embarcacao_Nome,Embarcacao_Prop,Embarcacao_Tipo," +
                                                                        "Embarcacao_Tamanho,Embarcacao_PRopulsao,Embarcacao_capitania,RGP_MPA, " +
                                                                        "Arte_Principal,Arte_Dono, Arte_Esepcies ,Arte_locais_venda ,Arte_comercializado ," +
                                                                        "Trabalho_dias,Trabalho_duracao ,Trabalho_producao ,Trabalho_valor_venda ,Trabalho_consumido, " +
                                                                        "Dependentes, Filhos_Escola, Seguro_Defeso, Bolsa_Familia, " +
                                                                        "Tipo_Resid, possui_Agua_Encanada, possui_Energia , possui_Telefone ,possui_esgoto , possui_computador, " +
                                                                        "pessoas_Resid, pessoas_Menores , pessoas_aposentados, " +
                                                                        "renda_mensal, outra_atividade, renda_outra, " +
                                                                        "valor_Seguro_desemprego,valor_bolsa_familia ,total_renda_familiar ,  " +
                                                                        "tempo_associado, mensalidade_em_dias ,valor_mensalidade,motivo_inadimp ,satisfeito ,opniao, FotoDataURI, Arte_Quant " +
                                                                        "from Tbl_Associados " +
                                                                        "where ID_Associado = " + lblIDAssociado.Text);

            while (dados.Read())
            {
                lblNome.Text    = Convert.ToString(dados[0]);
                lblApelido.Text = Convert.ToString(dados[1]);

                lblEND.Text    = Convert.ToString(dados[2]);
                lblBairro.Text = Convert.ToString(dados[3]);

                lblCEP.Text       = Convert.ToString(dados[4]);
                lblMunicipio.Text = Convert.ToString(dados[5]);
                lblUF.Text        = Convert.ToString(dados[6]);

                lblPai.Text = Convert.ToString(dados[7]);
                lblMae.Text = Convert.ToString(dados[8]);

                lblNascimento.Text   = Convert.ToString(dados[9]);
                lblNatural.Text      = Convert.ToString(dados[10]);
                lblNacional.Text     = Convert.ToString(dados[11]);
                lblEscolaridade.Text = Convert.ToString(dados[12]);

                lblCPF.Text     = Convert.ToString(dados[13]);
                lblRG.Text      = Convert.ToString(dados[14]);
                lblEmissao.Text = Convert.ToString(dados[15]);
                lblEmissor.Text = Convert.ToString(dados[16]);

                lblTitulo.Text = Convert.ToString(dados[17]);
                lblZona.Text   = Convert.ToString(dados[18]);
                lblSecao.Text  = Convert.ToString(dados[19]);

                lblPIS.Text = Convert.ToString(dados[20]);
                lblNIT.Text = Convert.ToString(dados[21]);
                lblCEI.Text = Convert.ToString(dados[22]);

                lblSexo.Text  = Convert.ToString(dados[23]);
                lblCivil.Text = Convert.ToString(dados[24]);
                lblTel.Text   = Convert.ToString(dados[25]);
                lblemail.Text = Convert.ToString(dados[26]);

                lblCTPS.Text       = Convert.ToString(dados[27]);
                lblRGP.Text        = Convert.ToString(dados[28]);
                lblRGP1.Text       = Convert.ToString(dados[29]);
                lblRGPEMissor.Text = Convert.ToString(dados[30]);

                lblprofissao.Text   = Convert.ToString(dados[31]);
                lblcategoria.Text   = Convert.ToString(dados[32]);
                lblareaatuacao.Text = Convert.ToString(dados[33]);

                lblrelacao.Text        = Convert.ToString(dados[34]);
                lblutilizaembarca.Text = Convert.ToString(dados[35]);
                lblnomeEmbarca.Text    = Convert.ToString(dados[36]);
                lblProp.Text           = Convert.ToString(dados[37]);
                lblTipo.Text           = Convert.ToString(dados[38]);
                lblTamanho.Text        = Convert.ToString(dados[39]);

                lblPropulp.Text   = Convert.ToString(dados[40]);
                lblCapPortos.Text = Convert.ToString(dados[41]);
                lblRGPMPA.Text    = Convert.ToString(dados[42]);

                lblprincipaisartes.Text = Convert.ToString(dados[43]);
                lbldonoartes.Text       = Convert.ToString(dados[44]);
                lblPrincipais.Text      = Convert.ToString(dados[45]);
                lbllocaisvenda.Text     = Convert.ToString(dados[46]);
                lblComoComerc.Text      = Convert.ToString(dados[47]);

                lbldiasTrab.Text   = Convert.ToString(dados[48]);
                lbldiaPesca.Text   = Convert.ToString(dados[49]);
                lblProdMedia.Text  = Convert.ToString(dados[50]);
                lblValorVenda.Text = Convert.ToString(dados[51]);
                lblConsumido.Text  = Convert.ToString(dados[52]);

                lblDependentes.Text = Convert.ToString(dados[53]);
                lblFilhos.Text      = Convert.ToString(dados[54]);
                lbldefeso.Text      = Convert.ToString(dados[55]);
                lblBolsaFam.Text    = Convert.ToString(dados[56]);

                lbltipoResid.Text = Convert.ToString(dados[57]);
                lblAgua.Text      = Convert.ToString(dados[58]);
                lblEnergia.Text   = Convert.ToString(dados[59]);
                lblTelefone.Text  = Convert.ToString(dados[60]);

                lblEsgoto.Text     = Convert.ToString(dados[61]);
                lblComputador.Text = Convert.ToString(dados[62]);
                lblPessoas.Text    = Convert.ToString(dados[63]);
                lblMenores.Text    = Convert.ToString(dados[64]);
                lblaposentado.Text = Convert.ToString(dados[65]);

                lblrendaAtiv.Text  = Convert.ToString(dados[66]);
                lblOutraAtiv.Text  = Convert.ToString(dados[67]);
                lblrendaOutra.Text = Convert.ToString(dados[68]);

                lblquantDefeso.Text  = Convert.ToString(dados[69]);
                lblquantBolsa.Text   = Convert.ToString(dados[70]);
                lblTotalRenda.Text   = Convert.ToString(dados[71]);
                lbltempocolonia.Text = Convert.ToString(dados[72]);
                lblemdias.Text       = Convert.ToString(dados[73]);
                lblMensalidade.Text  = Convert.ToString(dados[74]);
                lblinadimp.Text      = Convert.ToString(dados[75]);
                lblsatisfeito.Text   = Convert.ToString(dados[76]);
                lblOpniao.Text       = Convert.ToString(dados[77]);

                lblArtesQuant.Text = Convert.ToString(dados[79]);

                //monta foto
                string ScriptFoto = "<script language=javascript>document.getElementById('results').innerHTML = '<img src=\"" + Convert.ToString(dados[78]) + "\"/>';</script>";
                ClientScript.RegisterStartupScript(this.GetType(), "montafoto", ScriptFoto);
            }
        }
        protected void BtSalvar(object sender, EventArgs e)
        {
            string FotoDataUri  = Request["fotouri"].ToString();
            string stringupdate = "update Tbl_Associados set " +
                                  "Nome = '" + txtNome.Text + "', " +
                                  "Apelido = '" + txtApelido.Text + "', " +
                                  "Endereco = '" + txtEndereco.Text + "', " +
                                  "Bairro  = '" + txtBairro.Text + "', " +
                                  "CEP  = '" + txtCEP.Text + "', " +
                                  "Cidade  = '" + txtMunicipio.Text + "', " +
                                  "Filiacao_Pai  = '" + txtPai.Text + "', " +
                                  "Filiacao_Mae  = '" + txtMae.Text + "', " +
                                  "Nascimento  = '" + txtNascimento.Text + "', " +
                                  "Naturalidade  = '" + txtNaturalidade.Text + "', " +
                                  "Nacionalidade  = '" + txtNacionalidade.Text + "', " +
                                  "Escolaridade  = '" + txtEscolaridade.Text + "', " +
                                  "CPF  = '" + txtCPF.Text + "', " +
                                  "PIS  = '" + txtPIS.Text + "', " +
                                  "RG  = '" + txtRG.Text + "', " +
                                  "RG_Data_Exped  = '" + txtEmissao.Text + "', " +
                                  "RG_Orgao  = '" + txtEmissor.Text + "', " +
                                  "NIT  = '" + txtNIT.Text + "', " +
                                  "CEI  = '" + txtCEI.Text + "', " +
                                  "Titulo  = '" + txtTitulo.Text + "', " +
                                  "Estado_Civil  = '" + txtEstCivil.Text + "', " +
                                  "Sexo  = '" + txtsexo.Text + "', " +
                                  "Telefone  = '" + txtTelefone.Text + "', " +
                                  "email  = '" + txtemail.Text + "', " +
                                  "CTPS  = '" + txtCTPS.Text + "', " +
                                  "RGP  = '" + txtRGPAtual.Text + "', " +
                                  "RGP_Registro  = '" + txtRGPRegistro.Text + "', " +
                                  "RGP_emissor  = '" + txtRGPEmissor.Text + "', " +
                                  "Profissao  = '" + txtProf.Text + "', " +
                                  "Categoria  = '" + txtCat.Text + "', " +
                                  "AreaAtuacao  = '" + txtAtuacao.Text + "', " +
                                  "Relacao_Trabalho  = '" + txtRelacao.Text + "', " +
                                  "Embarcacao_Utiliza  = '" + txtutilizaEmbarca.Text + "', " +
                                  "Embarcacao_Nome  = '" + txtNomeEmbarca.Text + "', " +
                                  "Embarcacao_Prop  = '" + txtPropietario.Text + "', " +
                                  "Embarcacao_Tipo  = '" + txtTipo.Text + "', " +
                                  "Embarcacao_Tamanho  = '" + txtTamanho.Text + "', " +
                                  "Embarcacao_PRopulsao  = '" + txtProp.Text + "', " +
                                  "Embarcacao_capitania  = '" + txtCapitania.Text + "', " +
                                  "RGP_MPA  = '" + txtRGPMPA.Text + "', " +
                                  "Arte_Principal  = '" + txtArtes.Text + "', " +
                                  "Arte_Dono  = '" + txtDonoArtes.Text + "', " +
                                  "Arte_Esepcies  = '" + txtPRincipais.Text + "', " +
                                  "Arte_locais_venda  = '" + txtLocais.Text + "', " +
                                  "Arte_comercializado  = '" + txtComoComerc.Text + "', " +
                                  "Trabalho_dias  = '" + txtDiasTrab.Text + "', " +
                                  "Trabalho_duracao  = '" + txtDuracao.Text + "', " +
                                  "Trabalho_producao  = '" + txtProdMedia.Text + "', " +
                                  "Trabalho_valor_venda  = '" + txtVEndaPRod.Text + "', " +
                                  "Trabalho_consumido  = '" + txtQuantConsumido.Text + "', " +
                                  "Dependentes  = '" + txtDependentes.Text + "', " +
                                  "Filhos_Escola  = '" + txtfilhosescola.Text + "', " +
                                  "Seguro_Defeso  = '" + txtsegdefeso.Text + "', " +
                                  "Bolsa_Familia  = '" + txtBolsafamilia.Text + "', " +
                                  "Tipo_Resid  = '" + txtCasaPropia.Text + "', " +
                                  "possui_Agua_Encanada  = '" + txtAguaEncan.Text + "', " +
                                  "possui_Energia  = '" + txtpossuiEnergia.Text + "', " +
                                  "possui_Telefone  = '" + txtpossuiTelefone.Text + "', " +
                                  "possui_esgoto  = '" + txtpossuiEsgoto.Text + "', " +
                                  "possui_computador  = '" + txtPossuiCOmput.Text + "', " +
                                  "pessoas_Resid  = '" + txtQuantPessoas.Text + "', " +
                                  "pessoas_Menores  = '" + txtQuantMenores.Text + "', " +
                                  "pessoas_aposentados  = '" + txtAposentado.Text + "', " +
                                  "renda_mensal  = '" + txtRendaAtividade.Text + "', " +
                                  "outra_atividade  = '" + TxtExerceOutra.Text + "', " +
                                  "renda_outra  = '" + txtRendaOutra.Text + "', " +
                                  "valor_Seguro_desemprego  = '" + txtVAlorDefeso.Text + "', " +
                                  "valor_bolsa_familia  = '" + txtValorBolsaFam + "', " +
                                  "total_renda_familiar  = '" + txtRendaFamil.Text + "', " +
                                  "tempo_associado  = '" + txtTempoAssoc.Text + "', " +
                                  "mensalidade_em_dias  = '" + txtEmdias.Text + "', " +
                                  "valor_mensalidade  = '" + txtValorMens.Text + "', " +
                                  "motivo_inadimp  = '" + txtMotivoInadimp.Text + "', " +
                                  "satisfeito  = '" + txtSatisfeito.Text + "', " +
                                  "opniao  = '" + txtOpniao.Text + "', " +
                                  "FotoDataURI  = '" + FotoDataUri + "' " +
                                  "where ID_Associado = " + lblIDAssoc.Text;

            OperacaoBanco operacao = new OperacaoBanco();
            Boolean       update   = operacao.Update(stringupdate);

            if (update == true)
            {
                Session["IDAssoc"] = lblIDAssoc.Text;
                Response.Redirect("FichaAssociado.aspx");
            }
        }
        private void PreencheCampos()
        {
            string stringSelect = @"select Nome,Apelido, " +
                                  "Endereco,Bairro,CEP,Cidade,Filiacao_Pai,Filiacao_Mae,Nascimento,Naturalidade,Nacionalidade,Escolaridade," +
                                  "CPF,RG,RG_Orgao,RG_Data_Exped,PIS,NIT, " +
                                  "Titulo,Titulo_Zona,Titulo_Secao,CEI,Estado_Civil,Telefone,email,Sexo,   " +
                                  "CTPS,RGP,RGP_Registro,RGP_emissor,Profissao,Categoria, " +
                                  "AreaAtuacao,Relacao_Trabalho,Embarcacao_Utiliza,Embarcacao_Nome,Embarcacao_Prop,Embarcacao_Tipo, " +
                                  "Embarcacao_Tamanho,Embarcacao_PRopulsao,Embarcacao_capitania,RGP_MPA,Arte_Principal,Arte_Dono,  " +
                                  "Arte_Esepcies,Arte_locais_venda,Arte_comercializado,Trabalho_dias,Trabalho_duracao,Trabalho_producao, " +
                                  "Trabalho_valor_venda,Trabalho_consumido, " +
                                  "Dependentes,Filhos_Escola,Seguro_Defeso,Bolsa_Familia,Tipo_Resid,possui_Agua_Encanada,  " +
                                  "possui_Energia,possui_Telefone,possui_esgoto,possui_computador,pessoas_Resid, pessoas_Menores, " +
                                  "pessoas_aposentados,renda_mensal,outra_atividade,renda_outra,valor_Seguro_desemprego,valor_bolsa_familia, " +
                                  "total_renda_familiar ,tempo_associado,mensalidade_em_dias,valor_mensalidade ,motivo_inadimp, satisfeito,opniao,ID_Colonia, FotoDataURI " +
                                  "from Tbl_Associados where ID_Associado = " + lblIDAssoc.Text;

            OperacaoBanco operacao = new OperacaoBanco();

            System.Data.SqlClient.SqlDataReader rcrdset = operacao.Select(stringSelect);
            while (rcrdset.Read())
            {
                txtNome.Text          = Convert.ToString(rcrdset[0]);
                txtApelido.Text       = Convert.ToString(rcrdset[1]);
                txtEndereco.Text      = Convert.ToString(rcrdset[2]);
                txtBairro.Text        = Convert.ToString(rcrdset[3]);
                txtCEP.Text           = Convert.ToString(rcrdset[4]);
                txtMunicipio.Text     = Convert.ToString(rcrdset[5]);
                txtPai.Text           = Convert.ToString(rcrdset[6]);
                txtMae.Text           = Convert.ToString(rcrdset[7]);
                txtNascimento.Text    = Convert.ToString(rcrdset[8]);
                txtNaturalidade.Text  = Convert.ToString(rcrdset[9]);
                txtNacionalidade.Text = Convert.ToString(rcrdset[10]);
                txtEscolaridade.Text  = Convert.ToString(rcrdset[11]);
                txtCPF.Text           = Convert.ToString(rcrdset[12]);
                txtRG.Text            = Convert.ToString(rcrdset[13]);
                txtEmissor.Text       = Convert.ToString(rcrdset[14]);
                txtEmissao.Text       = Convert.ToString(rcrdset[15]);
                txtPIS.Text           = Convert.ToString(rcrdset[16]);
                txtNIT.Text           = Convert.ToString(rcrdset[17]);
                txtTitulo.Text        = Convert.ToString(rcrdset[18]);
                //txtZOna.Text = Convert.ToString(rcrdset[19]);
                //txtSecao.Text = Convert.ToString(rcrdset[20]);
                txtCEI.Text            = Convert.ToString(rcrdset[21]);
                txtEstCivil.Text       = Convert.ToString(rcrdset[22]);
                txtTelefone.Text       = Convert.ToString(rcrdset[23]);
                txtemail.Text          = Convert.ToString(rcrdset[24]);
                txtsexo.Text           = Convert.ToString(rcrdset[25]);
                txtCTPS.Text           = Convert.ToString(rcrdset[26]);
                txtRGPAtual.Text       = Convert.ToString(rcrdset[27]);
                txtRGPRegistro.Text    = Convert.ToString(rcrdset[28]);
                txtRGPEmissor.Text     = Convert.ToString(rcrdset[29]);
                txtProf.Text           = Convert.ToString(rcrdset[30]);
                txtCat.Text            = Convert.ToString(rcrdset[31]);
                txtAtuacao.Text        = Convert.ToString(rcrdset[32]);
                txtRelacao.Text        = Convert.ToString(rcrdset[33]);
                txtutilizaEmbarca.Text = Convert.ToString(rcrdset[34]);
                txtNomeEmbarca.Text    = Convert.ToString(rcrdset[35]);
                txtPropietario.Text    = Convert.ToString(rcrdset[36]);
                txtTipo.Text           = Convert.ToString(rcrdset[37]);
                txtTamanho.Text        = Convert.ToString(rcrdset[38]);
                txtProp.Text           = Convert.ToString(rcrdset[39]);
                txtCapitania.Text      = Convert.ToString(rcrdset[40]);
                txtRGPMPA.Text         = Convert.ToString(rcrdset[41]);
                txtArtes.Text          = Convert.ToString(rcrdset[42]);
                txtDonoArtes.Text      = Convert.ToString(rcrdset[43]);
                txtPRincipais.Text     = Convert.ToString(rcrdset[44]);
                txtLocais.Text         = Convert.ToString(rcrdset[45]);
                txtComoComerc.Text     = Convert.ToString(rcrdset[46]);
                txtDiasTrab.Text       = Convert.ToString(rcrdset[47]);
                txtDuracao.Text        = Convert.ToString(rcrdset[48]);
                txtProdMedia.Text      = Convert.ToString(rcrdset[49]);
                txtVEndaPRod.Text      = Convert.ToString(rcrdset[50]);
                txtQuantConsumido.Text = Convert.ToString(rcrdset[51]);
                txtDependentes.Text    = Convert.ToString(rcrdset[52]);
                txtfilhosescola.Text   = Convert.ToString(rcrdset[53]);
                txtsegdefeso.Text      = Convert.ToString(rcrdset[54]);
                txtBolsafamilia.Text   = Convert.ToString(rcrdset[55]);
                txtCasaPropia.Text     = Convert.ToString(rcrdset[56]);
                txtAguaEncan.Text      = Convert.ToString(rcrdset[57]);
                txtpossuiEnergia.Text  = Convert.ToString(rcrdset[58]);
                txtpossuiTelefone.Text = Convert.ToString(rcrdset[59]);
                txtpossuiEsgoto.Text   = Convert.ToString(rcrdset[60]);
                txtPossuiCOmput.Text   = Convert.ToString(rcrdset[61]);
                txtQuantPessoas.Text   = Convert.ToString(rcrdset[62]);
                txtQuantMenores.Text   = Convert.ToString(rcrdset[63]);
                txtAposentado.Text     = Convert.ToString(rcrdset[64]);
                txtRendaAtividade.Text = Convert.ToString(rcrdset[65]);
                TxtExerceOutra.Text    = Convert.ToString(rcrdset[66]);
                txtRendaOutra.Text     = Convert.ToString(rcrdset[67]);
                txtVAlorDefeso.Text    = Convert.ToString(rcrdset[68]);
                txtValorBolsaFam.Text  = Convert.ToString(rcrdset[69]);
                txtRendaFamil.Text     = Convert.ToString(rcrdset[70]);
                txtTempoAssoc.Text     = Convert.ToString(rcrdset[71]);
                txtEmdias.Text         = Convert.ToString(rcrdset[72]);
                txtValorMens.Text      = Convert.ToString(rcrdset[73]);
                txtMotivoInadimp.Text  = Convert.ToString(rcrdset[74]);
                txtSatisfeito.Text     = Convert.ToString(rcrdset[75]);
                txtOpniao.Text         = Convert.ToString(rcrdset[76]);

                string ScriptFoto = "<script language=javascript>document.getElementById('results').innerHTML = '<img src=\"" + Convert.ToString(rcrdset[78]) + "\"/>';" +
                                    "document.getElementById('Hidden1').value = \"" + Convert.ToString(rcrdset[78]) + "\"; </script>";

                ClientScript.RegisterStartupScript(this.GetType(), "montafoto", ScriptFoto);
            }
            ConexaoBancoSQL.fecharConexao();
            txtNome.Focus();
        }
        public string SalvarRegistro(string param1, string param2, string param3, string param4, string param5, string param6, string param7, string param8, string param9, string param10,
                                     string param11, string param12, string param13, string param14, string param15, string param16, string param17, string param18, string param19, string param20,
                                     string param21, string param22, string param23, string param24, string param25, string param26, string param27, string param28, string param29, string param30,
                                     string param31, string param32, string param33, string param34, string param35, string param36, string param37, string param38, string param39, string param40,
                                     string param41, string param42, string param43, string param44, string param45, string param46, string param47, string param48, string param49, string param50,
                                     string param51, string param52, string param53, string param54, string param55, string param56, string param57, string param58, string param59, string param60,
                                     string param61, string param62, string param63, string param64, string param65, string param66, string param67, string param68, string param69, string param70,
                                     string param71, string param72, string param73, string param74, string param75, string param76, string param77, string param78, string param79, string param80,
                                     string param81, string param82)
        {
            string stringinsert = "insert into Tbl_Associados (Nome,Apelido,Endereco,CEP,Bairro,Cidade ,UF,Filiacao_Pai,Filiacao_Mae,Nascimento, " +
                                  "Naturalidade,Nacionalidade,Escolaridade,CPF,RG,RG_Orgao,RG_Data_Exped,Titulo,PIS,NIT, " +
                                  "CEI,Estado_Civil , Telefone ,email , sexo,CTPS ,RGP ,RGP_Registro ,RGP_emissor, Profissao, " +
                                  "Categoria ,AreaAtuacao , Relacao_Trabalho , Embarcacao_Utiliza , Embarcacao_Nome , Embarcacao_Prop ,Embarcacao_Tipo ,Embarcacao_Tamanho ,Embarcacao_PRopulsao, Embarcacao_capitania," +
                                  "RGP_MPA ,Arte_Principal , Arte_Quant,Arte_Dono ,Arte_Esepcies ,Arte_locais_venda , Arte_comercializado , Trabalho_dias , Trabalho_duracao,Trabalho_producao , " +
                                  "Trabalho_valor_venda ,Trabalho_consumido ,Dependentes , Filhos_Escola , Seguro_Defeso , Bolsa_Familia, Tipo_Resid ,possui_Agua_Encanada , possui_Energia , possui_Telefone ," +
                                  "possui_esgoto ,possui_computador , pessoas_Resid , pessoas_Menores ,pessoas_aposentados , renda_mensal, outra_atividade ,  renda_outra , valor_Seguro_desemprego ,valor_bolsa_familia," +
                                  "total_renda_familiar , tempo_associado ,mensalidade_em_dias ,valor_mensalidade ,motivo_inadimp , satisfeito ,opniao , FotoDataURI ,   " +
                                  "ID_Colonia, Colonia,CTPS_Serie " +
                                  ") values " +
                                  "('" + param1 + "', '" + param2 + "','" + param3 + "','" + param4 + "','" + param5 + "','" + param6 + "','" + param7 + "','" + param8 + "','" + param9 + "','" + param10 +
                                  "','" + param11 + "', '" + param12 + "','" + param13 + "','" + param14 + "','" + param15 + "','" + param16 + "','" + param17 + "','" + param18 + "','" + param19 + "','" + param20 +
                                  "','" + param21 + "', '" + param22 + "','" + param23 + "','" + param24 + "','" + param25 + "','" + param26 + "','" + param27 + "','" + param28 + "','" + param29 + "','" + param30 +
                                  "','" + param31 + "', '" + param32 + "','" + param33 + "','" + param34 + "','" + param35 + "','" + param36 + "','" + param37 + "','" + param38 + "','" + param39 + "','" + param40 +
                                  "','" + param41 + "', '" + param42 + "','" + param43 + "','" + param44 + "','" + param45 + "','" + param46 + "','" + param47 + "','" + param48 + "','" + param49 + "','" + param50 +
                                  "','" + param51 + "', '" + param52 + "','" + param53 + "','" + param54 + "','" + param55 + "','" + param56 + "','" + param57 + "','" + param58 + "','" + param59 + "','" + param60 +
                                  "','" + param61 + "', '" + param62 + "','" + param63 + "','" + param64 + "','" + param65 + "','" + param66 + "','" + param67 + "','" + param68 + "','" + param69 + "','" + param70 +
                                  "','" + param71 + "', '" + param72 + "','" + param73 + "','" + param74 + "','" + param75 + "','" + param76 + "','" + param77 + "','" + param78 + "'," + param79 + ",'" + param80 +
                                  "','" + param81 + "'" +
                                  ")";
            string url = "";

            OperacaoBanco operacao = new OperacaoBanco();
            bool          inserir  = operacao.Insert(stringinsert);

            ConexaoBancoSQL.fecharConexao();

            //verifica ID e vai para pagina de impressao
            string idassociado  = "";
            string stringSelect = @"select ID_Associado from Tbl_Associados" +
                                  " where (ID_Colonia = " + param79 +
                                  " and nome ='" + param1 + "') order by ID_Associado desc";

            OperacaoBanco operacao2 = new OperacaoBanco();

            System.Data.SqlClient.SqlDataReader rcrdset2 = operacao2.Select(stringSelect);
            while (rcrdset2.Read())
            {
                idassociado = Convert.ToString(rcrdset2[0]);
            }
            ConexaoBancoSQL.fecharConexao();

            if (inserir == true)
            {
                url = "../FichaAssociado2.aspx?IDAssoc=" + idassociado;
            }
            else
            {
                url = "../Sorry.aspx";
            }

            return(url);
        }