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

📄 uform_area_user.pas

📁 Delphi应用婚纱系统 Delphi应用婚纱系统
💻 PAS
字号:
unit Uform_area_user;
//显示某个区域的客户列表
interface

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

type
  Tform_area_user = class(TForm)
    Panel1: TPanel;
    Image1: TImage;
    Label2: TLabel;
    Label4: TLabel;
    Label3: TLabel;
    Label1: TLabel;
    Bevel1: TBevel;
    Image2: TImage;
    ImageList1: TImageList;
    recordset_temp: TADOQuery;
    Panel2: TPanel;
    Panel3: TPanel;
    Panel4: TPanel;
    BitBtn3: TBitBtn;
    BitBtn1: TBitBtn;
    Apart_list: TListView;
    Label5: TLabel;
    Label6: TLabel;
    procedure FormShow(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    areaid:integer;
    intCount:integer;
  end;

var
  form_area_user: Tform_area_user;

implementation

uses Uform_dollor_list;

{$R *.dfm}

procedure Tform_area_user.FormShow(Sender: TObject);
//初始化窗口显示
var
   i:integer;
   ListItem: TListItem;
   p:^integer;
begin
   //向数据库查询某区域的客户
   apart_list.Items.Clear ;
   recordset_temp.SQL.Clear;
   recordset_temp.SQL.Add('select * from [AREA] where [AREA_ID]=' + inttostr(areaid));
   recordset_temp.Open  ;
   if recordset_temp.RecordCount >0 then label5.Caption :=recordset_temp.Fields[1].AsString ;
   recordset_temp.close;
   recordset_temp.SQL.Clear ;
   recordset_temp.SQL.Add (
    'select [CUSTOM_ID],[CUSTOM_CODE],[CUSTOM_MNAME],[CUSTOM_FNAME],[CUSTOM_TEL],[AREA_NAME],[CUSTOM_ADD],[FROM_NAME],[CUSTOM_POST],[CUSTOM_DATE] ' +
    'from [CUSTOM],[AREA],[FROM] '+
    'where [CUSTOM_AREA]=[AREA_ID] and [CUSTOM_FROM]=[FROM_ID] and [CUSTOM_AREA]=' + inttostr(areaid));
   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;
      listitem.SubItems.Add(recordset_temp.Fields[2].asstring);
      listitem.SubItems.Add(recordset_temp.Fields[3].asstring);
      listitem.SubItems.Add(recordset_temp.Fields[4].asstring);
      listitem.SubItems.Add(recordset_temp.Fields[5].asstring);
      listitem.SubItems.Add(recordset_temp.Fields[6].asstring);
      listitem.SubItems.Add(recordset_temp.Fields[7].asstring);
      listitem.SubItems.Add(recordset_temp.Fields[8].asstring);
      listitem.SubItems.Add(DateTimeToStr(recordset_temp.Fields[9].AsDateTime));
      new(p);
      p^ := recordset_temp.Fields[0].AsInteger ;
      listitem.Data :=p;
      recordset_temp.Next;
   end;
   recordset_temp.close;
end;

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

procedure Tform_area_user.BitBtn1Click(Sender: TObject);
//查看客户的消费纪录
var
   p:^integer;
begin
   if Apart_list.selected=nil then exit;
   p:=apart_list.Selected.Data ;
   form_dollor_list.cid:=p^;
   form_dollor_list.ShowModal ;
end;

end.

⌨️ 快捷键说明

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