#include "TOTVS.CH"
User Function ADUserValid()
DEFINE DIALOG oDlg TITLE "Exemplo ADUserValid" FROM 180,180 TO 450,600 PIXEL
cTGetDomain := space(40)
cTGetUser := space(40)
cTGetPassword := space(40)
oSayDomain:= TSay():New(13,01,{||'Domínio:'},oDlg,,,,,,.T.,CLR_RED,CLR_WHITE,200,7)
oTGetDomain := TGet():New( 20,01,{|x| If(Pcount()>0, cTGetDomain:= x, cTGetDomain)},oDlg,096,009,"",,0,,,.F.,,.T.,,.F.,,.F.,.F.,,.F.,.F.,,cTGetDomain,,,,)
oSayUser:= TSay():New(35,01,{||'Usuário:'},oDlg,,,,,,.T.,CLR_RED,CLR_WHITE,200,7)
oTGetUser := TGet():New( 42,01,{|x| If(Pcount()>0, cTGetUser:= x, cTGetUser)},oDlg,096,009,"",,0,,,.F.,,.T.,,.F.,,.F.,.F.,,.F.,.F.,,cTGetUser,,,,)
oSayPassword:= TSay():New(56,01,{||'Senha:'},oDlg,,,,,,.T.,CLR_RED,CLR_WHITE,200,7)
oTGetPassword := TGet():New( 63,01,{|x| If(Pcount()>0, cTGetPassword:= x, cTGetPassword)},oDlg,096,009,"",,0,,,.F.,,.T.,,.F.,,.F.,.F.,,.F.,.T.,,cTGetPassword,,,,)
oTButtonLogin1 := TButton():New( 82, 01, "Login",oDlg,{|| alert(ADUserValid(alltrim(cTGetDomain), alltrim(cTGetUser), alltrim(cTGetPassword))) },96,10,,,.F.,.T.,.F.,,.F.,,,.F. )
ACTIVATE DIALOG oDlg CENTERED
return