procedure TDMForm.trvAllResChange(Sender: TObject; Node: TTreeNode);
var
strFloorID, strRoomID: string;begin case Node.Level of
0:
begin
dmData.adodmBed.SQL.Clear;
BRMResourceDM.aqRes.Open;
if pgcDMMain.ActivePage = TabSheet2 then
begin
with dmData.adodmBed do
begin
Close;
SQL.Clear;
SQL.Add('select * from dmBed where');
SQL.Add('RoomID is not null');
ChangeCondition;
SQL.Add(strCondition);
Open;
end;
end;
end;
1:
begin
dmData.adodmBed.SQL.Clear;
BRMResourceDM.aqFloor.Close;
BRMResourceDM.aqAllRes.GotoBook(Node.data);
BRMResourceDM.aqFloor.Parameters.ParamByName('ResID').Value :=BRMResourceDM.aqAllRes.FieldByName('ResID').value;
BRMResourceDM.aqFloor.Open; if pgcDMMain.ActivePage = TabSheet2 then
begin
with dmData.adodmBed do
begin
Close;
SQL.Clear;
SQL.Add('select * from dmBed where');
SQL.Add('RoomID like ''' + BRMResourceDM.aqAllRes.FieldByName('ResID').AsString + '%''');
ChangeCondition;
SQL.Add(strCondition);
Open;
end;
end; end;
2:
begin
dmData.adodmBed.SQL.Clear;
BRMResourceDM.aqRoom.Close;
BRMResourceDM.aqAllRes.GotoBook(Node.data);
BRMResourceDM.aqRoom.Parameters.ParamByName('FloorID').Value :=BRMResourceDM.aqAllRes.FieldByName('FloorID').value;
BRMResourceDM.aqRoom.Open; if pgcDMMain.ActivePage = TabSheet2 then
begin
with dmData.adodmBed do
begin
Close;
SQL.Clear;
SQL.Add('select * from dmBed where');
SQL.Add('RoomID like ''' + BRMResourceDM.aqAllRes.FieldByName('FloorID').AsString + '%''');
ChangeCondition;
SQL.Add(strCondition);
Open;
end;
end; end;
3:
begin
BRMResourceDM.aqAllRes.GotoBook(Node.Parent.Data);
strRoomNum := Node.Text;
strFloorName := Node.Parent.Parent.Text;
strFloorID :=BRMResourceDM.aqAllRes.FieldByName('FloorID').value; //找到父结点的FloorID
strRoomID := strFloorID + Node.Text; //求得房间结点的RoomID
with dmData.adodmBed do
begin
Close;
SQL.Clear; //
SQL.Add('select * from dmBed where'); // 8.14 0:05把上一注释掉的语句改为这三句
SQL.Add('RoomID = ' + strRoomID); //
ChangeCondition;
SQL.Add(strCondition);
Open;
end;
end;
end;
end;
var
strFloorID, strRoomID: string;begin case Node.Level of
0:
begin
dmData.adodmBed.SQL.Clear;
BRMResourceDM.aqRes.Open;
if pgcDMMain.ActivePage = TabSheet2 then
begin
with dmData.adodmBed do
begin
Close;
SQL.Clear;
SQL.Add('select * from dmBed where');
SQL.Add('RoomID is not null');
ChangeCondition;
SQL.Add(strCondition);
Open;
end;
end;
end;
1:
begin
dmData.adodmBed.SQL.Clear;
BRMResourceDM.aqFloor.Close;
BRMResourceDM.aqAllRes.GotoBook(Node.data);
BRMResourceDM.aqFloor.Parameters.ParamByName('ResID').Value :=BRMResourceDM.aqAllRes.FieldByName('ResID').value;
BRMResourceDM.aqFloor.Open; if pgcDMMain.ActivePage = TabSheet2 then
begin
with dmData.adodmBed do
begin
Close;
SQL.Clear;
SQL.Add('select * from dmBed where');
SQL.Add('RoomID like ''' + BRMResourceDM.aqAllRes.FieldByName('ResID').AsString + '%''');
ChangeCondition;
SQL.Add(strCondition);
Open;
end;
end; end;
2:
begin
dmData.adodmBed.SQL.Clear;
BRMResourceDM.aqRoom.Close;
BRMResourceDM.aqAllRes.GotoBook(Node.data);
BRMResourceDM.aqRoom.Parameters.ParamByName('FloorID').Value :=BRMResourceDM.aqAllRes.FieldByName('FloorID').value;
BRMResourceDM.aqRoom.Open; if pgcDMMain.ActivePage = TabSheet2 then
begin
with dmData.adodmBed do
begin
Close;
SQL.Clear;
SQL.Add('select * from dmBed where');
SQL.Add('RoomID like ''' + BRMResourceDM.aqAllRes.FieldByName('FloorID').AsString + '%''');
ChangeCondition;
SQL.Add(strCondition);
Open;
end;
end; end;
3:
begin
BRMResourceDM.aqAllRes.GotoBook(Node.Parent.Data);
strRoomNum := Node.Text;
strFloorName := Node.Parent.Parent.Text;
strFloorID :=BRMResourceDM.aqAllRes.FieldByName('FloorID').value; //找到父结点的FloorID
strRoomID := strFloorID + Node.Text; //求得房间结点的RoomID
with dmData.adodmBed do
begin
Close;
SQL.Clear; //
SQL.Add('select * from dmBed where'); // 8.14 0:05把上一注释掉的语句改为这三句
SQL.Add('RoomID = ' + strRoomID); //
ChangeCondition;
SQL.Add(strCondition);
Open;
end;
end;
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货