【delphi开源代码栏目提醒】:网学会员--在 delphi开源代码编辑为广大网友搜集整理了:comfind.pas绩等信息,祝愿广大网友取得需要的信息,参考学习。
unit comfind;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, StdCtrls, DB, ADODB, DBClient,cominfo_unit;
type
Tcomfindfrm = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
comfind_dbg1: TDBGrid;
comfind_dbg2: TDBGrid;
comfind_ds1: TDataSource;
comfind_ds2: TDataSource;
comfind_cds1: TClientDataSet;
comfind_cds2: TClientDataSet;
procedure Button1Click(Sender: TObject);
private
cominfo:Tcominfo;
{ Private declarations }
public
{ Public declarations }
end;
var
comfindfrm: Tcomfindfrm;
implementation
{$R *.dfm}
procedure Tcomfindfrm.Button1Click(Sender: TObject);
begin
//实例化类
cominfo:=Tcominfo.create ;
//判断查询时是否输入商品编号
if edit1.Text='' then
begin
showmessage('请输入商品编号查询!');
exit;
end;
//查询该商品编号在商品信息中是否存在
if cominfo.ComRec(edit1.Text)=false then
begin
showmessage('商品基础信息中不存在该商品编号!');
exit;
end;
//查询显示商品的基本信息
comfind_cds1.Data:=cominfo.ComRecs(edit1.Text);
//查询显示商品的价格信息
comfind_cds2.Data :=cominfo.ComPrice(edit1.Text);
//释放实例
cominfo.Free;
end;
end.