Ejemplo n.º 1
0
        private void comboClientePedido_DropDown(object sender, EventArgs e)
        {
            comboCliente.Items.Clear();

            DataTable dt = new DataTable();

            dt = GerPessoa.ConsultarDataTable();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboCliente.Items.Add(dt.Rows[i]["NumDocumento"]);
            }
        }
Ejemplo n.º 2
0
        private void butCadastrar_Click(object sender, EventArgs e)
        {
            byte tipoPes;

            if (radFis.Checked)
            {
                tipoPes = Utils.TipoPessoaFisica;
            }
            else
            {
                tipoPes = Utils.TipoPessoaJuridica;
            }
            Pessoa p         = new Pessoa(txtNome.Text, tipoPes, txtNumDoc.Text, txtTel.Text);
            string resultado = ValidaCampos();

            if (!string.IsNullOrEmpty(resultado))
            {
                MessageBox.Show(resultado);
                return;
            }
            GerPessoa.Gravar(p);
            limparTela();
        }