コード例 #1
0
        private void btnProcuraPaciente_Click(object sender, EventArgs e)
        {
            Parametros.Form  = "Paciente";
            Parametros.Valor = "";

            bool open = false;

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

            if (!open)
            {
                Form tela = new PesquisaPaciente();
                tela.ShowDialog();
                if (txtcodigo.Text.Trim() != "")
                {
                    BuscaPaciente(int.Parse(txtcodigo.Text));
                }
            }
        }
コード例 #2
0
        private void btnBuscaPaciente_Click(object sender, EventArgs e)
        {
            Parametros.Form  = "Processo";
            Parametros.Valor = "";

            bool open = false;

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

            if (!open)
            {
                Form tela = new PesquisaPaciente();
                tela.ShowDialog();
                RetornoPesquisaPaciente();
            }
        }
コード例 #3
0
ファイル: FrmInicial.cs プロジェクト: renatolsouza/sms
        public void AbrePesquisaPaciente()
        {
            bool open = false;

            foreach (Form form in this.MdiChildren)
            {
                if (form is PesquisaPaciente
                    )
                {
                    form.BringToFront();
                    open = true;
                }
            }
            if (!open)
            {
                Form tela = new PesquisaPaciente();
                tela.MdiParent = this;
                tela.Show();
            }
        }