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

#include <vcl.h>
#pragma hdrstop

#include "selec.h"
#include "Datain.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TSelecForm *SelecForm;
//---------------------------------------------------------------------------
__fastcall TSelecForm::TSelecForm(TComponent* Owner)
    : TForm(Owner)
{
        SelSG->Cells[0][0]="바코드";
        SelSG->Cells[1][0]="상품명";
        SelSG->Cells[2][0]="규격";
        SelSG->Cells[3][0]="분류";
       // SelSG->Cells[4][0]="제조사";
        SelSG->Cells[4][0]="재고량";
        SelSG->Cells[5][0]="판매가";
        SelSG->Cells[6][0]="등록일";
}

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

void __fastcall TSelecForm::SelSGKeyPress(TObject *Sender, char &Key)
{
        if(Key == 0x1b)//esc키
        {
                TDataInForm* parent = dynamic_cast<TDataInForm*>(Owner);
                parent->DateP1->Date = Date();
                Close();

        }

        if( Key == 0x0D)
        {
                TDataInForm* parent = dynamic_cast<TDataInForm*>(Owner);
                parent->BarEdit->Text = SelSG->Cells[0][SelSG->Row];
                parent->BarEdit2->Text = SelSG->Cells[0][SelSG->Row];
                parent->GoodsEdit->Text = SelSG->Cells[1][SelSG->Row];
                parent->StdEdit->Text = SelSG->Cells[2][SelSG->Row];
                parent->GroupCmb->Text = SelSG->Cells[3][SelSG->Row];
                parent->StockEdit->Text = SelSG->Cells[4][SelSG->Row];
                parent->SpEdit->Text = SelSG->Cells[5][SelSG->Row];
                parent->DateP1->Date = SelSG->Cells[6][SelSG->Row];
                Close();
        }
}
//---------------------------------------------------------------------------


void __fastcall TSelecForm::SelSGDblClick(TObject *Sender)
{
        SelSG->OnKeyPress(this,0x0D);        
}
//---------------------------------------------------------------------------

