#include "ShopForm.h"


using namespace ObjDataEdit;

//######################################################################################################
//主要需要繼承的涵式
ReaderClass< DB_GameObjDbStruct >* ShopForm::ObjReader( )
{
	return GameObjDbStructEx::ObjReader_Shop( );
}
void    ShopForm::OnActive()
{
	static bool firstTime = true;

	if( firstTime == false )
		return;

	firstTime = false;

	CB_PricesType1->Items->Clear();
	CB_PricesType2->Items->Clear();
	CB_PricesType3->Items->Clear();
	CB_PricesType4->Items->Clear();
	CB_PricesType5->Items->Clear();
	CB_PricesType6->Items->Clear();
	CB_PricesType7->Items->Clear();
	CB_PricesType8->Items->Clear();
	CB_PricesType9->Items->Clear();
	CB_PricesType10->Items->Clear();
	CB_PricesType11->Items->Clear();
	CB_PricesType12->Items->Clear();
	CB_PricesType13->Items->Clear();
	CB_PricesType14->Items->Clear();
	CB_PricesType15->Items->Clear();
	CB_PricesType16->Items->Clear();
	CB_PricesType17->Items->Clear();
	CB_PricesType18->Items->Clear();
	CB_PricesType19->Items->Clear();
	CB_PricesType20->Items->Clear();
	CB_PricesType21->Items->Clear();
	CB_PricesType22->Items->Clear();
	CB_PricesType23->Items->Clear();
	CB_PricesType24->Items->Clear();
	CB_PricesType25->Items->Clear();
	CB_PricesType26->Items->Clear();
	CB_PricesType27->Items->Clear();
	CB_PricesType28->Items->Clear();
	CB_PricesType29->Items->Clear();
	CB_PricesType30->Items->Clear();

	CB_PricesType2_1->Items->Clear();
	CB_PricesType2_2->Items->Clear();
	CB_PricesType2_3->Items->Clear();
	CB_PricesType2_4->Items->Clear();
	CB_PricesType2_5->Items->Clear();
	CB_PricesType2_6->Items->Clear();
	CB_PricesType2_7->Items->Clear();
	CB_PricesType2_8->Items->Clear();
	CB_PricesType2_9->Items->Clear();
	CB_PricesType2_10->Items->Clear();
	CB_PricesType2_11->Items->Clear();
	CB_PricesType2_12->Items->Clear();
	CB_PricesType2_13->Items->Clear();
	CB_PricesType2_14->Items->Clear();
	CB_PricesType2_15->Items->Clear();
	CB_PricesType2_16->Items->Clear();
	CB_PricesType2_17->Items->Clear();
	CB_PricesType2_18->Items->Clear();
	CB_PricesType2_19->Items->Clear();
	CB_PricesType2_20->Items->Clear();
	CB_PricesType2_21->Items->Clear();
	CB_PricesType2_22->Items->Clear();
	CB_PricesType2_23->Items->Clear();
	CB_PricesType2_24->Items->Clear();
	CB_PricesType2_25->Items->Clear();
	CB_PricesType2_26->Items->Clear();
	CB_PricesType2_27->Items->Clear();
	CB_PricesType2_28->Items->Clear();
	CB_PricesType2_29->Items->Clear();
	CB_PricesType2_30->Items->Clear();
	// 幣值設定
	sqlCommand_Base->CommandText = "Select Note from Table_SysKeyValue Where KeyStr LIKE 'SYS_PRICETYPE_ICONID_%' ORDER BY KeyStr";
	SqlDataReader* myReader= sqlCommand_Base->ExecuteReader();

	while( myReader->Read() )		
	{
		String* Str = myReader->GetString( 0 );
		CB_PricesType1->Items->Add( Str );
		CB_PricesType2->Items->Add( Str );
		CB_PricesType3->Items->Add( Str );
		CB_PricesType4->Items->Add( Str );
		CB_PricesType5->Items->Add( Str );
		CB_PricesType6->Items->Add( Str );
		CB_PricesType7->Items->Add( Str );
		CB_PricesType8->Items->Add( Str );
		CB_PricesType9->Items->Add( Str );
		CB_PricesType10->Items->Add( Str );
		CB_PricesType11->Items->Add( Str );
		CB_PricesType12->Items->Add( Str );
		CB_PricesType13->Items->Add( Str );
		CB_PricesType14->Items->Add( Str );
		CB_PricesType15->Items->Add( Str );
		CB_PricesType16->Items->Add( Str );
		CB_PricesType17->Items->Add( Str );
		CB_PricesType18->Items->Add( Str );
		CB_PricesType19->Items->Add( Str );
		CB_PricesType20->Items->Add( Str );		
		CB_PricesType21->Items->Add( Str );
		CB_PricesType22->Items->Add( Str );
		CB_PricesType23->Items->Add( Str );
		CB_PricesType24->Items->Add( Str );
		CB_PricesType25->Items->Add( Str );
		CB_PricesType26->Items->Add( Str );
		CB_PricesType27->Items->Add( Str );
		CB_PricesType28->Items->Add( Str );
		CB_PricesType29->Items->Add( Str );
		CB_PricesType30->Items->Add( Str );

		CB_PricesType2_1->Items->Add( Str );
		CB_PricesType2_2->Items->Add( Str );
		CB_PricesType2_3->Items->Add( Str );
		CB_PricesType2_4->Items->Add( Str );
		CB_PricesType2_5->Items->Add( Str );
		CB_PricesType2_6->Items->Add( Str );
		CB_PricesType2_7->Items->Add( Str );
		CB_PricesType2_8->Items->Add( Str );
		CB_PricesType2_9->Items->Add( Str );
		CB_PricesType2_10->Items->Add( Str );
		CB_PricesType2_11->Items->Add( Str );
		CB_PricesType2_12->Items->Add( Str );
		CB_PricesType2_13->Items->Add( Str );
		CB_PricesType2_14->Items->Add( Str );
		CB_PricesType2_15->Items->Add( Str );
		CB_PricesType2_16->Items->Add( Str );
		CB_PricesType2_17->Items->Add( Str );
		CB_PricesType2_18->Items->Add( Str );
		CB_PricesType2_19->Items->Add( Str );
		CB_PricesType2_20->Items->Add( Str );
		CB_PricesType2_21->Items->Add( Str );
		CB_PricesType2_22->Items->Add( Str );
		CB_PricesType2_23->Items->Add( Str );
		CB_PricesType2_24->Items->Add( Str );
		CB_PricesType2_25->Items->Add( Str );
		CB_PricesType2_26->Items->Add( Str );
		CB_PricesType2_27->Items->Add( Str );
		CB_PricesType2_28->Items->Add( Str );
		CB_PricesType2_29->Items->Add( Str );
		CB_PricesType2_30->Items->Add( Str );
	}
	myReader->Close();
	



	BaseForm::OnActive();

}
void    ShopForm::OnSelectObj( bool LockOk )
{
    //panel1->Enabled = LockOk;
    _ObjDB.GameData.Classification = EM_ObjectClass_Shop;
}
//輸出時額外設定
void    ShopForm::OnOutputObjSetting( DB_GameObjDbStruct* TempObj )
{
    TempObj->GameData.Classification = EM_ObjectClass_Shop;
}
void    ShopForm::OnTimeProc()
{

}

int     ShopForm::ObjSize(  )
{
    //int Size = sizeof( GameObjDbStruct );
    //Size = Size & 0xfffffC;
	GameObjDbStruct *P = NULL;
	int Size = sizeof( GameObjDbStruct ) - sizeof( P->Temp ) +  sizeof( P->Shop ) + 3;
	Size = Size & 0xfffffC;

	return Size;
    return Size;
}
void    ShopForm::OnValueChange( )
{
    DB_GameObjDbStruct __pin * TempObj = &_ObjDB;
    LB_SellItemID1 ->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[0] );
    LB_SellItemID2 ->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[1] );
    LB_SellItemID3 ->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[2] );
    LB_SellItemID4 ->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[3] );
    LB_SellItemID5 ->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[4] );
    LB_SellItemID6 ->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[5] );
    LB_SellItemID7 ->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[6] );
    LB_SellItemID8 ->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[7] );
    LB_SellItemID9 ->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[8] );
    LB_SellItemID10->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[9] );
    
    LB_SellItemID11->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[10] );
    LB_SellItemID12->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[11] );
    LB_SellItemID13->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[12] );
    LB_SellItemID14->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[13] );
    LB_SellItemID15->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[14] );
    LB_SellItemID16->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[15] );
    LB_SellItemID17->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[16] );
    LB_SellItemID18->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[17] );
    LB_SellItemID19->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[18] );
    LB_SellItemID20->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[19] );

    LB_SellItemID21->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[20] );
    LB_SellItemID22->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[21] );
    LB_SellItemID23->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[22] );
    LB_SellItemID24->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[23] );
    LB_SellItemID25->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[24] );
    LB_SellItemID26->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[25] );
    LB_SellItemID27->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[26] );
    LB_SellItemID28->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[27] );
    LB_SellItemID29->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[28] );
    LB_SellItemID30->Text = SearchObjName( TempObj->GameData.Shop.SellItemID[29] );



}
//######################################################################################################

