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

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

            f.ShowDialog();
            try
            {
                if (f.codigo != 0)
                {
                    txtCodigoFornecedor.Text = f.codigo.ToString();
                    //chamada do metodo do txt for codigo
                    txtCodigoFornecedor_Leave(sender, e);
                }
            }
            catch
            {
            }
        }
        private void btnLocalizar_Click(object sender, EventArgs e)
        {
            frmConsultaFornecedor f = new frmConsultaFornecedor();

            f.ShowDialog();
            try
            {
                if (f.codigo != 0)
                {
                    DALConexao       cx     = new DALConexao(DadosDaConexao.stringDeConexao);
                    DAOFornecedor    daoFor = new DAOFornecedor(cx);
                    ModeloFornecedor modelo = daoFor.carregaModeloFornecedor(f.codigo);
                    //colocar dados na tela
                    txtCodigo.Text      = modelo.for_cod.ToString();
                    txtNome.Text        = modelo.for_nome.ToString();
                    txtCnpj.Text        = modelo.for_cnpj.ToString();
                    txtIe.Text          = modelo.for_ie.ToString();
                    txtRazaoSocial.Text = modelo.for_rsocial.ToString();
                    mskCep.Text         = modelo.for_cep.ToString();
                    txtEndereco.Text    = modelo.for_endereco.ToString();
                    txtBairro.Text      = modelo.for_bairro.ToString();
                    mskFone.Text        = modelo.for_fone.ToString();
                    mskCel.Text         = modelo.for_cel.ToString();
                    txtEmail.Text       = modelo.for_email.ToString();
                    txtNumero.Text      = modelo.for_endnumero.ToString();
                    txtCidade.Text      = modelo.for_cidade.ToString();
                    txtEstado.Text      = modelo.for_estado.ToString();
                    alteraBotoes(3);
                }
                else
                {
                    this.limparTela();
                    this.alteraBotoes(1);
                }
                f.Dispose();
            }
            catch //(Exception ex)
            {
                //  throw new Exception(ex.Message);
            }
        }