private bool DoesUserExist(string email) { UsersDb _usersDb = new UsersDb(); Users user = _usersDb.GetUserByEmail(email); if (user.Id == 0) { return(false); } else { return(true); } }
private void VerifyAccount(string emailAddress, string password) { UsersDb usersDb = new UsersDb(); Users user = usersDb.GetUserByEmail(emailAddress); if (user.Id != 0) { if (user.Password == password) { Session["LoggedIn"] = user.Id; Response.Redirect("~/Index.aspx"); } else { this.error.Visible = true; this.error.InnerText = "Password is incorrect"; } } }