Example #1
0
        public frmPrincipal(int codigo)
        {
            InitializeComponent();
            ctrUsuario control = new ctrUsuario();

            control.setUsu(codigo, "", "", "", "", 0, "", "", "", "");
            control.RecuperaDados();
            UserAtual = codigo;
            if (control.getNivel() == 1)
            {
                menuStrip1.Visible = true;
                menuStrip2.Visible = false;
            }
            else
            {
                menuStrip2.Visible = true;
                menuStrip1.Visible = false;
            }
            emp = new ctrEmpresa();
            emp.Select();
            if (emp.getCodigo() == 0)
            {
                frmCadEmpresa f    = new frmCadEmpresa();
                bool          sair = false;
                do
                {
                    if (MessageBox.Show("Empresa não cadastrada!", "Aviso", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
                    {
                        f.ShowDialog();
                    }
                    else
                    {
                        sair = true;
                        this.Close();
                    }
                } while (!f.Cadastro && !sair);
            }
        }
Example #2
0
        private void btEmpresa(object sender, EventArgs e)
        {
            frmCadEmpresa f = new frmCadEmpresa();

            f.ShowDialog();
        }