PDA

View Full Version : Ativar Login.dg



Benedito
12-Jun-2023, 11:02 AM
Pessoal, boa tarde.

Estou com dificuldade para resolver esta questão, quero ativar o Login.dg mas não estou conseguindo, abaixo segue parte do código, pode ser que eu esteja tentando ativar no lugar errado



Object oClientArea is a ClientArea
Use StdAbout.pkg
Use Login.dg
Use Cadastro_de_Usuarios.vw
Use Login.vw
Use Controle_do_Sistema.vw
Use Modulos.vw
Use Info.VW
Use MenuView.VW

Procedure Activate_About
Send DoAbout "" "" "" "" ""
End_Procedure

End_Object

End_Object
Send Activate_Login.dg (oClientArea(Self))
Start_UI

Samuel Pizarro
12-Jun-2023, 12:52 PM
Há muito tempo atras. na epoca do VDF 12 ainda... eu utilizava assim...



Object Client_Area is a AppClientArea


Use Dialogs\Login.dg




// LoginUser
Procedure LoginUser
Boolean bLoginOk
Handle hoClient

Get Client_Id to hoClient
Get Validate_UserInformation of (oUserPassword_dg (hoClient)) to bLoginOk
If (not (bLoginOk)) Begin
Abort
End
End_Procedure // LoginUser

Send LoginUser

Use ...
...


logicamente, o metodo Validate_UserInformation eh um metodo definido dentro da dg.. e a dg nao pode ser marcada como deferred..

[]'s
Samuel

Mike Peat
13-Jun-2023, 07:36 AM
Benedict

Instead of Send Activate_Login, just do: Send Login of oLogin, however I usually have Use Login.dg outside of the oClientArea, thus:



Use Login.dg

Object oMain is a Panel

oClientArea is a ClientArea
Use StdAbout.pkg
Use Cadastro_de_Usuarios .vw
Use System_Control.vw
Use Modules.vw
Use Info.VW
Use MenuView.VW

Procedure Activate_About
Send DoAbout "" "" "" "" ""
End_Procedure

End_Object

End_Object

//Send Activate_Login
Send Login of oLogin
Start_UI


So the way you have it you might need to do: Send Login of (oLogin(oClientArea(oMain)))

Mike

HeitorArgenta
29-Aug-2023, 04:05 PM
Eu uso assim:


Use Login.dg
Send Popup_Modal to oLogin