コード例 #1
0
        static public void OpenClienteJuridica()
        {
            bool verifica = false;

            foreach (Form a in System.Windows.Forms.Application.OpenForms)
            {
                if (a is Forms.Cliente.ClienteJuridica)
                {
                    a.BringToFront();
                    verifica = true;
                    break;
                }
            }

            if (!verifica)
            {
                if (LogonAtual().Funcionario.Permissao.cadastrosPessoaJuridica.IntToBool())
                {
                    Forms.Cliente.ClienteJuridica childFormClienteJuridica = new Forms.Cliente.ClienteJuridica();
                    childFormClienteJuridica.Show();
                    childFormClienteJuridica.Disposed += delegate { childFormClienteJuridica.Dispose(); };
                }
                else
                {
                    MessageBox.Show("Sem permissão!");
                }
            }
        }
コード例 #2
0
        static public void OpenClienteJuridica()
        {
            bool verifica = false;

            foreach (Form a in System.Windows.Forms.Application.OpenForms)
            {
                if (a is Forms.Cliente.ClienteJuridica)
                {
                    a.BringToFront();
                    verifica = true;
                    break;
                }
            }

            if (!verifica)
            {
                Forms.Cliente.ClienteJuridica childFormClienteJuridica = new Forms.Cliente.ClienteJuridica();
                childFormClienteJuridica.Show();
                childFormClienteJuridica.Disposed += delegate { childFormClienteJuridica.Dispose(); };
            }
        }