Esempio n. 1
0
        private void btVoltar_Click(object sender, EventArgs e)
        {
            TelaInicial ti = new TelaInicial();

            this.Hide();
            ti.Show();
        }
Esempio n. 2
0
        private void button4_Click(object sender, EventArgs e)
        {
            TelaInicial tl_ini = new TelaInicial();

            tl_ini._nomeBD = banco_de_dados;
            tl_ini.Show();
            this.Hide();
        }
Esempio n. 3
0
        private void dg_banco_de_dados_presentes_DoubleClick(object sender, EventArgs e)
        {
            Infos.ConectionString = "Persist Security Info=False;server=" + tb_servidor.Text + ";Port=" + tb_porta.Text + ";database=" + dg_banco_de_dados_presentes.CurrentCell.Value.ToString() + ";uid=" + tb_usuario.Text + ";pwd=" + tb_senha.Text + "";

            TelaInicial tl_ini = new TelaInicial();

            tl_ini._nomeBD = dg_banco_de_dados_presentes.CurrentCell.Value.ToString();
            tl_ini.Show();
            this.Close();
        }
Esempio n. 4
0
        private void btnCadastrar_Click(object sender, RoutedEventArgs e)
        {
            FuncionarioBean bean = new FuncionarioBean();

            bean.Nome      = txtNome.Text;
            bean.Re        = txtRE.Text;
            bean.Senha     = Encriptografar.Encripto(pswSenha.Password);
            bean.Permissao = permissao;
            FuncionarioDAO.CadastrarFuncionario(bean);
            this.Close();
            TelaInicial telaInicial = new TelaInicial();

            telaInicial.Show();
        }
Esempio n. 5
0
        private void Entrar_MouseDown(object sender, MouseButtonEventArgs e)
        {
            var sup   = cbb_Usuario.SelectedItem.ToString();
            var senha = "1234";

            if (String.Equals(sup, "System.Windows.Controls.ComboBoxItem: SUPERVISOR"))
            {
                if (txb_Senha.Password.Equals(senha))
                {
                    TelaInicial tela = new TelaInicial();
                    tela.Show();
                    Close();
                }
                else
                {
                    MessageBox.Show("Senha Incorreta", "Atenção");
                }
            }
        }
Esempio n. 6
0
        private void btnEntrar_Click(object sender, EventArgs e)
        {
            //IServicoRepositorio _servicoRepositorio;
            //string usuario = "admin";
            //string senha = "123";
            //if (txtUsuario.Text == usuario && txtSenha.Text == senha)
            //{
            ServicoService _service;

            _service = new ServicoService(null);
            TelaInicial inicial = new TelaInicial(_service);

            inicial.Show();
            this.Hide();
            //}
            //else
            //{
            //    MessageBox.Show("Login Incorreto!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //}
        }
Esempio n. 7
0
        public void RealizaLogin(string username, string password, string senhaRepetida)
        {
            tB_USUARIO.nm_nome_usuario = username;
            tB_USUARIO.ds_senha        = password;
            try
            {
                using (db_peixesEntities DB = new db_peixesEntities())
                {
                    if (username != String.Empty || password != String.Empty || senhaRepetida != String.Empty)
                    {
                        if (password == senhaRepetida)
                        {
                            // Retorna true or false caso dado exita ou nao
                            var result = DB.TB_USUARIO.Any(x => x.nm_nome_usuario == username && x.ds_senha == password);

                            if (result == true)
                            {
                                TelaInicial tela1 = new TelaInicial(username);
                                tela1.Show();
                            }
                            else
                            {
                                MessageBox.Show($"Usuario {username} não existe, se cadastre", "Usuario não existe", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            }
                        }
                        else
                        {
                            MessageBox.Show("As senhas não são iguais", "Senhas diferentes", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Alguns Campos estão vazios", "Campos Vazios", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            } catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 8
0
        private void realizarLogin()
        {
            string          loginInserido    = this.metroTextBoxUser.Text.ToLower();
            string          passwordInserido = this.metroTextBoxSenha.Text;
            LoginController loginController  = new LoginController();

            loginController.verificaUsuarioSenha(loginInserido, passwordInserido);

            if (Globals.tipoDeUsuario.Equals("user-comum") || Globals.tipoDeUsuario.Equals("administrador-comum") || Globals.tipoDeUsuario.Equals("administrador-geral"))
            {
                TelaInicial telaInicial = new TelaInicial();
                telaInicial.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Senha ou usuários incorretos, por favor, tente novamente.", "Login falhou", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.metroTextBoxUser.Text  = "";
                this.metroTextBoxSenha.Text = "";
                this.ActiveControl          = this.metroTextBoxUser;
            }
        }
Esempio n. 9
0
        private void button1_Click(object sender, EventArgs e)
        {
            FuncionarioModel funcionario = new FuncionarioModel();

            funcionario.Login = lb_login.Text.ToString();
            funcionario.Senha = lb_senha.Text.ToString();

            UsuarioController usuario = new UsuarioController();

            if (usuario.verificaUsuarioBanco(funcionario.Login, funcionario.Senha))
            {
                funcionario = usuario.usuarioLogado(funcionario.Login, funcionario.Senha);
                MessageBox.Show("Efetuado logon com sucesso");
                TelaInicial telainicial = new TelaInicial(funcionario.Nome);
                this.Hide();
                telainicial.Show();
            }
            else
            {
                MessageBox.Show("Não foi possivel efetuar o logon. Verifique o login e a senha.");
            }
        }