/*
* Proyecto: Ventas
* Fichero: PolizaContado.prg
* Descripción:
* Autor:
* Fecha: 06-21-2006
*/
#include "Xailer.ch"
#include 'Ado.ch'
CLASS TPolizaContado FROM TForm
COMPONENT oPanel1
COMPONENT oLabelFecha
COMPONENT oFECHA
COMPONENT oLabel2
COMPONENT oMaskEdit1
COMPONENT oSplitter1
COMPONENT oPanel2
COMPONENT oSplitter2
COMPONENT oDATA
COMPONENT oBrowseVendet
COMPONENT oPanel3
COMPONENT oBtnProcesar
COMPONENT oBtnNuevaConsulta
COMPONENT oPanel4
COMPONENT oBevel1
COMPONENT oMensaje
DATA oDataSet
METHOD CreateForm()
METHOD FormInitialize( oSender )
METHOD FECHAExit( oSender, oNextCtl )
METHOD FormClose( oSender, @lClose )
METHOD BtnProcesarClick( oSender )
METHOD BtnNuevaCons( oSender )
METHOD UpdLabel()
ENDCLASS
#include "PolizaContado.xfm"
//---------------------------------------------------------- --------------------
METHOD FormInitialize( oSender ) CLASS TPolizaContado
RETURN Nil
//---------------------------------------------------------- --------------------
METHOD FECHAExit( oSender, oNextCtl ) CLASS TPolizaContado
RETURN Nil
//---------------------------------------------------------- --------------------
METHOD FormClose( oSender, lClose ) CLASS TPolizaContado
::oDATA:lConnected:=.f.
::OBrowseVendet:oDataSet:End()
::OBrowseVendet:oDataSet:=NIL
RETURN Nil
//---------------------------------------------------------- --------------------
METHOD BtnProcesarClick( oSender ) CLASS TPolizaContado
local cTable
local nFor
::oDATA:lConnected := !::oDATA:lConnected
if ::oDATA:lConnected
::oBtnProcesar:lEnabled:=.f.
::oBtnNuevaConsulta:lEnabled:=.t.
endif
cTable := 'Vendet'
with object ::oMensaje
:cText := "Leyendo Datos de Base de Datos, Favor de esperer... "
end with
if ::oBrowseVendet:oDataSet != nil
::oBrowseVendet:oDataSet:End()
::oBrowseVendet:oDataSet := nil
endif
If " " $ cTable
::oDataSet := ::oDATA:NewDataSet( "Select * from [" + cTable + "]" )
else
::oDataSet := ::oDATA:NewDataSet( "Select * from " + cTable + " where
fechavtasinhora='12/01/2005'" )
Endif
with object ::oDataSet
:lAsynFetch :=.F. // ::oChkAsyn:lChecked
:OnComplete := {|| ::UpdLabel() }
:Open()
end with
with object ::oBrowseVendet
:oDataSet := ::oDataSet
end with
* MSGINFO(::oDATASET:cNAME)
RETURN Nil
//---------------------------------------------------------- --------------------
METHOD BtnNuevaCons( oSender ) CLASS TPolizaContado
::oDATA:lConnected := !::oDATA:lConnected
if ::oBrowseVendet:oDataSet != nil
::oBrowseVendet:oDataSet:End()
::oBrowseVendet:oDataSet := nil
::oMensaje:cText := ""
::oBtnProcesar:lEnabled:=.t.
::oBtnNuevaConsulta:lEnabled:=.f.
::oFecha:SetFocus()
endif
RETURN Nil
//---------------------------------------------------------- --------------------
METHOD UpdLabel() CLASS TPolizaContado
local aKeys
local cKeys := ""
local n
with object ::oMensaje
:cText := "Registros Leidos " + ltrim( Transform(
::oDataSet:RecCount(), "999,999,999" ) ) + " con " +;
ltrim( Str( Len( ::oDataSet:aFields ) ) ) +" Campos. (" + ;
ltrim( Transform( ::oDataSet:RecCount() * Len(
::oDataSet:aFields ), "9,999,999" ) ) + ;
" values)"
end with
aKeys := ::oDataSet:GetPrimaryKeys()
For n := 1 to Len( aKeys )
cKeys += aKeys[ n ]
if n < Len( aKeys )
cKeys += " , "
endif
Next
If Empty( cKeys )
cKeys := "[Sin definir o inaccesible]"
Endif
* ::oEdiPrKey:Value := cKeys
RETURN nil
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Error en ODBC ( Faltaba el PRG)
-
- Mensajes: 114
- Registrado: Dom Dic 18, 2005 7:50 pm