Exemplo n.º 1
0
        private void btnBuscaFornecedor_Click(object sender, EventArgs e)
        {
            txtCodFornecedor.Text  = "";
            txtNomeFornecedor.Text = "";
            bool open = false;

            foreach (Form form in Application.OpenForms)
            {
                // Verifica se o form esta aberto
                if (form.Name == "PesquisaUnidade")
                {
                    if (form is PesquisaFornecedor)
                    {
                        form.BringToFront();
                        open = true;
                    }
                }
            }

            if (!open)
            {
                Form tela = new PesquisaFornecedor();

                tela.ShowDialog();
                RetornoPesquisaFornecedor();
            }
        }
Exemplo n.º 2
0
        private void btnProcurafornecedor_Click(object sender, EventArgs e)
        {
            bool open = false;

            foreach (Form form in Application.OpenForms)
            {
                // Verifica se o form esta aberto
                if (form.Name == "PesquisaFornecedor")
                {
                    if (form is PesquisaFornecedor)
                    {
                        form.BringToFront();
                        open = true;
                    }
                }
            }

            if (!open)
            {
                Parametros.Valor = "";
                Parametros.Nome  = "";

                Form tela = new PesquisaFornecedor();
                tela.ShowDialog();
                RetornoPesquisaFornecedor();
            }
        }
Exemplo n.º 3
0
 public FormCadastroProduto()
 {
     InitializeComponent();
     produto = new Produto();
     PesquisaFornecedor.Todos(SetFornecedorTodos);
     PesquisaFabricante.Todos(SetFabricanteTodos);
 }
 private void Pesquisar()
 {
     try {
         LimpaResultado();
         int id = Convert.ToInt32(TxtCodigo.Text);
         PesquisaFornecedor.PorProdutoId(id, SetFornecedor);
         PesquisaFabricante.ProProdutoId(id, SetFabricante);
         PesquisaProduto.PorId(id.ToString(), SetProduto);
     } catch (Exception e) {
         MessageBox.Show(e.Message);
     }
 }
Exemplo n.º 5
0
        private void btnPesquisar_Click(object sender, EventArgs e)
        {
            var a = new PesquisaFornecedor(FornecedorRepository);

            if (a.ShowDialog() == DialogResult.OK)
            {
                txtID.Text          = a.forn.Forn_cod.ToString();
                txtBairro.Text      = a.forn.Forn_bairro;
                txtCEP.Text         = a.forn.Forn_cep;
                txtCidade.Text      = a.forn.Cidade.Cid_nome;
                txtEstado.Text      = a.forn.Cidade.EstadoUf;
                txtCNPJ.Text        = a.forn.Forn_cnpj.ToString();
                txtComplemento.Text = a.forn.Forn_complemento;
                txtDescricao.Text   = a.forn.Forn_descricao;
                txtEndereco.Text    = a.forn.Forn_endereco;
                txtNome.Text        = a.forn.Forn_nome;
                txtNumero.Text      = a.forn.Forn_numero.ToString();
                txtTelefone.Text    = a.forn.Forn_telefone;
            }
        }