private void frmProdutosRegistro_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide();
            frmCadProduto frm = new frmCadProduto();

            frm.Show();
        }
Exemplo n.º 2
0
 private void produtosToolStripMenuItem2_Click(object sender, EventArgs e)
 {
     if (UsuarioTipo.Text == "ADMIN")
     {
         frmCadProduto frm = new frmCadProduto();
         frm.lblTipoUsuario.Text   = lblUsuario.Text;
         frm.btnObterDados.Enabled = true;
         frm.MdiParent             = this;
         frm.Show();
     }
     if (UsuarioTipo.Text == "SUPERVISOR")
     {
         frmCadProduto frm = new frmCadProduto();
         frm.lblTipoUsuario.Text   = lblUsuario.Text;
         frm.btnObterDados.Enabled = false;
         frm.MdiParent             = this;
         frm.Show();
     }
 }
 private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     try
     {
         DataGridViewRow dr = dataGridView1.SelectedRows[0];
         this.Hide();
         frmCadProduto frm = new frmCadProduto();
         frm.Show();
         frm.txtProdutoID.Text         = dr.Cells[0].Value.ToString();
         frm.txtNomeProduto.Text       = dr.Cells[1].Value.ToString();
         frm.txtCategoriaID.Text       = dr.Cells[2].Value.ToString();
         frm.comboBoxCategoria.Text    = dr.Cells[3].Value.ToString();
         frm.txtSubCategoriaID.Text    = dr.Cells[4].Value.ToString();
         frm.comboBoxSubCategoria.Text = dr.Cells[5].Value.ToString();
         frm.txtDescricao.Text         = dr.Cells[6].Value.ToString();
         frm.txtPreco.Text             = dr.Cells[7].Value.ToString();
         byte[]       data = (byte[])dr.Cells[8].Value;
         MemoryStream ms   = new MemoryStream(data);
         frm.pictureBox1.Image = Image.FromStream(ms);
         if (lblTipoUsuario.Text == "ADMIN")
         {
             frm.lblTipoUsuario.Text   = lblTipoUsuario.Text;
             frm.btnObterDados.Enabled = true;
             frm.btnAtualizar.Enabled  = true;
             frm.btnDeletar.Enabled    = true;
             frm.btnSalvar.Enabled     = false;
             frm.Show();
         }
         if (lblTipoUsuario.Text == "SUPERVISOR")
         {
             frm.lblTipoUsuario.Text   = lblTipoUsuario.Text;
             frm.btnObterDados.Enabled = false;
             frm.btnAtualizar.Enabled  = false;
             frm.btnDeletar.Enabled    = false;
             frm.btnSalvar.Enabled     = false;
             frm.txtNomeProduto.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 4
0
        private void sairToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmCategoria o1 = new frmCategoria();

            o1.Hide();
            frmSubCategoria o2 = new frmSubCategoria();

            o2.Hide();
            frmCadProduto o3 = new frmCadProduto();

            o3.Hide();
            frmRegistroUsuariosDetalhes o4 = new frmRegistroUsuariosDetalhes();

            o4.Hide();
            frmCadUsuario o5 = new frmCadUsuario();

            o5.Hide();
            frmProdutosRegistro2 o9 = new frmProdutosRegistro2();

            o9.Hide();
            frmVendasRegistro o10 = new frmVendasRegistro();

            o10.Hide();
            frmEstoqueInfo o11 = new frmEstoqueInfo();

            o11.Hide();
            frmLogin frm = new frmLogin();

            frm.NivelAcessoComboBox.SelectedIndex = -1;
            frm.txtUsuario.Text      = "";
            frm.txtSenha.Text        = "";
            frm.progressBar1.Visible = false;
            frm.NivelAcessoComboBox.Focus();
            frm.Show();
        }