客房管理系统能方便酒店进行日常客房服务管理,操作流程简单使用,方便建立酒店员工,客房,以及顾客之间的信息档案,进行日常消费管理. 系统采用目前先进的客户机/服务器结构,开发工具是美国BORLAND公司的C BUILDER 6。该开发工具以其优异的稳定性,强大的功能成为业界最先进的数据库开发工具,移植性好,灵活性强,开发效率高。数据库采用MS SQL SERVER2000企业版。
【相关图片】
void __fastcall TForm5::ListBox2Click(TObject *Sender)
{
switch(ListBox2->ItemIndex)
{
case 0:
{
DataModule1->roomQuery->SQL->Clear();
DataModule1->roomQuery->SQL->Add("Select * From Room");
DataModule1->roomQuery->ExecSQL();
DataModule1->roomQuery->Active=true;
TDataSet *roomSet=DataModule1->roomDataSource->DataSet;
ListView1->Clear();
for(i=0;i<DataModule1->roomQuery->RecordCount;i )
{
String caption=roomSet->Fields->FieldByName("RoomNo")->AsString;
TListItems *items=ListView1->Items;
TListItem *item=items->Add();
//TListItem *item=new TListItem(items);
item->Caption=caption;
if(roomSet->Fields->FieldByName("RoomState")->AsString=="空闲")
item->ImageIndex=1;
else if(roomSet->Fields->FieldByName("RoomState")->AsString=="维修")
item->ImageIndex=0;
else if(roomSet->Fields->FieldByName("RoomState")->AsString=="在住")
item->ImageIndex=2;
else
item->ImageIndex=3;
//items->AddItem(item,i);
//ListView1->Items->AddItem(item,i);
roomSet->Next();
}
}
break;
case 1:
{DataModule1->roomQuery->Active=true;
DataModule1->roomQuery->SQL->Clear();
DataModule1->roomQuery->SQL->Add("Select * From Room where RoomType='单人间'");
DataModule1->roomQuery->ExecSQL();
DataModule1->roomDataSource->DataSet->Open();
TDataSet *roomSet=DataModule1->roomDataSource->DataSet;
ListView1->Clear();
for(i=0;i<roomSet->RecordCount;i )
{
String caption=roomSet->Fields->FieldByName("RoomNo")->AsString;
TListItems *items=ListView1->Items;
TListItem *item=items->Add();
//TListItem *item=new TListItem(items);
item->Caption=caption;
if(roomSet->Fields->FieldByName("RoomState")->AsString=="空闲")
item->ImageIndex=1;
else if(roomSet->Fields->FieldByName("RoomState")->AsString=="维修")
item->ImageIndex=0;
else if(roomSet->Fields->FieldByName("RoomState")->AsString=="在住")
item->ImageIndex=2;
else
item->ImageIndex=3;
//items->AddItem(item,i);
//ListView1->Items->AddItem(item,i);
roomSet->Next();
}
}
break;
评论