Пример #1
0
        //REVER
        public bool Autenticar(string login, string password)
        {
            Usuario user = dal.Autenticar(login, password);

            if (user == null)
            {
                return(false);
            }

            Parametros.UsuarioLogado = user;
            return(true);
        }
Пример #2
0
        protected void Entrar(object sender, EventArgs e)
        {
            try
            {
                String strEmail, strSenha;

                strEmail = txtEmail.Text.Replace("'", "");
                strSenha = txtSenha.Text.Replace("'", "");

                UsuarioDAL uDAL = new UsuarioDAL();
                uDAL.Autenticar(strEmail, strSenha);
            }
            catch (Exception)
            { throw; }
        }
Пример #3
0
        protected void Entrar(object sender, EventArgs e)
        {
            try
            {
                String strLogin, strSenha;

                strLogin = txtLogin.Text.Replace("'", "");
                strSenha = txtSenha.Text.Replace("'", "");

                UsuarioDAL usDAL = new UsuarioDAL();

                if (usDAL.Autenticar(strLogin, strSenha))
                {
                    Response.Redirect("Home/Default.aspx");
                }
                else
                {
                    Response.Write("<script language='JavaScript'>alert('Login ou senha incorretos');history.go(-1);</script>");
                }
            }
            catch (Exception)
            { throw; }
        }