📄 unit6.pas
字号:
unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, DBTables;
type
TForm6 = class(TForm)
Query1: TQuery;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
RG: TRadioGroup;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form6: TForm6;
implementation
{$R *.dfm}
procedure TForm6.Button1Click(Sender: TObject);
begin
case rg.ItemIndex of
0:begin
if length(trim(edit1.Text ))=0 then
begin
messagedlg('没有输入商品名称,重新输入',mterror,[mbok],0);
edit1.SetFocus ;
exit;
end;
with query1 do
begin
close;
sql.Clear ;
sql.Add('select * from 入库单 ');
sql.Add('where 商品名称=:id');
parambyname('id').AsString :=trim(edit1.Text );
open;
if recordcount>0 then
dbgrid1.Enabled :=true
else
begin
messagedlg('所要查找的商品并不存在,请您重新核对',mtinformation,[mbok],0);
dbgrid1.Enabled :=false;
end;
end;
end;
1:begin
if length(trim(edit1.Text ))=0 then
begin
messagedlg('没有输入入库日期,重新输入',mterror,[mbok],0);
edit1.SetFocus ;
exit;
end;
with query1 do
begin
close;
sql.Clear ;
sql.add( 'select * from 入库单 ');
sql.Add(' where 入库日期=:rq');
parambyname('rq').Value :=strtodate(edit1.Text );
open;
if recordcount>0 then
dbgrid1.Enabled :=true
else
begin
messagedlg('所要查找的商品并不存在,请您重新核对',mtinformation,[mbok],0);
dbgrid1.Enabled :=false;
end;
end;
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -