?? uform_ljxf.pas
字號:
unit Uform_ljxf;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ComCtrls, DB, ADODB, ImgList, ExtCtrls;
type
Tform_ljxf = 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;
BitBtn2: TBitBtn;
Bevel2: TBevel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
Label24: TLabel;
BitBtn1: TBitBtn;
recordset_temp2: TADOQuery;
procedure FormShow(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure ListView1Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
sdate:tdate;
edate:tdate;
smoney:integer;
emoney:integer;
end;
var
form_ljxf: Tform_ljxf;
implementation
uses Uform_xf_limit, Uform_ljxf_one;
{$R *.dfm}
procedure Tform_ljxf.FormShow(Sender: TObject);
begin
label22.Caption :='';
label24.Caption :='';
label4.Caption :='' ;
label5.Caption :='';
label7.Caption :='';
label10.Caption :='';
label12.Caption :='';
label14.Caption :='';
label15.Caption :='';
label17.Caption :='';
label19.Caption :='';
listview1.Clear ;
end;
procedure Tform_ljxf.BitBtn3Click(Sender: TObject);
begin
close;
end;
procedure Tform_ljxf.BitBtn2Click(Sender: TObject);
var
i:integer;
ListItem: TListItem;
p:^integer;
mm:real;
begin
form_xf_limit.ShowModal ;
if form_xf_limit.yesno =false then
begin
exit;
end;
sdate:=form_xf_limit.sdate ;
edate:=form_xf_limit.edate ;
smoney:=form_xf_limit.smoney ;
emoney:=form_xf_limit.emoney ;
label22.Caption :=datetostr(sdate) + ' - ' + datetostr(edate);
label24.Caption :=inttostr(smoney) + '¥ - ' + inttostr(emoney) + '¥';
listview1.Clear ;
recordset_temp.SQL.Clear ;
recordset_temp.SQL.Add('select * from [CUSTOM]');
recordset_temp.open;
for i:=1 to recordset_temp.RecordCount do
begin
recordset_temp2.SQL.Clear ;
recordset_temp2.SQL.Add('select sum([JY_ALLDOLLOR]) from [JY] where [JY_DATE]>#'
+ datetostr(sdate) + '# and [JY_DATE]<#' + datetostr(edate)
+ '# and [JY_CUSTOMID]='
+ inttostr(recordset_temp.Fields[0].asinteger));
recordset_temp2.Open ;
if recordset_temp2.RecordCount <>0 then
begin
mm:=recordset_temp2.Fields[0].AsFloat ;
end;
if ((mm>smoney) and (mm<emoney)) then
begin
listitem:=listview1.Items.Add ;
listitem.Caption :=recordset_temp.Fields[1].AsString ;
listitem.ImageIndex :=0;
listitem.SubItems.Add(recordset_temp.Fields[2].asstring);
listitem.SubItems.Add(recordset_temp.Fields[3].asstring);
listitem.SubItems.Add(format( '%8.2f¥',[mm]));
new(p);
p^ := recordset_temp.Fields[0].AsInteger ;
listitem.Data :=p;
;
end;
recordset_temp2.Close ;
recordset_temp.Next;
end;
recordset_temp.Close ;
end;
procedure Tform_ljxf.ListView1Click(Sender: TObject);
var
p:^integer;
begin
if listview1.selected=nil then
begin
label4.Caption :='' ;
label5.Caption :='';
label7.Caption :='';
label10.Caption :='';
label12.Caption :='';
label14.Caption :='';
label15.Caption :='';
label17.Caption :='';
label19.Caption :='';
exit;
end;
p:=listview1.Selected.Data;
//show the custom's information
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(p^)
);
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;
end;
procedure Tform_ljxf.BitBtn1Click(Sender: TObject);
var
p:^integer;
begin
if listview1.selected=nil then
begin
exit;
end;
p:=listview1.Selected.Data ;
form_ljxf_one.userid :=p^;
form_ljxf_one.sdate:=sdate ;
form_ljxf_one.edate:=edate ;
form_ljxf_one.ShowModal ;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -