private void abrirTelaInicial() { telaInicial objTela = new telaInicial(); objTela.MdiParent = telaFundo.ActiveForm; objTela.Show(); }
private void btnLogin_Click(object sender, EventArgs e) { try { if (txtUsuario.Text.Equals("")) { MessageBox.Show("Preencha o campo usuário", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (txtSenha.Text.Equals("")) { MessageBox.Show("Preencha o campo senha", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (txtUsuario.Text != "adminceb" || txtSenha.Text != "anchor3128") { MessageBox.Show("Usuário ou senha incorretos!", "Informação", MessageBoxButtons.OK, MessageBoxIcon.Error); txtSenha.Clear(); } else { telaInicial tela = new telaInicial(); tela.menuCriarCategoria.Visible = true; tela.menuRemoverCategoria.Visible = true; tela.MdiParent = telaFundo.ActiveForm; //tela.Show(); telaInicial.adm = true; this.Close(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Informação", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void RedefinirListaCategorias() { telaInicial tela = new telaInicial(); if (telaInicial.adm == true) { tela.menuCriarCategoria.Visible = true; tela.menuRemoverCategoria.Visible = true; } }
private void telaAdministrador_FormClosing(object sender, FormClosingEventArgs e) { telaInicial objTela = new telaInicial(); objTela.MdiParent = telaFundo.ActiveForm; objTela.Show(); if (telaInicial.adm == true) { objTela.menuCriarCategoria.Visible = true; objTela.menuRemoverCategoria.Visible = true; } }
private void ReabrirListaCategorias() { telaInicial tela = new telaInicial(); tela.MdiParent = telaFundo.ActiveForm; tela.Show(); listaAux0.Clear(); listaAux1.Clear(); listaAux2.Clear(); listaImagens.Clear(); listaRandom.Clear(); if (telaInicial.adm == true) { tela.menuCriarCategoria.Visible = true; tela.menuRemoverCategoria.Visible = true; } }