예제 #1
0
        private void btnBuscaProduto_Click(object sender, EventArgs e)
        {
            Parametros.Form  = "Medicamentos";
            Parametros.Valor = "";

            bool open = false;

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

            if (!open)
            {
                Form tela = new PesquisaProdutos();
                //tela.MdiParent = this.MdiParent;
                tela.ShowDialog();
                RetornoPesquisaMedicamento();
            }
        }
예제 #2
0
        private void btnProcuramercadoria_Click(object sender, EventArgs e)
        {
            bool open = false;

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

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

                Form tela = new PesquisaProdutos();
                tela.ShowDialog();
                RetornoPesquisaProdutos();
            }
        }
예제 #3
0
        private void btnBuscaProduto_Click(object sender, EventArgs e)
        {
            bool open = false;

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

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

                tela.ShowDialog();
                RetornoPesquisaProdutos();
            }
        }
예제 #4
0
        private void Grid_MouseDown(object sender, MouseEventArgs e)
        {
            if (Grid.CurrentRow.Cells[4].Value == "")
            {
                return;
            }

            // verifica se é com o botão equerdo
            if (e.Button == MouseButtons.Right)
            {
                Parametros.Valor = "";
                Parametros.Nome  = "";

                if (Grid.CurrentRow == null)
                {
                    return;
                }

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

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

                    Form tela = new PesquisaProdutos();
                    tela.ShowDialog();
                }

                Grid.CurrentRow.Cells[0].Value = Parametros.Valor;
                Grid.CurrentRow.Cells[1].Value = Parametros.Nome;
            }
        }