f_product_id.pas

来自「使用Delphi开发的成本管理系统」· PAS 代码 · 共 55 行

PAS
55
字号
unit f_product_id;

interface

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

type
  Tw_product_id = class(TForm)
    Panel1: TPanel;
    ComboBox1: TComboBox;
    Label1: TLabel;
    BitBtn2: TBitBtn;
    BitBtn1: TBitBtn;
    ado_product: TADOQuery;
    ado_productproduct_id: TStringField;
    ado_productproduct_name: TStringField;
    ado_productproduct_amount: TIntegerField;
    ado_productproduct_price: TFloatField;
    procedure FormCreate(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  w_product_id: Tw_product_id;

implementation

{$R *.dfm}

procedure Tw_product_id.FormCreate(Sender: TObject);
begin
   ado_product.Close;
   ado_product.SQL.Clear;
   ado_product.SQL.Add('select* from product');
   ado_product.Open;
   ado_product.First;
while not ado_product.eof do
begin
combobox1.items.add(trim(ado_product.fieldbyname('product_id').asString)+'  ---  '+trim(ado_product.fieldbyname('product_name').asString));
ado_product.next;
end;
end;
procedure Tw_product_id.BitBtn2Click(Sender: TObject);
begin
close;
end;

end.

⌨️ 快捷键说明

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