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

#include <vcl.h>
#pragma hdrstop

#include "PridejBT_PNP.h"
#include "Katalog.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TfrmPridejBT_PNP *frmPridejBT_PNP;
//---------------------------------------------------------------------------
__fastcall TfrmPridejBT_PNP::TfrmPridejBT_PNP(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TfrmPridejBT_PNP::btnKonecBT_PNPClick(TObject *Sender)
{
frmPridejBT_PNP -> Close();         
}
//---------------------------------------------------------------------------
void __fastcall TfrmPridejBT_PNP::btnPridejBT_PNPClick(TObject *Sender)
{
AnsiString a,b,c,d,e,f,g;
a = Edit1BT_PNP -> Text;
b = Edit2BT_PNP -> Text;
c = Edit3BT_PNP -> Text;
d = Edit4BT_PNP -> Text;
e = Edit5BT_PNP -> Text;
f = Edit6BT_PNP -> Text;
g = Memo1BT_PNP -> Text;
AnsiString i = {"PNP"};


Form1 -> Query1 -> SQL -> Clear();
Form1 -> Query1 -> SQL -> Add("INSERT INTO Bipolarni_tranzistory VALUES ('"+a+"', "+b+", "+c+", "+d+", "+e+", "+f+",'"+g+"', '"+i+"')");
Form1 -> Query1 -> ExecSQL();


Form1 ->Query1 -> SQL -> Clear();
Form1 ->Query1 -> SQL -> Add("SELECT Nazev_soucastky FROM Bipolarni_tranzistory WHERE Polarita = 'PNP'");
Form1 ->Query1 -> Open();

Form1->DBListBox1->Items->Clear();
Form1->DataSource1->DataSet->FindFirst();
  do
      {
Form1->DBListBox1->Items->Add(Form1->DataSource1->DataSet->FieldByName("Nazev_soucastky")->AsString);
Form1->DataSource1->DataSet->Next();
      }
  while (!Form1->DataSource1->DataSet->Eof);
   
}
//---------------------------------------------------------------------------
