first commit (2000-01-12)
This commit is contained in:
49
src/Unit2.cpp
Normal file
49
src/Unit2.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "Unit2.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma resource "*.dfm"
|
||||
TForm2 *Form2;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TForm2::TForm2(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
TbPrecios->Active = true;
|
||||
TbHistorial ->Active = true;
|
||||
Timer1->Enabled = true;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TForm2::Timer1Timer(TObject *Sender)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TForm2::TbHistorialAfterOpen(TDataSet *DataSet)
|
||||
{
|
||||
TbHistorial->First();
|
||||
while ( !TbHistorial->Eof )
|
||||
{
|
||||
|
||||
if ( TbHistorial->FieldByName("idtc")->AsInteger < 900 )
|
||||
{
|
||||
// Buscamos en la tabla de precios, al 1<> que tenga un tiempo superior o igual
|
||||
// al que nos pide el cliente...
|
||||
TbPrecios->First();
|
||||
while( !TbPrecios->Eof && (double)TbPrecios->FieldByName("Tiempo")->AsDateTime < (double)TbHistorial->FieldByName("Tiempo")->AsDateTime )//->Time )
|
||||
TbPrecios->Next();
|
||||
|
||||
TbHistorial->Edit();
|
||||
TbHistorial->FieldByName("Precio")->AsCurrency = TbPrecios->FieldByName("Precio")->AsCurrency;
|
||||
TbHistorial->Post();
|
||||
}
|
||||
|
||||
TbHistorial->Next();
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
Reference in New Issue
Block a user