CodePudding user response:
What do you use data sets, estimate the dataset component does not support bookmarks bookmarkCodePudding user response:
What is data collection of components, the other forms are the same, all rightCodePudding user response:
The unit U_ygdd;Interface
USES the
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids ComCtrls, Buttons, ToolWin, ExtCtrls, DB,
StdCtrls;
Type
Tfrm_ygdd=class (TForm)
Panel1: TPanel;
TreeView1: TTreeView;
Panel2: TPanel;
CoolBar1: TCoolBar;
ToolBar1: TToolBar;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
Panel3: TPanel;
Panel4: TPanel;
DBGrid1: TDBGrid;
BitBtn3: TBitBtn;
BitBtn2: TBitBtn;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Edit1: TEdit;
Edit2: TEdit;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
ComboBox3: TComboBox;
DataSource1: TDataSource;
Procedure SpeedButton1Click (Sender: TObject);
Procedure SpeedButton3Click (Sender: TObject);
Procedure TreeView1Click (Sender: TObject);
Procedure FormShow (Sender: TObject);
Procedure BitBtn3Click (Sender: TObject);
Procedure DBGrid1CellClick (Column: TColumn);
Procedure BitBtn2Click (Sender: TObject);
Procedure SpeedButton2Click (Sender: TObject);
Private
{Private declarations}
Public
{Public declarations}
end;
Var
Frm_ygdd: Tfrm_ygdd;
Implementation
USES U_data U_tj;
{$R *. DFM}
Procedure Tfrm_ygdd. SpeedButton1Click (Sender: TObject);
The begin
Application CreateForm (Tfrm_cxtj frm_cxtj);
Frm_cxtj. ShowModal;
Frm_cxtj. Free;
end;
Procedure Tfrm_ygdd. SpeedButton3Click (Sender: TObject);
The begin
close;
end;
Procedure Tfrm_ygdd. TreeView1Click (Sender: TObject);
Var
S, d: string;
The begin
With data1. ADOQYdwxx do
The begin
close;
SQL. The Clear;
SQL. The Add (' name from the select distinct units unit information table).
The open;
end;
S:=treeview1. Selected. The Text;
D:=data1. ADOQYdwxx. FieldByName (' name '). The Value;
If treeview1. Selected<> Nil then
If treeview1. Selected. Then the Text=d
The begin
With data1. ADOpublic do
The begin
close;
SQL. The Clear;
SQL. The Add (' select * from the personnel table where SFLZ=: b ');
The parameters. ParamByName (' b '). The Value:='no';
The open;
end;
End
The else
The begin
With data1. ADOpublic do
The begin
close;
SQL. The Clear;
SQL. The Add (' select * from the personnel table where SSBM=: a and SFLZ=: b ');
The parameters. ParamByName (' a '). The Value:=s;
The parameters. ParamByName (' b '). The Value:='no';
The open;
end;
end;
end;
Procedure Tfrm_ygdd. FormShow (Sender: TObject);
Var
A, b: string;
Subt: TTreenode;
The begin
Combobox1. The Clear;
Combobox2. The Clear;
Combobox3. The Clear;
With data1. ADOpublic do
The begin
close;
SQL. The Clear;
SQL. The Add (' name from the select distinct units unit information table).
The open;
end;
A:=data1. ADOpublic. FieldByName (' name '). The Value;
Subt:=Treeview1. Items. The Add (nil, a);
With data1. ADOpublic do
The begin
close;
SQL. The Clear;
SQL. The Add (' table name from the select distinct departments department);
The open;
end;
While Not Data1. ADOpublic. Eof do
The begin
ComboBox1. Items. The Add (Data1. ADOpublic. FieldByName (' department name). The Value).
B:=Data1. ADOpublic. FieldByName (' department name). The Value;
Data1. ADOpublic. Next;
Treeview1. Items. AddChild (subt, b);
end;
With data1. ADOpublic do
The begin
close;
SQL. The Clear;
SQL. The Add (' select distinct position title from duty list ');
The open;
end;
While Not Data1. ADOpublic. Eof do
The begin
ComboBox2. Items. The Add (Data1. ADOpublic. FieldByName (' job title '). The Value).
Data1. ADOpublic. Next;
end;
With data1. ADOpublic do
The begin
close;
SQL. The Clear;
SQL. The Add (' names from the select distinct title title table).
The open;
end;
While Not Data1. ADOpublic. Eof do
The begin
ComboBox3. Items. The Add (Data1. ADOpublic. FieldByName (' title name '). The Value).
Data1. ADOpublic. Next;
end;
With data1. ADOpublic do
The begin
close;
SQL. The Clear;
SQL. The Add (' select * from the personnel table where SFLZ=: b ');
The parameters. ParamByName (' b '). The Value:='no';
The open;
end;
Data1. ADOpublic. Active:=true;
Edit1. Text:=data1. ADOpublic. FieldByName (" bh "). The Value;
Edit2. Text:=data1. ADOpublic. FieldByName (' xm). The Value;
Combobox1. Text:=data1. ADOpublic. FieldByName (' SSBM). The Value;
Combobox2. Text:=data1. ADOpublic. FieldByName (' zw). The Value;
Combobox3. Text:=data1. ADOpublic. FieldByName (' zc). The Value;
TreeView1. FullExpand;
end;
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull