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!"); } } }
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(); }; } }