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

#include <vcl.h>
#pragma hdrstop

#include "sCustomer.h"
#include "Customer.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TsCustomForm *sCustomForm;
//---------------------------------------------------------------------------
__fastcall TsCustomForm::TsCustomForm(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TsCustomForm::sModiBtClick(TObject *Sender)
{
        Query1->Close();
        Query1->SQL->Clear();
        Query1->SQL->Add("update point set name=:name, jumin=:jumin, point=:point, phone=:phone, indate=:indate where gbarcord=:gbarcord");
        Query1->ParamByName("gbarcord")->AsString = sBarEd->Text;
        Query1->ParamByName("name")->AsString = sNameEd->Text;
        Query1->ParamByName("jumin")->AsString = sJuminEd->Text;
        Query1->ParamByName("point")->AsInteger = StrToInt(sPointEd->Text);
        Query1->ParamByName("phone")->AsString = sPhonEd->Text;
        Query1->ParamByName("indate")->AsString = sIndateEd->Text;
        Query1->Prepare();
        if(Query1->Prepared)
                Query1->ExecSQL();

        TCustomerForm* parent = dynamic_cast<TCustomerForm*>(Owner);
        parent->ShBt->OnClick(this);
        Close();
}
//---------------------------------------------------------------------------

void __fastcall TsCustomForm::sBarEdKeyPress(TObject *Sender, char &Key)
{
        if(Key == 0x1b)//escŰ
        {
                Close();

        }        
}
//---------------------------------------------------------------------------

