function InitContentTreeView(TreeView : TTreeView; ClientDataSet : TClientDataSet; ClientDataSet1 : TClientDataSet) : Integer;
var
TreeNode, TreeNode1, TreeNode2, TreeNode3, TreeNode4 : TTreeNode;
i, j : Integer;
PTypeAndID : PointTypeAndID;
begin
with TreeView.Items do
begin
with ClientDataSet do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'PLATBILL_MANAGE';
PTypeAndID^.TypeID := '';
TreeNode := AddChildObject(nil, '节目单', PTypeAndID);
TreeNode.ImageIndex := ICO_PLATBILL_MANAGE;
TreeNode.SelectedIndex := ICO_PLATBILL_MANAGE;
New(PTypeAndID);
PTypeAndID^.TypeType := 'CHANNEL';
PTypeAndID^.TypeID := '';
TreeNode1 := AddChildObject(TreeNode, '频道', PTypeAndID);
TreeNode1.ImageIndex := ICO_CHANNEL;
TreeNode1.SelectedIndex := ICO_CHANNEL;
New(PTypeAndID);
PTypeAndID^.TypeType := 'CHANNEL_ALL';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '全部频道', PTypeAndID);
TreeNode2.ImageIndex := ICO_CHANNEL_ALL;
TreeNode2.SelectedIndex := ICO_CHANNEL_ALL;
New(PTypeAndID);
PTypeAndID^.TypeType := 'CHANNEL_CATEGORY_SORT';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '按类别分类', PTypeAndID);
TreeNode2.ImageIndex := ICO_CHANNEL_CATEGORY_SORT;
TreeNode2.SelectedIndex := ICO_CHANNEL_CATEGORY_SORT;
Close;
CommandText := 'Select * From CHANNEL_CATEGORY Order By CATEGORY_NAME';
Open;
for i := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'CHANNEL_CATEGORY' ;
PTypeAndID^.TypeID := FieldByName('CATEGORY_ID').AsString;
TreeNode3 := AddChildObject(TreeNode2, FieldByName('CATEGORY_NAME').AsString, PTypeAndID);
TreeNode3.ImageIndex := ICO_CHANNEL_CATEGORY;
TreeNode3.SelectedIndex := ICO_CHANNEL_CATEGORY;
if not Eof then
Next;
end;
New(PTypeAndID);
PTypeAndID^.TypeType := 'VBCCONTENT';
PTypeAndID^.TypeID := '';
TreeNode1 := AddChildObject(TreeNode, '广播节目', PTypeAndID);
TreeNode1.ImageIndex := ICO_VBCCONTENT;
TreeNode1.SelectedIndex := ICO_VBCCONTENT;
New(PTypeAndID);
PTypeAndID^.TypeType := 'VBCCONTENT_ALL';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '全部广播节目', PTypeAndID);
TreeNode2.ImageIndex := ICO_VBCCONTENT_ALL;
TreeNode2.SelectedIndex := ICO_VBCCONTENT_ALL;
New(PTypeAndID);
PTypeAndID^.TypeType := 'VBCCONTENT_CATEGORY_SORT';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '按类别分类', PTypeAndID);
TreeNode2.ImageIndex := ICO_VBCCONTENT_CATEGORY_SORT;
TreeNode2.SelectedIndex := ICO_VBCCONTENT_CATEGORY_SORT;
Close;
CommandText := 'Select * From VBCCONTENT_CATEGORY Order By CATEGORY_NAME';
Open;
for i := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'VBCCONTENT_CATEGORY' ;
PTypeAndID^.TypeID := FieldByName('CATEGORY_ID').AsString;
TreeNode3 := AddChildObject(TreeNode2, FieldByName('CATEGORY_NAME').AsString, PTypeAndID);
TreeNode3.ImageIndex := ICO_VBCCONTENT_CATEGORY;
TreeNode3.SelectedIndex := ICO_VBCCONTENT_CATEGORY;
if not Eof then
Next;
end;
New(PTypeAndID);
PTypeAndID^.TypeType := 'VBCEPG';
PTypeAndID^.TypeID := '';
TreeNode1 := AddChildObject(TreeNode, '广播节目单', PTypeAndID);
TreeNode1.ImageIndex := ICO_VBCEPG;
TreeNode1.SelectedIndex := ICO_VBCEPG;
New(PTypeAndID);
PTypeAndID^.TypeType := 'VBCEPG_ALL';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '全部广播节目单', PTypeAndID);
TreeNode2.ImageIndex := ICO_VBCEPG_ALL;
TreeNode2.SelectedIndex := ICO_VBCEPG_ALL;
New(PTypeAndID);
PTypeAndID^.TypeType := 'VBCEPG_CHANNEL_CATEGORY_SORT';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '按频道分类', PTypeAndID);
TreeNode2.ImageIndex := ICO_CHANNEL_CATEGORY_SORT;
TreeNode2.SelectedIndex := ICO_CHANNEL_CATEGORY_SORT;
Close;
CommandText := 'Select * From CHANNEL_CATEGORY Order By CATEGORY_NAME';
Open;
for i := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'VBCEPG_CHANNEL_CATEGORY' ;
PTypeAndID^.TypeID := FieldByName('CATEGORY_ID').AsString;
TreeNode3 := AddChildObject(TreeNode2, FieldByName('CATEGORY_NAME').AsString, PTypeAndID);
TreeNode3.ImageIndex := ICO_CHANNEL_CATEGORY;
TreeNode3.SelectedIndex := ICO_CHANNEL_CATEGORY;
with ClientDataSet1 do
begin
Close;
CommandText := Format('Select * From CHANNEL_CODE Where CATEGORY_ID=''%s'' Order By CHANNEL_NAME',[ClientDataSet.FieldByName('CATEGORY_ID').AsString]);
Open;
for j := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'VBCEPG_CHANNEL_CODE';
PTypeAndID^.TypeID := FieldByName('CHANNEL_ID').AsString;
TreeNode4 := AddChildObject(TreeNode3, FieldByName('CHANNEL_NAME').AsString, PTypeAndID);
TreeNode4.ImageIndex := ICO_CHANNEL_CODE;
TreeNode4.SelectedIndex := ICO_CHANNEL_CODE;
if not Eof then
Next;
end;
end;
if not Eof then
Next;
end;
New(PTypeAndID);
PTypeAndID^.TypeType := 'VBCEPG_VBCCONTENT_CATEGORY_SORT';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '按类别分类', PTypeAndID);
TreeNode2.ImageIndex := ICO_VBCCONTENT_CATEGORY_SORT;
TreeNode2.SelectedIndex := ICO_VBCCONTENT_CATEGORY_SORT;
Close;
CommandText := 'Select * From VBCCONTENT_CATEGORY Order By CATEGORY_NAME';
Open;
for i := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'VBCEPG_VBCCONTENT_CATEGORY' ;
PTypeAndID^.TypeID := FieldByName('CATEGORY_ID').AsString;
TreeNode3 := AddChildObject(TreeNode2, FieldByName('CATEGORY_NAME').AsString, PTypeAndID);
TreeNode3.ImageIndex := ICO_VBCCONTENT_CATEGORY;
TreeNode3.SelectedIndex := ICO_VBCCONTENT_CATEGORY;
with ClientDataSet1 do
begin
Close;
CommandText := Format('Select * From VBCCONTENT_CODE Where CATEGORY_ID=''%s'' Order By VBCCONTENT_NAME',[ClientDataSet.FieldByName('CATEGORY_ID').AsString]);
Open;
for j := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'VBCEPG_VBCCONTENT_CODE';
PTypeAndID^.TypeID := FieldByName('VBCCONTENT_ID').AsString;
TreeNode4 := AddChildObject(TreeNode3, FieldByName('VBCCONTENT_NAME').AsString, PTypeAndID);
TreeNode4.ImageIndex := ICO_VBCCONTENT_CODE;
TreeNode4.SelectedIndex := ICO_VBCCONTENT_CODE;
if not Eof then
Next;
end;
end;
if not Eof then
Next;
end;
New(PTypeAndID);
PTypeAndID^.TypeType := 'CONTENT';
PTypeAndID^.TypeID := '';
TreeNode1 := AddChildObject(TreeNode, '点播节目', PTypeAndID);
TreeNode1.ImageIndex := ICO_CONTENT;
TreeNode1.SelectedIndex := ICO_CONTENT;
New(PTypeAndID);
PTypeAndID^.TypeType := 'CONTENT_ALL';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '全部点播节目', PTypeAndID);
TreeNode2.ImageIndex := ICO_CONTENT_ALL;
TreeNode2.SelectedIndex := ICO_CONTENT_ALL;
New(PTypeAndID);
PTypeAndID^.TypeType := 'CONTENT_CATEGORY_SORT';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '按类别分类', PTypeAndID);
TreeNode2.ImageIndex := ICO_CONTENT_CATEGORY_SORT;
TreeNode2.SelectedIndex := ICO_CONTENT_CATEGORY_SORT;
Close;
CommandText := 'Select * From CONTENT_CATEGORY Order By CATEGORY_NAME';
Open;
for i := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'CONTENT_CATEGORY' ;
PTypeAndID^.TypeID := FieldByName('CATEGORY_ID').AsString;
TreeNode3 := AddChildObject(TreeNode2, FieldByName('CATEGORY_NAME').AsString, PTypeAndID);
TreeNode3.ImageIndex := ICO_CONTENT_CATEGORY;
TreeNode3.SelectedIndex := ICO_CONTENT_CATEGORY;
with ClientDataSet1 do
begin
Close;
CommandText := Format('Select * From CONTENT_SUBCATEGORY Where CATEGORY_ID=''%s'' Order By SUBCATEGORY_NAME',[ClientDataSet.FieldByName('CATEGORY_ID').AsString]);
Open;
for j := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'CONTENT_SUBCATEGORY';
PTypeAndID^.TypeID := FieldByName('SUBCATEGORY_ID').AsString;
TreeNode4 := AddChildObject(TreeNode3, FieldByName('SUBCATEGORY_NAME').AsString, PTypeAndID);
TreeNode4.ImageIndex := ICO_CONTENT_SUBCATEGORY;
TreeNode4.SelectedIndex := ICO_CONTENT_SUBCATEGORY;
if not Eof then
Next;
end;
end;
if not Eof then
Next;
end;
New(PTypeAndID);
PTypeAndID^.TypeType := 'CONTENT_PROVIDER_SORT';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '按供应商分类', PTypeAndID);
TreeNode2.ImageIndex := ICO_CONTENT_PROVIDER_SORT;
TreeNode2.SelectedIndex := ICO_CONTENT_PROVIDER_SORT;
Close;
CommandText := 'Select * From PROVIDER_CATEGORY Order BY CATEGORY_NAME';
Open;
for i := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'PROVIDER_CATEGORY';
PTypeAndID^.TypeID := FieldByName('CATEGORY_ID').AsString;
TreeNode3 := AddChildObject(TreeNode2, FieldByName('CATEGORY_NAME').AsString, PTypeAndID);
TreeNode3.ImageIndex := ICO_PROVIDER_CATEGORY;
TreeNode3.SelectedIndex := ICO_PROVIDER_CATEGORY;
with ClientDataSet1 do
begin
Close;
CommandText := Format('Select * From CONTENT_PROVIDER Where CATEGORY_ID=''%s'' Order By PROVIDER_NAME',[ClientDataSet.FieldByName('CATEGORY_ID').AsString]);
Open;
for j := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'CONTENT_PROVIDER';
PTypeAndID^.TypeID := FieldByName('PROVIDER_ID').AsString;
TreeNode4 := AddChildObject(TreeNode3, FieldByName('PROVIDER_NAME').AsString, PTypeAndID);
TreeNode4.ImageIndex := ICO_CONTENT_PROVIDER;
TreeNode4.SelectedIndex := ICO_CONTENT_PROVIDER;
if not Eof then
Next;
end;
end;
if not Eof then
Next;
end;
New(PTypeAndID);
PTypeAndID^.TypeType := 'CONTENT_RATING_SORT';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '按等级分类', PTypeAndID);
TreeNode2.ImageIndex := ICO_CONTENT_RATING_SORT;
TreeNode2.SelectedIndex := ICO_CONTENT_RATING_SORT;
Close;
CommandText := 'Select * From CONTENT_RATING Order By RATING_NO, RATING_NAME';
Open;
for i := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'CONTENT_RATING';
PTypeAndID^.TypeID := FieldByName('RATING_ID').AsString;
TreeNode3 := AddChildObject(TreeNode2, FieldByName('RATING_NAME').AsString, PTypeAndID);
TreeNode3.ImageIndex := ICO_CONTENT_RATING;
TreeNode3.SelectedIndex := ICO_CONTENT_RATING;
if not Eof then
Next;
end;
New(PTypeAndID);
PTypeAndID^.TypeType := 'VODLOCATION';
PTypeAndID^.TypeID := '';
TreeNode1 := AddChildObject(TreeNode, '点播节目位置', PTypeAndID);
TreeNode1.ImageIndex := ICO_VODLOCATION;
TreeNode1.SelectedIndex := ICO_VODLOCATION;
{New(PTypeAndID);
PTypeAndID^.TypeType := 'VODLOCATION_ALL';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '全部点播节目位置', PTypeAndID);
TreeNode2.ImageIndex := ICO_VODLOCATION_ALL;
TreeNode2.SelectedIndex := ICO_VODLOCATION_ALL;
New(PTypeAndID);
PTypeAndID^.TypeType := 'VODLOCATION_DEVICE_SORT';
PTypeAndID^.TypeID := '';
TreeNode2 := AddChildObject(TreeNode1, '按设备分类', PTypeAndID);
TreeNode2.ImageIndex := ICO_VODLOCATION_DEVICE_SORT;
TreeNode2.SelectedIndex := ICO_VODLOCATION_DEVICE_SORT;
Close;
CommandText := 'Select * From DEVICE_CODE Order By DEVICE_NAME';
Open;
for i := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'VODLOCATION_DEVICE' ;
PTypeAndID^.TypeID := FieldByName('DEVICE_ID').AsString;
TreeNode3 := AddChildObject(TreeNode2, FieldByName('DEVICE_NAME').AsString, PTypeAndID);
TreeNode3.ImageIndex := ICO_VODLOCATION_DEVICE;
TreeNode3.SelectedIndex := ICO_VODLOCATION_DEVICE;
if not Eof then
Next;
end;}
end;
end;
Result := 0;
end;
{ InitContentTreeView
TreeView TTreeView 存放所有节目单和节目源元素
ClientDataSet,ClientDataSet1 : TClientDataSet
返回值 Integer 永远等于 0 。
var
TreeNode, TreeNode1, TreeNode2, TreeNode3, TreeNode4 : TTreeNode;
//五层的TreeView的每一级 元素
i, j : Integer;
//循环用
PTypeAndID : PointTypeAndID;
//为TreeView 指向的指针类型 }
function InitLPartitionTreeView(TreeView : TTreeView; ClientDataSet, ClientDataSet1, ClientDataSet2, ClientDataSet3, ClientDataSet4 : TClientDataSet) : Integer;
var
TreeNode, TreeNode1, TreeNode2, TreeNode3, TreeNode4, TreeNode5 : TTreeNode ;
i1, i2, i3, i4, i5, NcubeCount : Integer ;
PTypeAndID : PointTypeAndID;
begin
NcubeCount := 0;
with TreeView.Items do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'MPEGFILE_MANAGE';
PTypeAndID^.TypeID := '';
TreeNode := AddChildObject(nil, '节目源', PTypeAndID);
TreeNode.ImageIndex := ICO_MPEGFILE_MANAGE;
TreeNode.SelectedIndex := ICO_MPEGFILE_MANAGE;
with ClientDataSet do
begin
Close ;
CommandText := 'Select * From LOCATION_Code Where LEVEL_ID=3 ORDER BY LOCATION_NAME' ;
Open ;
for i1 := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'FIRST_LOCATION';
PTypeAndID^.TypeID := FieldByName('LOCATION_ID').AsString;
TreeNode1 := AddChildObject(TreeNode, FieldByName('LOCATION_NAME').AsString, PTypeAndID);
TreeNode1.ImageIndex := ICO_FRIST_LOCATION;
TreeNode1.SelectedIndex := ICO_FRIST_LOCATION;
with ClientDataSet3 do
begin
Close ;
CommandText := Format('Select * From DEVICE_CODE Where CATEGORY_ID = ''VOD'' AND LOCATION_ID=''%s'' ORDER BY DEVICE_NAME',[ClientDataSet.FieldByName('LOCATION_ID').AsString]) ;
Open ;
for i4 := 0 to RecordCount - 1 do
begin
NcubeCount := NcubeCount + 1;
New(PTypeAndID);
PTypeAndID^.TypeType := 'DEVICE_CODE';
PTypeAndID^.TypeID := FieldByName('DEVICE_ID').AsString;
TreeNode4 := AddChildObject(TreeNode1, FieldByName('DEVICE_NAME').AsString, PTypeAndID);
TreeNode4.ImageIndex := ICO_DEVICE_CODE;
TreeNode4.SelectedIndex := ICO_DEVICE_CODE;
with ClientDataSet4 do
begin
Close ;
CommandText := Format('Select * From DEVICE_LPARTITION Where DEVICE_ID=''%s'' ORDER BY LOGICAL_PARTITION',[ClientDataSet3.FieldByName('DEVICE_ID').AsString]) ;
Open ;
for i5 := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'DEVICE_LPARTITION';
PTypeAndID^.TypeID := FieldByName('LOGICAL_PARTITION').AsString + FieldByName('DELIMITER').AsString;
PTypeAndID^.TypeID1 := ClientDataSet3.FieldByName('DEVICE_ID').AsString;
TreeNode5 := AddChildObject(TreeNode4, FieldByName('LOGICAL_PARTITION').AsString + FieldByName('DELIMITER').AsString, PTypeAndID);
TreeNode5.ImageIndex := ICO_DEVICE_LPARTITION;
TreeNode5.SelectedIndex := ICO_DEVICE_LPARTITION;
ClientDataSet4.Next;
end;
end;
ClientDataSet3.Next;
end;
end;
with ClientDataSet1 do
begin
Close ;
CommandText := Format('Select * From LOCATION_Code Where LEVEL_ID=2 and UPPERLOCATION_ID=''%s'' ORDER BY LOCATION_NAME',[ClientDataSet.FieldByName('LOCATION_ID').AsString]) ;
Open ;
for i2 := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'SECOND_LOCATION';
PTypeAndID^.TypeID := FieldByName('LOCATION_ID').AsString;
TreeNode2 := AddChildObject(TreeNode1, FieldByName('LOCATION_NAME').AsString, PTypeAndID);
TreeNode2.ImageIndex := ICO_SECOND_LOCATION;
TreeNode2.SelectedIndex := ICO_SECOND_LOCATION;
with ClientDataSet3 do
begin
Close ;
CommandText := Format('Select * From DEVICE_CODE Where LOCATION_ID=''%s'' ORDER BY DEVICE_NAME',[ClientDataSet1.FieldByName('LOCATION_ID').AsString]) ;
Open ;
for i4 := 0 to RecordCount - 1 do
begin
NcubeCount := NcubeCount + 1;
New(PTypeAndID);
PTypeAndID^.TypeType := 'DEVICE_CODE';
PTypeAndID^.TypeID := FieldByName('DEVICE_ID').AsString;
TreeNode4 := AddChildObject(TreeNode2, FieldByName('DEVICE_NAME').AsString, PTypeAndID);
TreeNode4.ImageIndex := ICO_DEVICE_CODE;
TreeNode4.SelectedIndex := ICO_DEVICE_CODE;
with ClientDataSet4 do
begin
Close ;
CommandText := Format('Select * From DEVICE_LPARTITION Where DEVICE_ID=''%s'' ORDER BY LOGICAL_PARTITION',[ClientDataSet3.FieldByName('DEVICE_ID').AsString]) ;
Open ;
for i5 := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'DEVICE_LPARTITION';
PTypeAndID^.TypeID := FieldByName('LOGICAL_PARTITION').AsString + FieldByName('DELIMITER').AsString;
PTypeAndID^.TypeID1 := ClientDataSet3.FieldByName('DEVICE_ID').AsString;
TreeNode5 := AddChildObject(TreeNode4, FieldByName('LOGICAL_PARTITION').AsString + FieldByName('DELIMITER').AsString, PTypeAndID);
TreeNode5.ImageIndex := ICO_DEVICE_LPARTITION;
TreeNode5.SelectedIndex := ICO_DEVICE_LPARTITION;
ClientDataSet4.Next;
end;
end;
ClientDataSet3.Next;
end;
end;
with ClientDataSet2 do
begin
Close ;
CommandText := Format('Select * From LOCATION_Code Where LEVEL_ID=1 and UPPERLOCATION_ID=''%s'' ORDER BY LOCATION_NAME',[ClientDataSet1.FieldByName('LOCATION_ID').AsString]) ;
Open ;
for i3 := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'THIRD_LOCATION';
PTypeAndID^.TypeID := FieldByName('LOCATION_ID').AsString;
TreeNode3 := AddChildObject(TreeNode2, FieldByName('LOCATION_NAME').AsString, PTypeAndID);
TreeNode3.ImageIndex := ICO_THIRD_LOCATION;
TreeNode3.SelectedIndex := ICO_THIRD_LOCATION;
with ClientDataSet3 do
begin
Close ;
CommandText := Format('Select * From DEVICE_CODE Where LOCATION_ID=''%s'' ORDER BY DEVICE_NAME',[ClientDataSet2.FieldByName('LOCATION_ID').AsString]) ;
Open ;
for i4 := 0 to RecordCount - 1 do
begin
NcubeCount := NcubeCount + 1;
New(PTypeAndID);
PTypeAndID^.TypeType := 'DEVICE_CODE';
PTypeAndID^.TypeID := FieldByName('DEVICE_ID').AsString;
TreeNode4 := AddChildObject(TreeNode3, FieldByName('DEVICE_NAME').AsString, PTypeAndID);
TreeNode4.ImageIndex := ICO_DEVICE_CODE;
TreeNode4.SelectedIndex := ICO_DEVICE_CODE;
with ClientDataSet4 do
begin
Close ;
CommandText := Format('Select * From DEVICE_LPARTITION Where DEVICE_ID=''%s'' ORDER BY LOGICAL_PARTITION',[ClientDataSet3.FieldByName('DEVICE_ID').AsString]) ;
Open ;
for i5 := 0 to RecordCount - 1 do
begin
New(PTypeAndID);
PTypeAndID^.TypeType := 'DEVICE_LPARTITION';
PTypeAndID^.TypeID := FieldByName('LOGICAL_PARTITION').AsString + FieldByName('DELIMITER').AsString;
PTypeAndID^.TypeID1 := ClientDataSet3.FieldByName('DEVICE_ID').AsString;
TreeNode5 := AddChildObject(TreeNode4, FieldByName('LOGICAL_PARTITION').AsString + FieldByName('DELIMITER').AsString, PTypeAndID);
TreeNode5.ImageIndex := ICO_DEVICE_LPARTITION;
TreeNode5.SelectedIndex := ICO_DEVICE_LPARTITION;
ClientDataSet4.Next;
end;
end;
ClientDataSet3.Next;
end;
end;
ClientDataSet2.Next;
end;
end;
ClientDataSet1.Next;
end;
end;
ClientDataSet.Next;
end;
end;
end ;
Result := NcubeCount;
end;
{ InitLPartitionTreeView
TreeView TTreeView 存放所有节目单和节目源元素
ClientDataSet,ClientDataSet1, ClientDataSet2, ClientDataSet3, ClientDataSet4 : TClientDataSet
返回值 Integer NCUBE的数量 。
var
TreeNode, TreeNode1, TreeNode2, TreeNode3, TreeNode4, TreeNode5 : TTreeNode ;
//六层的TreeView的每一级 元素
i1, i2, i3, i4, i5 : Integer
//循环用
NcubeCount : Integer
//NCUBE的数量
PTypeAndID : PointTypeAndID;
//为TreeView 指向的指针类型}
留下你的qq和mail,哦们可以交流