W
wanxin
Unregistered / Unconfirmed
GUEST, unregistred user!
Procedure TreeViewDataInit;
var i,j:integer;MyRecPtr: PMyRec;
Begin
begin
with FBugNote,Fdata do
begin
TreeViewStationBlank.Items.BeginUpdate;
TreeViewStationBlank.Items.Clear;
MyRecPtr^.Id:=Fpassword.IdCorp_c;
TreeNodeLayer1:=TreeViewStationBlank.Items.AddObject(nil,Fpassword.WorkCorp.text,MyRecPtr);
QueryStation.Close;
QueryStation.SQL.Clear;
QueryStation.SQL.Add('Select * From Dm_Bds');
QueryStation.SQL.Add(Format('Where dwdm='+'''%s''',[Fpassword.IdCorp_c]));
QueryStation.Open;
QueryBlank.Close;
QueryBlank.SQL.Clear;
QueryBlank.SQL.Add('Select * From blank');
QueryBlank.SQL.Add(Format('Where idBlank Like'+'''%s''',['%'+Fpassword.IdCorp_c+'%']));
QueryBlank.Open;
for i:=0 to QueryStation.RecordCount-1 do
begin
MyRecPtr^.Id:=QueryStation.fieldbyname('bdsdm').asstring;
TreeNodeLayer2:=TreeViewStationBlank.Items.AddObject(TreeNodeLayer1,QueryStation.fieldbyname('bdsmc').asstring,MyRecPtr);
QueryBlank.First;
For j:=0 to QueryBlank.RecordCount-1 do
Begin
if Copy(QueryBlank.FieldByName('IdBlank').AsString,1,11)=Fpassword.IdCorp_c+QueryStation.FieldByName('Bdsdm').AsString then
Begin
MyRecPtr^.Id:=QueryBlank.fieldbyname('IdBlank').asstring;
TreeNodeLayer3:=TreeViewStationBlank.Items.AddObject(TreeNodeLayer2,QueryBlank.fieldbyname('BlankName').asstring,MyRecPtr);
End;
QueryBlank.Next;
End;
QueryStation.Next;
end;
TreeViewStationBlank.Items[0].Selected:=true;
TreeViewStationBlank.FullExpand;
TreeViewStationBlank.Items.EndUpdate;
StDataInit;//过程
BkDataInit;//过程
end;
end;
end;
var i,j:integer;MyRecPtr: PMyRec;
Begin
begin
with FBugNote,Fdata do
begin
TreeViewStationBlank.Items.BeginUpdate;
TreeViewStationBlank.Items.Clear;
MyRecPtr^.Id:=Fpassword.IdCorp_c;
TreeNodeLayer1:=TreeViewStationBlank.Items.AddObject(nil,Fpassword.WorkCorp.text,MyRecPtr);
QueryStation.Close;
QueryStation.SQL.Clear;
QueryStation.SQL.Add('Select * From Dm_Bds');
QueryStation.SQL.Add(Format('Where dwdm='+'''%s''',[Fpassword.IdCorp_c]));
QueryStation.Open;
QueryBlank.Close;
QueryBlank.SQL.Clear;
QueryBlank.SQL.Add('Select * From blank');
QueryBlank.SQL.Add(Format('Where idBlank Like'+'''%s''',['%'+Fpassword.IdCorp_c+'%']));
QueryBlank.Open;
for i:=0 to QueryStation.RecordCount-1 do
begin
MyRecPtr^.Id:=QueryStation.fieldbyname('bdsdm').asstring;
TreeNodeLayer2:=TreeViewStationBlank.Items.AddObject(TreeNodeLayer1,QueryStation.fieldbyname('bdsmc').asstring,MyRecPtr);
QueryBlank.First;
For j:=0 to QueryBlank.RecordCount-1 do
Begin
if Copy(QueryBlank.FieldByName('IdBlank').AsString,1,11)=Fpassword.IdCorp_c+QueryStation.FieldByName('Bdsdm').AsString then
Begin
MyRecPtr^.Id:=QueryBlank.fieldbyname('IdBlank').asstring;
TreeNodeLayer3:=TreeViewStationBlank.Items.AddObject(TreeNodeLayer2,QueryBlank.fieldbyname('BlankName').asstring,MyRecPtr);
End;
QueryBlank.Next;
End;
QueryStation.Next;
end;
TreeViewStationBlank.Items[0].Selected:=true;
TreeViewStationBlank.FullExpand;
TreeViewStationBlank.Items.EndUpdate;
StDataInit;//过程
BkDataInit;//过程
end;
end;
end;