📄 us_zhsz.pas
字号:
unit us_zhsz;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Grids, DBGrids, StdCtrls, ExtCtrls, DBCtrls, ComCtrls, ToolWin, Menus,
ImgList, Db, DBTables;
type
Ts_zhsz = class(TForm)
DBGrid1: TDBGrid;
CoolBar1: TCoolBar;
ToolBar1: TToolBar;
xz: TToolButton;
sc: TToolButton;
bj: TToolButton;
bc: TToolButton;
qx: TToolButton;
ToolButton6: TToolButton;
tc: TToolButton;
MainMenu1: TMainMenu;
N1: TMenuItem;
H1: TMenuItem;
N2: TMenuItem;
D1: TMenuItem;
E1: TMenuItem;
S1: TMenuItem;
C1: TMenuItem;
N3: TMenuItem;
X1: TMenuItem;
ImageList1: TImageList;
CoolBar2: TCoolBar;
ToolBar2: TToolBar;
ComboBox1: TComboBox;
fg1: TToolButton;
fg2: TToolButton;
N4: TMenuItem;
N5: TMenuItem;
y_jzfs: TTable;
y_jzfsJZFSH: TStringField;
y_jzfsJzfs: TStringField;
y_jzfsD_yn: TBooleanField;
dy_jzfs: TDataSource;
srlb: TTable;
srlbBH: TStringField;
srlbSrlb: TStringField;
srlbD_yn: TBooleanField;
d_srlb: TDataSource;
jzfs: TTable;
jzfsBh: TStringField;
jzfsJzfs: TStringField;
d_jzfs: TDataSource;
cydw: TTable;
cydwBh: TStringField;
cydwDW: TStringField;
cydwD_yn: TBooleanField;
d_cydw: TDataSource;
yylx: TTable;
yylxBH: TStringField;
yylxYylx: TStringField;
yylxSJ1: TDateTimeField;
yylxSJ2: TDateTimeField;
yylxD_yn: TBooleanField;
d_yylx: TDataSource;
tcyy: TTable;
tcyyBH: TStringField;
tcyyTcyy: TStringField;
tcyyD_yn: TBooleanField;
d_tcyy: TDataSource;
xflb: TTable;
xflbLBH: TStringField;
xflbLBMC: TStringField;
xflbDZL: TFloatField;
d_xflb: TDataSource;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
procedure tcClick(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure scClick(Sender: TObject);
procedure bcClick(Sender: TObject);
procedure qxClick(Sender: TObject);
procedure xzClick(Sender: TObject);
procedure DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure tcyyNewRecord(DataSet: TDataSet);
procedure jzfsNewRecord(DataSet: TDataSet);
procedure srlbNewRecord(DataSet: TDataSet);
procedure yylxNewRecord(DataSet: TDataSet);
procedure y_jzfsNewRecord(DataSet: TDataSet);
procedure N7Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure ToolButton6Click(Sender: TObject);
procedure N9Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
s_zhsz: Ts_zhsz;
mytable:Ttable;
implementation
uses u_main, uabout;
{$R *.DFM}
procedure Ts_zhsz.tcClick(Sender: TObject);
begin
mytable.cancel;
close;
end;
procedure Ts_zhsz.ComboBox1Change(Sender: TObject);
begin
{ 菜肴单位;结帐方式,退菜原因;营业类型,收入类别 }
case ComboBox1.itemindex of
0:
begin
mytable:=cydw;
DBGrid1.DataSource:=d_cydw;
end;
1:
begin
mytable:=y_jzfs;
DBGrid1.DataSource:=dy_jzfs;
end;
2:
begin
mytable:=tcyy;
DBGrid1.DataSource:=d_tcyy;
end;
3:
begin
mytable:=yylx;
DBGrid1.DataSource:=d_yylx;
end;
4:
begin
mytable:=srlb;
DBGrid1.DataSource:=d_srlb;
end;
end;
end;
procedure Ts_zhsz.scClick(Sender: TObject);
begin
if messagebox(handle,'您真的要删除当前信息吗?','系统提示信息',MB_OKCANCEL+MB_ICONQUESTION)=IDcancel then exit;
mytable.delete;
end;
procedure Ts_zhsz.bcClick(Sender: TObject);
begin
mytable.Edit;
mytable.post;
end;
procedure Ts_zhsz.qxClick(Sender: TObject);
begin
mytable.Cancel;
end;
procedure Ts_zhsz.xzClick(Sender: TObject);
begin
mytable.append;
end;
procedure Ts_zhsz.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if mytable.fieldbyname('d_yn').asboolean=false then
begin
sc.Enabled:=true;
bj.Enabled:=true;
DBGrid1.ReadOnly:=false;
end
else
begin
sc.Enabled:=false;
bj.Enabled:=false;
DBGrid1.Canvas.Font.Color:=clmenu;
DBGrid1.DefaultDrawColumnCell(rect,datacol,column,state);
DBGrid1.ReadOnly:=true;
end
end;
procedure Ts_zhsz.FormShow(Sender: TObject);
begin
if not y_jzfs.Active then y_jzfs.Active:=true;
if not srlb.Active then srlb.Active:=true;
if not yylx.Active then yylx.Active:=true;
if not cydw.Active then cydw.Active:=true;
if not jzfs.Active then jzfs.Active:=true;
if not xflb.Active then xflb.Active:=true;
if not tcyy.Active then tcyy.Active:=true;
mytable:=cydw;
DBGrid1.datasource:=d_cydw;
end;
procedure Ts_zhsz.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Release;
s_zhsz:=NIL;
end;
procedure Ts_zhsz.tcyyNewRecord(DataSet: TDataSet);
begin
tcyy.FieldByName('bh').asstring:=inttostr(main.h_n_bh('select max(bh) as bh from tcyy'));
end;
procedure Ts_zhsz.jzfsNewRecord(DataSet: TDataSet);
begin
y_jzfs.FieldByName('jzfsh').asstring:=inttostr(main.h_n_bh('select max(jzfsh) as bh from y_jzfs'));
end;
procedure Ts_zhsz.srlbNewRecord(DataSet: TDataSet);
begin
srlb.FieldByName('bh').asstring:=inttostr(main.h_n_bh('select max(bh) as bh from srlb'));
end;
procedure Ts_zhsz.yylxNewRecord(DataSet: TDataSet);
begin
yylx.FieldByName('bh').asstring:=inttostr(main.h_n_bh('select max(bh) as bh from yylx'));
end;
procedure Ts_zhsz.y_jzfsNewRecord(DataSet: TDataSet);
begin
cydw.FieldByName('bh').asstring:=inttostr(main.h_n_bh('select max(bh) as bh from cydw'));
end;
procedure Ts_zhsz.N7Click(Sender: TObject);
begin
if about=NIL then about:=Tabout.Create(self);
about.showmodal;
end;
procedure Ts_zhsz.N5Click(Sender: TObject);
begin
Application.HelpFile:='\hbjd\cyzy\help\hbcy.hlp';
Application.HelpCommand(Help_Finder,0);
end;
procedure Ts_zhsz.ToolButton6Click(Sender: TObject);
begin
Application.HelpFile:='\hbjd\cyzy\help\hbcy.hlp';
Application.HelpJump('taszhsz');
end;
procedure Ts_zhsz.N9Click(Sender: TObject);
begin
Application.HelpFile:='\hbjd\cyzy\help\hbcy.hlp';
Application.HelpCommand(Help_PartialKey,0);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -