private void FrmPrincipal_Load(object sender, EventArgs e) { login = new FormLogin_BLL(); visivel(false); try { String nivel = login.getNivelFuncionario(); if (nivel.Equals("1")) { btnGerencia.Visible = false; } lblFuncionario.Text = login.getNomeFuncionario(); stsData.Text = DateTime.Now.ToLongDateString(); atualizarGrid(); formataGrid(); } catch (Exception erro) { MessageBox.Show(erro.Message); } }
private void btnLogin_Click(object sender, EventArgs e) { bll = new FormLogin_BLL(); try { if (bll.loginBLL(txtUsuario.Text, txtSenha.Text)) { FrmSplashScreen splash = new FrmSplashScreen(); splash.Show(); this.Hide(); } else { MessageBox.Show("Usuario e/ou senha incorreto"); } } catch (Exception ex) { MessageBox.Show("Erro: " + ex); } }