⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uform_ljxf_one.pas

📁 Delphi应用婚纱系统 Delphi应用婚纱系统
💻 PAS
字号:
unit Uform_ljxf_one;
//查询某一用户的消费纪录
interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ComCtrls, DB, ADODB, ImgList, ExtCtrls;

type
  Tform_ljxf_one = class(TForm)
    Panel1: TPanel;
    Image1: TImage;
    Label2: TLabel;
    Label1: TLabel;
    Bevel1: TBevel;
    Image2: TImage;
    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;
    ImageList1: TImageList;
    recordset_temp: TADOQuery;
    Panel2: TPanel;
    ListView1: TListView;
    Panel3: TPanel;
    Panel4: TPanel;
    BitBtn3: TBitBtn;
    Label21: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    Label24: TLabel;
    procedure BitBtn3Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    userid:integer;
    sdate:tdate;
    edate:tdate;
  end;

var
  form_ljxf_one: Tform_ljxf_one;

implementation

{$R *.dfm}

procedure Tform_ljxf_one.BitBtn3Click(Sender: TObject);
//关闭窗口
begin
   close;
end;

procedure Tform_ljxf_one.FormShow(Sender: TObject);
//初始化窗口显示
var
   ListItem: TListItem;
   i:integer;
   summoney:real;
begin
   //查询数据库
   listview1.Clear ;
   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],[AREA],[FROM] where [FROM_ID]=[CUSTOM_FROM] and [AREA_ID]=[CUSTOM_AREA] and [CUSTOM_ID]=' + inttostr(userid)
   );
   recordset_temp.Open ;
   if recordset_temp.recordcount<>0 then
   begin
      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 :=datetostr(recordset_temp.Fields [8].AsDateTime );
   end;
   //显示窗口内容
   label22.Caption :=datetostr(sdate) + ' - ' + datetostr(edate);
   recordset_temp.Close;
   recordset_temp.SQL.Clear ;
   recordset_temp.SQL.Add('select [FW_NAME],[JY_FWDOLLOR],[JY_FWCOUNT],[JY_ALLDOLLOR],[JY_DATE]  from [JY],[FW] where [FW_ID]=[JY_FWID] and [JY_CUSTOMID]=' + inttostr(userid) +
        ' and [JY_DATE]>=#' + datetostr(sdate) +
        '# and [JY_DATE]<=#' + datetostr(edate+1) + '#');
   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));
      summoney:=summoney+ recordset_temp.Fields[3].AsFloat ;
      recordset_temp.Next ;
   end;
   recordset_temp.Close;
   label23.Caption :=format('%8.2f¥',[summoney]);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -