private void cfopDataGridView_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            Ualterar();
            Usuario user = new Usuario();

            panelPesquisa.Visible = false;
            Ualterar();
            DataGridViewRow row = this.UserDataGridView.Rows[e.RowIndex];

            txtCodigo.Text = row.Cells[0].Value.ToString();
            textBox1.Text  = row.Cells[1].Value.ToString();
            string ponteiroUsuario = FormLogin.usuarioLogado;

            //a1 = Convert.ToInt32(row.Cells[3].Value.ToString());
            //a2 = Convert.ToInt32(row.Cells[6].Value.ToString());
            //a3 = Convert.ToInt32(row.Cells[5].Value.ToString());
            //a4 = Convert.ToInt32(row.Cells[4].Value.ToString());
            //a5 = Convert.ToInt32(row.Cells[8].Value.ToString());
            //a6 = Convert.ToInt32(row.Cells[9].Value.ToString());
            // a7 = Convert.ToInt32(row.Cells[7].Value.ToString());
            FormLogin.usuarioLogado = textBox1.Text;
            if (user.AcessoCompra())
            {
                checkCompra.Checked = true;
            }
            if (user.AcessoFiscal())
            {
                checkFiscal.Checked = true;
            }
            if (user.AcessoPessoa())
            {
                checkPessoa.Checked = true;
            }
            if (user.AcessoProduto())
            {
                checkProduto.Checked = true;
            }
            if (user.AcessoRelatorio())
            {
                checkRelatório.Checked = true;
            }
            if (user.AcessoUsuario())
            {
                checkUsuario.Checked = true;
            }
            if (user.AcessoVenda())
            {
                checkVenda.Checked = true;
            }
            textBox2.Enabled        = true;
            FormLogin.usuarioLogado = ponteiroUsuario;
        }
Esempio n. 2
0
        private void FormPrincipal_Load(object sender, EventArgs e)
        {
            if (FormLogin.usuarioLogado != "admin")
            {
                if (user.AcessoVenda())
                {
                    vENDASToolStripMenuItem.Enabled = true;
                }
                else
                {
                    vENDASToolStripMenuItem.Enabled = false;
                }

                if (user.AcessoCompra())
                {
                    eNTRADADEPRODUTOSToolStripMenuItem.Enabled = true;
                }
                else
                {
                    eNTRADADEPRODUTOSToolStripMenuItem.Enabled = false;
                }

                if (user.AcessoPessoa())
                {
                    fORNECEDORESToolStripMenuItem.Enabled = true;
                    cLIENTESToolStripMenuItem.Enabled     = true;
                    fUNCIONÁRIOSToolStripMenuItem.Enabled = true;
                }
                else
                {
                    fUNCIONÁRIOSToolStripMenuItem.Enabled = false;
                    fORNECEDORESToolStripMenuItem.Enabled = false;
                    cLIENTESToolStripMenuItem.Enabled     = false;
                }

                if (user.AcessoFiscal())
                {
                    nOTAFISCALELETRÔNICAToolStripMenuItem.Enabled = true;
                    cFOPToolStripMenuItem.Enabled = true;
                }
                else
                {
                    nOTAFISCALELETRÔNICAToolStripMenuItem.Enabled = false;
                    cFOPToolStripMenuItem.Enabled = false;
                }

                if (user.AcessoProduto())
                {
                    pRODUTOSToolStripMenuItem.Enabled = true;
                }
                else
                {
                    pRODUTOSToolStripMenuItem.Enabled = false;
                }

                if (user.AcessoUsuario())
                {
                    uSUÁRIOSToolStripMenuItem.Enabled = true;
                }
                else
                {
                    uSUÁRIOSToolStripMenuItem.Enabled = false;
                }

                if (user.AcessoRelatorio())
                {
                    rELATÓRIOSToolStripMenuItem.Enabled = true;
                }
                else
                {
                    rELATÓRIOSToolStripMenuItem.Enabled = false;
                }
            }
        }