Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btBuscar_Click(object sender, EventArgs e)
- {
- try
- {
- //aqui é passado uma string para a variavel "int" atraves do txtNome.Text
- int num = Convert.ToInt32(txtNome2.Text);
- Clientes c = Banco.buscarClienteNome(num); //Consta erro nessa linha, a partir de Banco.buscar...;
- if(c != null)
- {
- txtCod2.Text = Convert.ToString(c.codigo);
- txtBairro2.Text = c.bairro;
- txtRua2.Text = c.rua;
- txtNum2.Text = Convert.ToString(c.numero);
- dateTimePicker1.Value = Convert.ToDateTime(c.dt_nasc);
- txtTel2.Text = c.telefone;
- cbStatus2.SelectedIndex = (c.ativo == false) ? 1 : 0;
- }
- else
- {
- MessageBox.Show("Não deixe o campo 'Nome' vazio.","Buscar Clientes",
- MessageBoxButtons.OK, MessageBoxIcon.Stop);
- }
- }
- catch(Exception)
- {
- MessageBox.Show("Erro","Buscar Clientes", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement