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

📄 uform_fw_one.pas

📁 这是在SQL数据库下编写的一个源代码
💻 PAS
字号:
unit Uform_fw_one;

interface

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

type
  Tform_fw_one = class(TForm)
    Panel2: TPanel;
    ListView1: TListView;
    Panel3: TPanel;
    Panel4: TPanel;
    BitBtn3: TBitBtn;
    ImageList1: TImageList;
    recordset_temp: TADOQuery;
    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;
    Label21: TLabel;
    Label22: TLabel;
    Label23: TLabel;
    Label24: TLabel;
    Bevel2: TBevel;
    Label25: TLabel;
    Label26: TLabel;
    procedure FormShow(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure ListView1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    stime:string;
    fw_name:string;
    cc:string;
    id:integer;
    sdate:tdate;
    edate:tdate;
  end;

var
  form_fw_one: Tform_fw_one;

implementation

{$R *.dfm}

procedure Tform_fw_one.FormShow(Sender: TObject);
var
   i:integer;
   ListItem: TListItem;
   p:^integer;
begin
   //单项服务查询 2002-2-1
   listview1.Clear ;
   label22.Caption :=fw_name;
   label24.caption:=stime;
   label26.Caption :=cc;

      label4.Caption :='';
      label5.Caption :='';
      label7.Caption :='';
      label10.Caption :='';
      label12.Caption :='';
      label14.Caption :='';
      label15.Caption :='';
      label17.Caption :='';
      label19.Caption :='';
   recordset_temp.SQL.Clear;
   recordset_temp.SQL.Add('select [JY_ID],[FW_NAME],[FW_DOLLOR],[JY_FWCOUNT],[JY_ALLDOLLOR],[JY_DATE] from [JY],[FW] where [JY_FWID]=[FW_ID] '
      + 'and [JY_DATE]>=#' + datetostr(sdate) + '# and [JY_DATE]<=#' + datetostr(edate+1) + '# and [JY_FWID]=' + inttostr(id));
   recordset_temp.Open  ;

   for i:=1 to recordset_temp.RecordCount do
   begin
      listitem:=listview1.Items.Add ;
      listitem.Caption :=recordset_temp.Fields[1].AsString ;
      listitem.ImageIndex :=0;
      listitem.SubItems.Add(format( '%8.2f¥',[recordset_temp.fields[2].AsFloat]));
      listitem.SubItems.Add(inttostr(recordset_temp.Fields[3].asinteger));
      listitem.SubItems.Add(format( '%8.2f¥',[recordset_temp.fields[4].AsFloat]));
      listitem.SubItems.Add(datetostr(recordset_temp.Fields[5].asdatetime));
      new(p);
      p^ := recordset_temp.Fields[0].AsInteger ;
      listitem.Data :=p;
      recordset_temp.Next;
   end;
   recordset_temp.Close;
end;

procedure Tform_fw_one.BitBtn3Click(Sender: TObject);
begin
   close;
end;

procedure Tform_fw_one.ListView1Click(Sender: TObject);
var
   p:^integer;
begin
   //view the custom information 2002-1-31pm
   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 [JY],[CUSTOM],[AREA],[FROM] where [FROM_ID]=[CUSTOM_FROM] and [AREA_ID]=[CUSTOM_AREA] and [JY_ID]=' + inttostr(p^)
   + ' and [JY_CUSTOMID]=[CUSTOM_ID]');
   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;

end.

⌨️ 快捷键说明

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