📄 ckcx.~pas
字号:
unit ckcx;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ADODB, DB, Grids, DBGrids, StdCtrls, Buttons;
type
Tckcxfrm = class(TForm)
GroupBox1: TGroupBox;
RadioButton1: TRadioButton;
Edit1: TEdit;
RadioButton2: TRadioButton;
BitBtn1: TBitBtn;
GroupBox2: TGroupBox;
DBGrid1: TDBGrid;
DataSource1: TDataSource;
ADOTable1: TADOTable;
ADOQuery1: TADOQuery;
BitBtn2: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ckcxfrm: Tckcxfrm;
implementation
uses main, cxckxx;
{$R *.dfm}
procedure Tckcxfrm.BitBtn1Click(Sender: TObject);
var query:string;
begin
if radiobutton1.Checked=true then
if edit1.Text='' then
showmessage('请输入相应的查询条件!')
else
query:='select * from SELL where sellid='+''''+edit1.Text+'''';
if radiobutton2.Checked=true then
query:='select * from SELL';
if query<>'' then
begin
with adoquery1 do
begin
close;
sql.Clear;
sql.Add(query);
open;
first;
if recordcount=0 then
begin
showmessage('没有符合条件的查询!');
edit1.SetFocus;
end
else
begin
dbgrid1.Columns[0].FieldName:='sellid';
dbgrid1.Columns[1].FieldName:='customerid';
dbgrid1.Columns[2].FieldName:='customername';
dbgrid1.Columns[3].FieldName:='depotid';
dbgrid1.Columns[4].FieldName:='depotname';
dbgrid1.Columns[5].FieldName:='productid';
dbgrid1.Columns[6].FieldName:='productname';
dbgrid1.Columns[7].FieldName:='spec';
dbgrid1.Columns[8].FieldName:='unit';
dbgrid1.Columns[9].FieldName:='quantity';
dbgrid1.Columns[10].FieldName:='unitprice';
dbgrid1.Columns[11].FieldName:='payment';
dbgrid1.Columns[12].FieldName:='selldate';
dbgrid1.Columns[13].FieldName:='sellremark';
end;
end;
end;
end;
procedure Tckcxfrm.BitBtn2Click(Sender: TObject);
begin
mainfrm.Show;
ckcxfrm.Hide;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -