📄 uy_yyt_rt.pas
字号:
unit uy_yyt_rt;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, Grids, DBGrids,u_main, Tabs, DBTables, Db;
type
Ty_yyt_rt = class(TForm)
DBGrid1: TDBGrid;
TabSet1: TTabSet;
q_xt: TQuery;
q_xtth: TStringField;
q_xttm: TStringField;
q_xttht: TStringField;
q_xtzws: TIntegerField;
q_xtfwfl: TFloatField;
q_xtdzl: TFloatField;
q_xtsfbz: TFloatField;
q_xtfwyh: TStringField;
q_xtfwym: TStringField;
q_xtsfbj: TStringField;
q_xtzt: TStringField;
dq_xt: TDataSource;
procedure DBGrid1KeyPress(Sender: TObject; var Key: Char);
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure DBGrid1DblClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TabSet1Change(Sender: TObject; NewTab: Integer;
var AllowChange: Boolean);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
y_yyt_rt: Ty_yyt_rt;
implementation
{$R *.DFM}
procedure Ty_yyt_rt.DBGrid1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
if (TabSet1.TabIndex=4) or (TabSet1.TabIndex=3) then
begin
messagebox(handle,'您选择的厅台不可用,请重新选择!','系统提示信息',MB_OK+MB_ICONWARNING);
exit;
end;
if q_xt.recordcount=0 then exit;
esc_enter:=1;
close;
end;
end;
procedure Ty_yyt_rt.FormKeyPress(Sender: TObject; var Key: Char);
begin
if key=#27 then close;
end;
procedure Ty_yyt_rt.DBGrid1DblClick(Sender: TObject);
begin
if q_xt.recordcount=0 then exit;
if (TabSet1.TabIndex=4) or (TabSet1.TabIndex=3) then
begin
messagebox(handle,'您选择的厅台不可用,请重新选择!','系统提示信息',MB_OK+MB_ICONWARNING);
exit;
end;
esc_enter:=1;
close;
end;
procedure Ty_yyt_rt.FormShow(Sender: TObject);
begin
TabSet1.TabIndex:=0;
s_sql:='select th,tm,tht,zws,fwfl,dzl,sfbz,sfbj,fwyh,fwym,tai_zt.zt from t,tai,tai_zt where (zt="2" or zt="4") and (t.th=tai.th) and (tai.zt=tai_zt.bh)';
// select th,tm,tht,zws,fwfl,dzl,sfbz,sfbj,fwyh,fwym,tai_zt.zt from t,tai,tai_zt where (zt="2" or zt="4") and (t.th=tai.th) and (tai.zt=tai_zt.bh)
with q_xt do
begin
DisableControls;
sql.Clear;
sql.add(s_sql);
active:=false;
active:=true;
EnableControls;
end;
end;
procedure Ty_yyt_rt.TabSet1Change(Sender: TObject; NewTab: Integer;
var AllowChange: Boolean);
begin
case newtab of
0:s_sql:='select th,tm,tht,zws,fwfl,dzl,sfbz,sfbj,fwyh,fwym,tai_zt.zt from t,tai,tai_zt where (zt="2" or zt="4" or zt="5") and (t.th=tai.th) and (tai.zt=tai_zt.bh)';
1:s_sql:='select th,tm,tht,zws,fwfl,dzl,sfbz,sfbj,fwyh,fwym,tai_zt.zt from t,tai,tai_zt where (zt="2" ) and (t.th=tai.th) and (tai.zt=tai_zt.bh)';
2:s_sql:='select th,tm,tht,zws,fwfl,dzl,sfbz,sfbj,fwyh,fwym,tai_zt.zt from t,tai,tai_zt where (zt="5") and (t.th=tai.th) and (tai.zt=tai_zt.bh)';
3:s_sql:='select th,tm,tht,zws,fwfl,dzl,sfbz,sfbj,fwyh,fwym,tai_zt.zt from t,tai,tai_zt where (zt="1") and (t.th=tai.th) and (tai.zt=tai_zt.bh)';
4:s_sql:='select th,tm,tht,zws,fwfl,dzl,sfbz,sfbj,fwyh,fwym,tai_zt.zt from t,tai,tai_zt where (zt="3") and (t.th=tai.th) and (tai.zt=tai_zt.bh)';
5:s_sql:='select th,tm,tht,zws,fwfl,dzl,sfbz,sfbj,fwyh,fwym,tai_zt.zt from t,tai,tai_zt where (zt="4") and (t.th=tai.th) and (tai.zt=tai_zt.bh)';
end;
with q_xt do
begin
DisableControls;
sql.Clear;
sql.add(s_sql);
active:=false;
active:=true;
EnableControls;
end;
end;
procedure Ty_yyt_rt.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case key of
69:tabset1.tabindex:=0;
75:tabset1.tabindex:=1;
89:tabset1.tabindex:=2;
85:tabset1.tabindex:=3;
88:tabset1.tabindex:=4;
87:tabset1.tabindex:=5;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -