コード例 #1
0
ファイル: FornecedorFRN.cs プロジェクト: Cryslaine/projeto
        private void btnPesquisa_Click(object sender, EventArgs e)
        {
            ModFornecedor modF = new ModFornecedor();
            FornecedorNEG neg  = new FornecedorNEG();

            modF = neg.PesquisarFornecedor(Regex.Replace(txtCnpjPesquisa.Text, "[^0-9a-zA-Z]+", ""));

            txtId.Text          = Convert.ToInt32(modF.Id).ToString();
            txtRazaoSocial.Text = modF.RazaoSocial;
            txtNome.Text        = modF.Nome;
            txtCnpj.Text        = modF.Cnpj;
            MessageBox.Show("Pesquisa realizada com sucesso!");
        }
コード例 #2
0
        protected void PesquisaCnpj_Click(object sender, EventArgs e)
        {
            ModFornecedor modF = new ModFornecedor();
            FornecedorNEG neg  = new FornecedorNEG();

            modF = neg.PesquisarFornecedor(Regex.Replace(txtCnpjPesquisa.Text, "[^0-9a-zA-Z]+", "").Replace("/", "").Replace(".", "").Replace("-", ""));

            txtId.Text           = Convert.ToInt32(modF.Id).ToString();
            txtRazaoSocial.Text  = modF.RazaoSocial;
            txtNomefantasia.Text = modF.Nome;
            txtCnpj.Text         = modF.Cnpj;
            if (modF.Cnpj == txtCnpjPesquisa.Text)
            {
                MessageBox.Show("Pesquisa realizada com sucesso!");
            }
            else
            {
                MessageBox.Show("CNPJ não cadastrado!");
            }
        }