Exemplo n.º 1
0
        private void btnVoltar_Click(object sender, EventArgs e)
        {
            this.Close();
            frmPerfilTec tec = new frmPerfilTec();

            tec.Show();
        }
Exemplo n.º 2
0
        private void btnEntrar_Click(object sender, EventArgs e)
        {
            dtovar.login = txtUser.Text;
            dtovar.senha = txtSenha.Text;



            try
            {
                List <usuarioDTO> ListDto = new List <usuarioDTO>();
                ListDto = new usuarioBLL().validar(dtovar);
                if (ListDto.Count > 0)
                {
                    information.id   = dtovar.id;
                    information.nome = dtovar.nome;
                    information.foto = dtovar.foto;
                    information.aula = dtovar.aula;
                    information.tipo = dtovar.tipo;



                    if (dtovar.tipo == 1)
                    {
                        frmPerfilProf prof = new frmPerfilProf();
                        prof.Show();
                        this.Hide();
                    }
                    else if (dtovar.tipo == 2)
                    {
                        frmPerfilTec prof = new frmPerfilTec();
                        prof.Show();
                        this.Hide();
                    }
                    else
                    {
                        frmPerfilAdm prof = new frmPerfilAdm();
                        prof.Show();
                        this.Hide();
                    }
                }
                else
                {
                    MessageBox.Show("Usuário, senha ou  incorretos", "Erro de autenticação", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtUser.Focus();
                    return;
                }
            }
            catch (Exception erro)
            {
                MessageBox.Show("Falha de conexão, entre em contato com o T.I.\n", "Falha de conexão", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtUser.Focus();
            }
        }