【delphi开源代码栏目提醒】:网学会员,鉴于大家对delphi开源代码十分关注,论文会员在此为大家搜集整理了“billreal.pas”一文,供大家参考学习!
unit billreal;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ahmtbackground, ComCtrls, StdCtrls, dxDBTLCl, dxGrClms, dxTL,
dxDBCtrl, dxDBGrid, dxCntner, ExtCtrls, ahmtlabel, Buttons, ahmtpanel;
type
TF_Bill = class(TForm)
Splitter1: TSplitter;
AHMPanel1: TAHMPanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
AHMPanel2: TAHMPanel;
Panel1: TPanel;
AHMPanel4: TAHMPanel;
AHMLabel2: TAHMLabel;
SpeedButton6: TSpeedButton;
Edit7: TEdit;
dxDBGrid1: TdxDBGrid;
AHMPanel3: TAHMPanel;
Label1: TLabel;
SpeedButton8: TSpeedButton;
SpeedButton9: TSpeedButton;
Label2: TLabel;
Label8: TLabel;
Edit1: TEdit;
Edit2: TEdit;
DateTimePicker1: TDateTimePicker;
AHMBackground1: TAHMBackground;
dxDBGrid1Bill_ID: TdxDBGridMaskColumn;
dxDBGrid1Policy_ID: TdxDBGridMaskColumn;
dxDBGrid1Bill_Money: TdxDBGridMaskColumn;
dxDBGrid1Bill_Date: TdxDBGridDateColumn;
Label3: TLabel;
Edit3: TEdit;
AHMBackground2: TAHMBackground;
AHMLabel1: TAHMLabel;
AHMLabel3: TAHMLabel;
procedure SpeedButton6Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
F_Bill: TF_Bill;
implementation
uses dm;
{$R *.dfm}
procedure TF_Bill.SpeedButton6Click(Sender: TObject);
begin
With MyDM.BillQuery do
begin
close;
with SQL do
begin
clear;
Add('select * from Bill');
Add('where Policy_ID = :p');
end;
Parameters[0].value := Edit7.Text;
Prepared;
Open;
end;
With MyDM.Query do
begin
close;
with SQL do
begin
clear;
Add('select sum(Bill_Money) from Bill');
Add('where Policy_ID = :p');
end;
Parameters[0].value := Edit7.Text;
Prepared;
Open;
end;
AHMLabel1.Visible := True;
AHMLabel3.Visible := True;
AHMLabel3.Caption := MyDM.Query.Fields[0].AsString;
end;
end.