FAVOR AYUDA CON VALIDACION DE GET

FAVOR AYUDA CON VALIDACION DE GET

Postby remtec » Tue Oct 23, 2018 4:47 pm

Amigos

Muy buenas tardes.

Tengo un problema de validacion de 2 Get.
La Funcion Valida_usu() del Boton 604, debe validar que el Usuario y la Clave esten correcta, cuando existe error, las variables Cod_usu1, Cla_usu1, toman valor 1, cuando esta correcta, de lo contrario, devolvera valor 0.

Necesito que cuando Exista Error, muestre el Mensaje, de lo contrario, Cierre y deje el Dialog.
Asi como esta, se mantiene en los GETS, pidiendo datos.

Muchas gracias por su ayuda.

Atte. Antonio

Code: Select all  Expand view
           REDEFINE Get oCod_usu1 Var Cod_usu1 Id 110 Of oDlg Update Picture "@!" COLORS RGB( 9, 43, 47);
                Valid (!empty(Cod_usu1))
                REDEFINE Get oCla_usu1 Var Cla_usu1 Id 120 Of oDlg Update Picture "@!" COLORS RGB( 9, 43, 47);
                Valid (!empty(Cla_usu1))

            REDEFINE Button Id 605 Of oDlg Border ;
                ACTION (Ing_1:=0,Ing_2:=0,oDlg:End())        // Boton Salida

                REDEFINE Button Id 604 Of oDlg ;
                ACTION (Valida_usu(Cod_usu1,Cla_usu1),IF((Ing_1=0.or.Ing_2=0),(MsgStop(Mensa),.F.),.T.))           // Aqui Boton Acepta
 
FWH 22.10 - HARBOUR - PELLES C
remtec
 
Posts: 719
Joined: Fri May 12, 2017 2:50 pm

Re: FAVOR AYUDA CON VALIDACION DE GET

Postby armando.lagunas » Tue Oct 23, 2018 7:27 pm

Según entiendo tu consulta, yo lo haría así...

Code: Select all  Expand view


          REDEFINE Button Id 604 Of oDlg ;
           ACTION IF(!Valida_usu(Cod_usu1,Cla_usu1), ;
                          (MsgStop(Mensa), Ing_1:=0, Ing_2:=0, oDlg:End()) ;
                     , ( oDlg:End(), .T.) )           // Aqui Boton Acepta

 


la función Valida_usu debería devolver un .T. si esta correcto, .f. si esta mal el usuario.

si no te funciona coloca un poco mas de código para ver la lógica y ayudarte un poco mas.

Saludos.
SkyPe: armando.lagunas@hotmail.com
Mail: armando.lagunas@gmail.com
User avatar
armando.lagunas
 
Posts: 346
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile

Re: FAVOR AYUDA CON VALIDACION DE GET

Postby remtec » Tue Oct 23, 2018 7:49 pm

Armando

Muchas gracias por tu ayuda.

Le hice una modificación y ahora funciona muy bien.

Te muestro como deje el codigo:

Atte.

Antonio

Code: Select all  Expand view
REDEFINE Button Id 604 Of oDlg ;
              ACTION IF(!Valida_usu(Cod_usu1,Cla_usu1),(MsgStop(Mensa), Ing_1:=0, Ing_2:=0,.F.), ( oDlg:End(), .T.) )           // Aqui Boton Acepta
 
FWH 22.10 - HARBOUR - PELLES C
remtec
 
Posts: 719
Joined: Fri May 12, 2017 2:50 pm

Re: FAVOR AYUDA CON VALIDACION DE GET

Postby armando.lagunas » Tue Oct 23, 2018 8:04 pm

:D :D
SkyPe: armando.lagunas@hotmail.com
Mail: armando.lagunas@gmail.com
User avatar
armando.lagunas
 
Posts: 346
Joined: Mon Oct 05, 2009 3:35 pm
Location: Curico-Chile


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests