//---------------------------------------------------------------------------

#include <fmx.h>
#pragma hdrstop

#include "uMainForm.h"
#include "udmFireDACInsertData.h"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm7 *Form7;
//---------------------------------------------------------------------------
__fastcall TForm7::TForm7(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------

void TForm7::ShowRunTime(TEdit* pEdit, long lTime)
{
  pEdit->Text = FloatToStr(lTime / 1000.0) + "¬í";
}

void __fastcall TForm7::btnInsertWithQueryClick(TObject *Sender)
{
  lStart = GetTickCount();
  DataModule1->InsertDataWithQuery(StrToInt(edtLoops->Text));
  lEnd = GetTickCount();
  ShowRunTime(edtWithQuery, lEnd - lStart);
  DataModule1->qryTestData->Refresh();
}
//---------------------------------------------------------------------------

void __fastcall TForm7::btnInsertWithDMLClick(TObject *Sender)
{
  lStart = GetTickCount();
  DataModule1->InsertDataWithDML(StrToInt(edtLoops->Text));
  lEnd = GetTickCount();
  ShowRunTime(edtWithDML, lEnd - lStart);
  DataModule1->qryTestData->Refresh();
}
//---------------------------------------------------------------------------

