📄 unit26.pas
字号:
unit Unit26;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, ExtCtrls, RpCon, RpConDS, RpDefine, RpRave,
Grids, DBGrids, Buttons;
type
TF_comprep = class(TForm)
Panel1: TPanel;
Splitter1: TSplitter;
Button1: TButton;
Button2: TButton;
DateTimePicker1: TDateTimePicker;
Label5: TLabel;
DateTimePicker2: TDateTimePicker;
Button3: TButton;
SpeedButton1: TSpeedButton;
DBGrid1: TDBGrid;
SpeedButton2: TSpeedButton;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Label4: TLabel;
RadioButton3: TRadioButton;
RvProject1: TRvProject;
RvDataSetConnection2: TRvDataSetConnection;
Edit1: TEdit;
Edit2: TEdit;
procedure Button1Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
F_comprep: TF_comprep;
implementation
uses unit11;
{$R *.dfm}
procedure TF_comprep.Button1Click(Sender: TObject);
begin
with mydm.comprepquery do
begin
Close;
with SQL do
begin
Clear;
Add('select a.*,b.*,cust_name,bene_name');
Add('from compensation as a,policy as b,customer,beneficiary' );
Add('where a.policy_id = b.policy_id and b.cust_id=customer.cust_id and b.bene_id=beneficiary.bene_id and a.comp_id=:p0');
end;
Parameters[0].Value:=Trim(Edit1.Text);//Trim()为去空格函数
Prepared;
Open;
end;
edit1.Clear;
end;
procedure TF_comprep.SpeedButton1Click(Sender: TObject);
begin
Rvproject1.Execute;
end;
procedure TF_comprep.FormShow(Sender: TObject);
begin
button1.Enabled:=false;
button2.Enabled:=false;
button3.Enabled:=false;
speedbutton1.Enabled:=false;
edit1.Clear;
edit2.Clear;
with mydm.comprepquery do
begin
Close;
with SQL do
begin
Clear;
Add('select a.*,b.*,cust_name,bene_name');
Add('from compensation as a,policy as b,customer,beneficiary' );
Add('where a.policy_id = b.policy_id and b.cust_id=customer.cust_id and b.bene_id=beneficiary.bene_id ');
end;
Prepared;
Open;
end;
end;
procedure TF_comprep.RadioButton1Click(Sender: TObject);
begin
button1.Enabled:=true;
speedbutton1.Enabled:=true;
end;
procedure TF_comprep.Button2Click(Sender: TObject);
begin
with mydm.comprepquery do
begin
Close;
with SQL do
begin
Clear;
Add('select a.*,b.*,cust_name,bene_name');
Add('from compensation as a,policy as b,customer,beneficiary' );
Add('where a.policy_id = b.policy_id and b.cust_id=customer.cust_id and b.bene_id=beneficiary.bene_id and a.policy_id=:p');
end;
Parameters[0].Value:=trim(edit2.Text);
Prepared;
Open;
end;
edit2.Clear;
end;
procedure TF_comprep.Button3Click(Sender: TObject);
begin
with mydm.comprepQuery do
begin
close;
with SQL do
begin
clear;
Add('select a.*,b.*,cust_name,bene_name') ;
Add('from compensation as a,policy as b,customer,beneficiary' ) ;
Add(' where a.policy_id = b.policy_id and b.cust_id=customer.cust_id and b.bene_id=beneficiary.bene_id and a.comp_date>=:p1 and a.comp_date<=:p2');
end;
Parameters.ParamByName('p1').Value:=datetostr(datetimepicker1.Date);
Parameters.ParamByName('p2').Value:=datetostr(datetimepicker2.Date);
prepared;
Open;
end;
end;
procedure TF_comprep.SpeedButton2Click(Sender: TObject);
begin
close;
end;
procedure TF_comprep.RadioButton2Click(Sender: TObject);
begin
button2.Enabled:=true;
speedbutton1.Enabled:=true;
edit2.SetFocus;
end;
procedure TF_comprep.RadioButton3Click(Sender: TObject);
begin
button3.Enabled:=true;
speedbutton1.Enabled:=true;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -