First commit 16/08/1996
This commit is contained in:
93
Builder/agenda/diario.cpp
Normal file
93
Builder/agenda/diario.cpp
Normal file
@ -0,0 +1,93 @@
|
||||
//---------------------------------------------------------------------------
|
||||
#include <vcl\vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "agenda.h"
|
||||
#include "busqueda.h"
|
||||
#include "diario.h"
|
||||
#include "dos.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma resource "*.dfm"
|
||||
TForm6 *Form6;
|
||||
int busca;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TForm6::TForm6(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm6::Button1Click(TObject *Sender)
|
||||
{
|
||||
Table1->FieldValues["Fecha"] = fecha;
|
||||
Table1->Post();
|
||||
Table1->Insert();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm6::Button3Click(TObject *Sender)
|
||||
{
|
||||
Table1->Prior();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm6::Button2Click(TObject *Sender)
|
||||
{
|
||||
Table1->Edit();
|
||||
Table1->Delete();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm6::Button5Click(TObject *Sender)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm6::Button4Click(TObject *Sender)
|
||||
{
|
||||
TForm4 *Busqueda;
|
||||
Busqueda = new TForm4(this);
|
||||
busca = 0;
|
||||
Busqueda->Table1->TableName = "agenda.db";
|
||||
Busqueda->Table1->Active=true;
|
||||
Busqueda->ShowModal();
|
||||
delete Busqueda;
|
||||
Table1->First();
|
||||
Table1->MoveBy(direccion);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm6::Button6Click(TObject *Sender)
|
||||
{
|
||||
Table1->Next();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm6::FormClose(TObject *Sender, TCloseAction &Action)
|
||||
{
|
||||
if(Table1->State == dsInsert && DBMemo1 -> Modified )
|
||||
{
|
||||
switch(MessageBox(Handle,"No guard<72> los datos <20>Desea Guardarlos?", "Atenci<EFBFBD>n" ,MB_YESNOCANCEL))
|
||||
{
|
||||
case 6:
|
||||
Table1->Post();
|
||||
break;
|
||||
|
||||
default:
|
||||
Table1->Cancel();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm6::Table1NewRecord(TDataSet *DataSet)
|
||||
{
|
||||
/* TLocateOptions SearchOptions;
|
||||
SearchOptions << loPartialKey;
|
||||
if(Table1->Locate("Fecha",Table1->FieldValues["Fecha"],SearchOptions)==true)
|
||||
{
|
||||
ShowMessage("Esta referencia ya existe");
|
||||
Table1->Cancel();
|
||||
}*/
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TForm6::FormCreate(TObject *Sender)
|
||||
{
|
||||
Table1->Insert();
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
Reference in New Issue
Block a user