public void alterar()
 {
     if (tabela.SelectedRows.Count == 1)
     {
         Cliente cli = new Cliente();
         Endereco end = new Endereco();
         cli.id_cliente = Convert.ToInt32(tabela.CurrentRow.Cells[0].Value.ToString());
         end.id_endereco = Convert.ToInt32(tabela.CurrentRow.Cells[1].Value.ToString());
         cli.nome = tabela.CurrentRow.Cells[2].Value.ToString();
         cli.cpf = tabela.CurrentRow.Cells[3].Value.ToString();
         cli.rg = tabela.CurrentRow.Cells[4].Value.ToString();
         string data = tabela.CurrentRow.Cells[5].Value.ToString();
         cli.data = DateTime.Parse(data);
         cli.genero = tabela.CurrentRow.Cells[6].Value.ToString();
         cli.email = tabela.CurrentRow.Cells[7].Value.ToString();
         cli.telefone = tabela.CurrentRow.Cells[8].Value.ToString();
         cli.celular = tabela.CurrentRow.Cells[9].Value.ToString();
         end.rua = tabela.CurrentRow.Cells[10].Value.ToString();
         end.bairro = tabela.CurrentRow.Cells[11].Value.ToString();
         end.numero = Convert.ToInt32(tabela.CurrentRow.Cells[12].Value.ToString());
         end.cidade = tabela.CurrentRow.Cells[13].Value.ToString();
         end.complemento = tabela.CurrentRow.Cells[14].Value.ToString();
         end.cep = tabela.CurrentRow.Cells[15].Value.ToString();
         end.uf = tabela.CurrentRow.Cells[16].Value.ToString();
         cli.endereco = end;
         FrmCadClienteConstrucao cad = new FrmCadClienteConstrucao(this, cli);
         cad.Show();
     }
 }
Esempio n. 2
0
        public Fornecedor getFornecedor()
        {
            Fornecedor forn = new Fornecedor();
            Pessoa_Juridica jur = new Pessoa_Juridica();
            Endereco end = new Endereco();
            forn.id_fornecedor = Convert.ToInt32(tabela.CurrentRow.Cells[0].Value.ToString());
            end.id_endereco = Convert.ToInt32(tabela.CurrentRow.Cells[1].Value.ToString());
            forn.razao_social = tabela.CurrentRow.Cells[2].Value.ToString();

            forn.nome_fantasia = tabela.CurrentRow.Cells[3].Value.ToString();
            forn.cnpj = tabela.CurrentRow.Cells[4].Value.ToString();
            forn.inscricao_estadual = tabela.CurrentRow.Cells[5].Value.ToString();
            forn.email = tabela.CurrentRow.Cells[6].Value.ToString();
            forn.telefone = tabela.CurrentRow.Cells[7].Value.ToString();
            forn.celular = tabela.CurrentRow.Cells[8].Value.ToString();
            end.rua = tabela.CurrentRow.Cells[9].Value.ToString();
            end.bairro = tabela.CurrentRow.Cells[10].Value.ToString();
            end.numero = Convert.ToInt32(tabela.CurrentRow.Cells[11].Value.ToString());
            end.cidade = tabela.CurrentRow.Cells[12].Value.ToString();
            end.complemento = tabela.CurrentRow.Cells[13].Value.ToString();
            end.cep = tabela.CurrentRow.Cells[14].Value.ToString();
            end.uf = tabela.CurrentRow.Cells[15].Value.ToString();
            jur.id_pessoa_juridica = Convert.ToInt32(tabela.CurrentRow.Cells[tabela.ColumnCount-1].Value.ToString());
            jur.endereco = end;
            forn.pessoa_juridica=jur;
            return forn;
        }
Esempio n. 3
0
 public Cliente retorna_cliente()
 {
     Cliente cli = new Cliente();
         Endereco end = new Endereco();
         cli.id_cliente = Convert.ToInt32(tabela.CurrentRow.Cells[0].Value.ToString());
         end.id_endereco = Convert.ToInt32(tabela.CurrentRow.Cells[1].Value.ToString());
         cli.nome = tabela.CurrentRow.Cells[2].Value.ToString();
         cli.cpf = tabela.CurrentRow.Cells[3].Value.ToString();
         cli.rg = tabela.CurrentRow.Cells[4].Value.ToString();
         string data = tabela.CurrentRow.Cells[5].Value.ToString();
         cli.data = DateTime.Parse(data);
         cli.genero = tabela.CurrentRow.Cells[6].Value.ToString();
         cli.email = tabela.CurrentRow.Cells[7].Value.ToString();
         cli.telefone = tabela.CurrentRow.Cells[8].Value.ToString();
         cli.celular = tabela.CurrentRow.Cells[9].Value.ToString();
         end.rua = tabela.CurrentRow.Cells[10].Value.ToString();
         end.bairro = tabela.CurrentRow.Cells[11].Value.ToString();
         end.numero = Convert.ToInt32(tabela.CurrentRow.Cells[12].Value.ToString());
         end.cidade = tabela.CurrentRow.Cells[13].Value.ToString();
         end.complemento = tabela.CurrentRow.Cells[14].Value.ToString();
         end.cep = tabela.CurrentRow.Cells[15].Value.ToString();
         end.uf = tabela.CurrentRow.Cells[16].Value.ToString();
         cli.endereco = end;
         return cli;
 }