📄 uform_area_list.pas
字号:
unit Uform_area_list;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, Buttons, DB, ADODB, ImgList, ExtCtrls;
type
Tform_area_list = class(TForm)
ImageList1: TImageList;
recordset_temp: TADOQuery;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
BitBtn3: TBitBtn;
BitBtn1: TBitBtn;
Apart_list: TListView;
recordset_temp2: TADOQuery;
Panel1: TPanel;
Image1: TImage;
Label2: TLabel;
Label1: TLabel;
Bevel1: TBevel;
Image2: TImage;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
procedure BitBtn3Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
intcount:integer;
customcount:integer;
end;
var
form_area_list: Tform_area_list;
implementation
uses Uform_area_user;
{$R *.dfm}
procedure Tform_area_list.BitBtn3Click(Sender: TObject);
begin
close;
end;
procedure Tform_area_list.FormShow(Sender: TObject);
var
i:integer;
ListItem: TListItem;
p:^integer;
begin
//add the list information 2002-2-30
//clear the imagelist
apart_list.Items.Clear ;
//get the count of the custom
recordset_temp.SQL.Clear ;
recordset_temp.SQL.Add('select * from [CUSTOM]');
recordset_temp.Open ;
label6.Caption :=inttostr(recordset_temp.RecordCount ) + '名';
customcount:=recordset_temp.recordcount;
recordset_temp.close;
//add the area itme into the list
recordset_temp.SQL.Clear ;
recordset_temp.SQL.Add ('select * from [AREA]');
recordset_temp.Open ;
intCount:=recordset_temp.RecordCount ;
Label4.Caption :=inttostr(intCount) + '个';
for i:=1 to recordset_temp.RecordCount do
begin
listitem:=apart_LIST.Items.Add ;
listitem.Caption :=recordset_temp.Fields[1].AsString ;
listitem.ImageIndex :=0;
recordset_temp2.SQL.Clear ;
recordset_temp2.SQL.Add('select [CUSTOM_ID] from [CUSTOM] where [CUSTOM_AREA]=' + inttostr(recordset_temp.Fields[0].asinteger));
recordset_temp2.Open ;
listitem.SubItems.Add(inttostr(recordset_temp2.recordcount));
listitem.SubItems.Add(format( '%8.2f%',[recordset_temp2.recordcount*100/customcount]));
recordset_temp2.Close ;
new(p);
p^ := recordset_temp.Fields[0].AsInteger ;
listitem.Data :=p;
recordset_temp.Next;
end;
end;
procedure Tform_area_list.BitBtn1Click(Sender: TObject);
var
p:^integer;
begin
//view the custom list in the area 2002-1-30pm
if Apart_list.selected=nil then exit;
p:=apart_list.Selected.Data ;
form_area_user.areaid :=p^;
form_area_user.ShowModal ;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -