vendredi 24 février 2017

asp.net Logic to check if user already exist

Hello Guys i'm have code this to check if user already exists but is not working and i don't have much knowledge to troubleshoot this.

Below i have a fuction if then if them else for some reason system is jumping function "

if Cadastrar_CodEmpresa = verificar("Usuario")
Then Response.Redirect("index.asp?pagina=login")"

if request.Form("commentForm") = "sim"   Then
set verificar = conexao.execute ("select * from empresas")

Cadastrar_CodEmpresa = request.Form("CodEmpresa")
Cadastrar_Segmento = request.Form("Segmento")
Cadastrar_Endereco = request.Form("Endereco")
Cadastrar_Bairro = request.Form("Bairro")
Cadastrar_Cidade = request.Form("Cidade")
Cadastrar_CEP = request.Form("CEP")
Cadastrar_Pais = request.Form("Pais")
Cadastrar_Contato = request.Form("Contato")
Cadastrar_Telefone = request.Form("Telefone")
Cadastrar_Email = request.Form("email")

 if Cadastrar_CodEmpresa = verificar("Usuario")  Then
              response.Redirect("index.asp?pagina=login")

    Else

        set cadastrar_cadastro = conexao.execute("insert into Empresas (Usuario) Values ('" & Cadastrar_CodEmpresa & "')")

    End if

Aucun commentaire:

Enregistrer un commentaire