first commit (2002-04-24)
This commit is contained in:
38
cap_gestion/capg_tarifas.cpp
Normal file
38
cap_gestion/capg_tarifas.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "capg_tarifas.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma resource "*.dfm"
|
||||
TfTarifas *fTarifas;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TfTarifas::TfTarifas(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
TbPrecios->Active = true;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TfTarifas::TbPreciosBeforeOpen(TDataSet *DataSet)
|
||||
{
|
||||
// Si la tabla no existe, la creamos
|
||||
if ( !FileExists(TbPrecios -> TableName ) )
|
||||
{
|
||||
// Usamos la propiedad FielDefs para definir
|
||||
// las columnas que contendr<64> la tabla
|
||||
TbPrecios -> FieldDefs -> Clear();
|
||||
|
||||
TbPrecios -> FieldDefs -> Add("Tiempo", ftInteger, 0, false );
|
||||
TbPrecios -> FieldDefs -> Add("Precio", ftCurrency, 0, false );
|
||||
|
||||
TbPrecios -> IndexDefs -> Clear();
|
||||
TbPrecios -> IndexDefs -> Add("Primary", "Tiempo", TIndexOptions() << ixPrimary << ixUnique );
|
||||
// Creamos la base...
|
||||
TbPrecios -> CreateTable();
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user