Anexo Codigo
- Code: Select all Expand view RUN
Static Function vl_comb(vlco1,aCamp,cQue1,cQue2)
if vlco1="Codigo Cuenta"
vlco1:="cod_cta"
cQue1 := cQue2+" WHERE COD_CTA LIKE '"+ALLTRIM(aCamp)+"%' ORDER BY COD_CTA"
endif
if vlco1="Nombre Cuenta"
vlco1:="cue_desc"
cQue1 := cQue2+" WHERE CUE_DESC LIKE '"+ALLTRIM(aCamp)+"%' ORDER BY COD_CTA"
endif
if aCamp = " "
cQue1 := cQue2+" WHERE COD_CTA ORDER BY COD_CTA"
endif
Return cQue1
Static Function CUE_BROW(xnr)
Local oLbx,oCol,oFon1,oDlgbrow,nBookMarkoKSalir,oKejec,oDatos,cQue1,cQue2,vlco1,vlco2,vlco3,vlco4
Local nRow,nCol,oChild,nFor,oLamcla,aCamp,eCamp,cCmB,;
aItens := {'Codigo Cuenta','Nombre Cuenta'}
aCamp := space(30)
cCmB := "Codigo Cuenta"
DEFINE FONT aFont[ 1 ] NAME "Arial" SIZE 0, -12
DEFINE BRUSH aBrush[ 1 ] NAME "STONE"
DEFINE BRUSH aBrush[ 2 ] NAME "PAPER" //RESOURCE "PAPER"
DEFINE FONT oFnt01 NAME "Arial" size 07,14 BOLD //times new roman //DIALOG
//select * from ccuentas where cod_cta LIKE "14%"
cQue1 := "SELECT * FROM ccuentas ORDER BY COD_CTA"
cQue2 := "SELECT * FROM ccuentas "
vlco1:=" "
if !aContl[20]
else
ADO SELECT ccuentas
if oRecordSet[nRecordSet]:RecordCount() =0 //ADORecCount()
MsgInfo("No Hay Datos ","Informacion") // MsgAlert( "No Hay Datos ","Informacion" )
Return (.t.)
endif
EjeQueri(0,@oDatos,cQue1)
endif
DEFINE DIALOG oDlgbrow RESOURCE "BROW_BUSQ" TITLE OemToAnsi("Consulta General");
COLOR RGB(255,255,255),X_VENTDG2 //STYLE nOR(WS_MINIMIZEBOX) //Brush aBrush[ 1 ]
REDEFINE SAY oSay ID 101 OF oDlgbrow FONT oFnt01 COLORS MEMVAR->X_SAYTEXT,MEMVAR->X_SAYFOND;oSay:lTransparent = .T.
REDEFINE SAY oSay ID 102 OF oDlgbrow FONT oFnt01 COLORS MEMVAR->X_SAYTEXT,MEMVAR->X_SAYFOND;oSay:lTransparent = .T.
REDEFINE GET eCamp VAR aCamp ID 202 OF oDlgbrow MESSAGE "Ingrese Datos " UpDate //--> nº Chq
REDEFINE COMBOBOX cCmb Items aItens ID 201 OF oDlgbrow MESSAGE "Seleccione Criterio de Busqueda "
REDEFINE BUTTONBMP oKSalir ID IDCANCEL OF oDlgbrow ACTION ( oDlgbrow:End() ) ;
PROMPT "Salir del Formulario" TEXTRIGHT TOOLTIP "Salir del Formulario"
REDEFINE BUTTONBMP oKejec ID IDOK OF oDlgbrow ;
ACTION ( vl_comb(cCmb,aCamp,@cQue1,cQue2),EjeQueri(1,@oDatos,cQue1,oLbx,oDlgBrow ) );
PROMPT "Ejecuta Consulta" TEXTRIGHT TOOLTIP "Ejecuta Consulta"
eCamp:cToolTip := OemToAnsi( "Ingrese Dato " )
if !aContl[20]
REDEFINE XBROWSE oLbx ;
COLUMNS "cod_cta", "cue_desc";
HEADERS "Codigo", "Nombre";
PICTURES nil, nil ;
COLSIZES 80, 480 ;
JUSTIFY .F., .F. ;
OF oDlgbrow ID 4001 ;
Alias "b_cueputt" //OBJECT oTabla tambien funciona
par_browse("3",oLbx,aContl[20],0,oTipmod)
else
REDEFINE XBROWSE oLbx ;
COLUMNS "cod_cta", "cue_desc";
HEADERS "Codigo", "Nombre";
PICTURES nil, nil ;
COLSIZES 80, 480 ;
JUSTIFY .F., .F. ;
OF oDlgbrow ID 4001 ;
RECORDSET oDatos
par_browse("3",oLbx,aContl[20],0,oDatos)
// oBrw:bGoTop := {|| rs:moveFirst() }
// oBrw:bGoBottom := {|| rs:moveLast() }
// oBrw:bSkip := {| n | rsSkipper( n, rs ) }
// oBrw:bBof := {|| rs:Bof() }
// oBrw:bEof := {|| rs:Eof() }
// oBrw:bBookMark := {| bmNew | IIF( bmNew == NIL, rs:bookMark, rs:bookMark := bmNew) }
// oBrw:bKeyNo := {|| rs:AbsolutePosition }
// oBrw:bKeyCount := {|| rs:RecordCount() }
oLbx:bLDblClick := { || LOF_REGS(oDatos,oDlgbrow,xnr) }
Endif
if memvar->x_brom2007;oLbx:l2007 := .T.;else;oLbx:l2007 := .F.;endif
oLbx:nFreeze:=1 // para congelar la 1ª
oLbx:lAllowColSwapping := .F. //-----> Trocar Colunas ,Para no permitir swap entre colrefcatnas
oLbx:lAllowRowSizing := .F. //-----> Nao move as Linhas
AEval( oLbx:aCols, { |o| o:lAllowSizing := .f. } )
ACTIVATE DIALOG oDlgBrow CENTERED VALID NoSalir() ON INIT Init01( oDlgBrow ) // ON INIT ( Eval(aBlock),dbgotop())
ADO SELECT krefcate
Return Nil