📄 uform_dollor_list.pas
字号:
unit Uform_dollor_list;
//显示特定用户的消费纪录
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, ImgList, StdCtrls, Buttons, ComCtrls, ExtCtrls;
type
Tform_dollor_list = class(TForm)
Panel1: TPanel;
Image1: TImage;
Label2: TLabel;
Label1: TLabel;
Bevel1: TBevel;
Image2: TImage;
Panel2: TPanel;
ListView1: TListView;
Panel3: TPanel;
Panel4: TPanel;
BitBtn3: TBitBtn;
ImageList1: TImageList;
recordset_temp: TADOQuery;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
procedure FormShow(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
cid:integer;
end;
var
form_dollor_list: Tform_dollor_list;
implementation
{$R *.dfm}
procedure Tform_dollor_list.FormShow(Sender: TObject);
//初始化窗口
var
ListItem: TListItem;
i:integer;
begin
//从数据库中查询该客户的详细信息
recordset_temp.SQL.Clear;
recordset_temp.SQL.Add('select [CUSTOM_CODE],[CUSTOM_MNAME],[CUSTOM_FNAME],' +
'[CUSTOM_TEL],[AREA_NAME],[CUSTOM_ADD],[FROM_NAME],[CUSTOM_POST],' +
'[CUSTOM_DATE] from [CUSTOM],[FROM],[AREA] where [CUSTOM_AREA]=[AREA_ID] AND [CUSTOM_FROM]=[FROM_ID]' +
' and [CUSTOM_ID]=' + inttostr(cid));
recordset_temp.Open ;
//显示该用户的详细信息
label4.Caption :=recordset_temp.Fields[0].AsString ;
label5.Caption :=recordset_temp.Fields[1].AsString ;
label7.Caption :=recordset_temp.Fields[2].AsString ;
label10.Caption :=recordset_temp.Fields[3].AsString ;
label12.Caption :=recordset_temp.Fields[4].AsString ;
label14.Caption :=recordset_temp.Fields[5].AsString ;
label15.Caption :=recordset_temp.Fields[6].AsString ;
label17.Caption :=recordset_temp.Fields[7].AsString ;
label19.Caption :=datetimetostr(recordset_temp.Fields[8].AsDateTime );
recordset_temp.Close ;
listview1.Items.Clear ;
recordset_temp.SQL.Clear ;
//从数据库中查询该客户的消费纪录
recordset_temp.SQL.Add('select [FW_NAME],[JY_FWDOLLOR],[JY_FWCOUNT],[JY_ALLDOLLOR],[JY_DATE] from [FW],[JY] where [FW_ID]=[JY_FWID] and [JY_CUSTOMID]=' + inttostr(cid));
recordset_temp.Open ;
//将查询结果添加如消费纪录列表
for i :=1 to recordset_temp.RecordCount do
begin
listitem:=listview1.Items.Add ;
listitem.ImageIndex :=0;
listitem.Caption :=recordset_temp.Fields[0].AsString ;
listitem.SubItems.Add(format( '%8.2f¥',[recordset_temp.Fields[1].asfloat]));
listitem.SubItems.Add(inttostr(recordset_temp.Fields[2].asinteger));
listitem.SubItems.Add(format( '%8.2f¥',[recordset_temp.Fields[3].asfloat]));
listitem.SubItems.Add(datetimetostr(recordset_temp.Fields[4].asdatetime));
recordset_temp.Next ;
end;
recordset_temp.Close ;
end;
procedure Tform_dollor_list.BitBtn3Click(Sender: TObject);
//关闭窗口
begin
close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -