Beispiel #1
0
        private void clienteToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmConsultaCliente f = new frmConsultaCliente();

            f.ShowDialog();
            f.Dispose();
        }
        private void btnLocalizar_Click(object sender, EventArgs e)
        {
            frmConsultaCliente f = new frmConsultaCliente();

            f.ShowDialog();

            if (f.codigo != 0)
            {
                DALConexao    cx     = new DALConexao(DadosDaConexao.StringDeConexao);
                BLLCliente    bll    = new BLLCliente(cx);
                ModeloCliente modelo = bll.CarregaModeloCliente(f.codigo);
                txtCodCliente.Text = modelo.CliCod.ToString();

                if (modelo.CliTipo == "Física")
                {
                    rdbFisica.Checked = true;
                }
                else
                {
                    rdbJuridica.Checked = true;
                }

                txtNomeCli.Text  = modelo.CliNome;
                txtBairro.Text   = modelo.CliBairro;
                mskCelular.Text  = modelo.CliCel;
                txtCEP.Text      = modelo.CliCep;
                txtCidade.Text   = modelo.CliCidade;
                txtCPF.Text      = modelo.CliCpfCnpj;
                txtEmail.Text    = modelo.CliEmail;
                txtRua.Text      = modelo.CliEndereco;
                txtNumero.Text   = modelo.CliEndNum;
                txtEstado.Text   = modelo.CliEstado;
                mskTelefone.Text = modelo.CliFone;
                txtRG.Text       = modelo.CliRgIe;
                txtRSocial.Text  = modelo.CliRSocial;
                AlteraBotoes(3);
            }
            else
            {
                this.LimpaTela();
                this.AlteraBotoes(1);
            }

            f.Dispose();
        }