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();
     }
 }
 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();
     }
 }
 private void button1_Click(object sender, EventArgs e)
 {
     FrmCadClienteConstrucao cad = new FrmCadClienteConstrucao(this);
     cad.Show();
 }
        private void button1_Click(object sender, EventArgs e)
        {
            FrmCadClienteConstrucao cad = new FrmCadClienteConstrucao(this);

            cad.Show();
        }