📄 fzycx.pas
字号:
unit Fzycx;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Fbase, Buttons, Grids, DBGrids, ToolWin, ComCtrls, DB, ADODB,
ExtCtrls, StdCtrls;
type
TF_zycx = class(TF_base)
ToolBar1: TToolBar;
DBGrid1: TDBGrid;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
ADOQuery1: TADOQuery;
DataSource1: TDataSource;
Panel1: TPanel;
GroupBox1: TGroupBox;
ComboBox1: TComboBox;
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
ToolButton6: TToolButton;
SpeedButton5: TSpeedButton;
ToolButton7: TToolButton;
procedure FormShow(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure getspbh(sender:Tobject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
change:boolean;
spbh:string;
end;
var
F_zycx: TF_zycx;
implementation
uses Fzyjbcx,Fdm;
{$R *.dfm}
procedure TF_zycx.getspbh(sender:Tobject);
begin
adoquery1.Last;
if adoquery1.RecordCount=0 then
spbh:='E'+formatfloat('00000',1)
else
spbh:='E'+Formatfloat('00000',strtoint(copy(adoquery1.Fields[0].AsString,2,5))+1);
end;
procedure TF_zycx.FormShow(Sender: TObject);
begin
inherited;
change:=False;
with adoquery1 do
begin
Close;
SQL.Clear;
SQL.Add('Select * from tb_employ order by employecode asc'); //排序
Open;
end;
end;
procedure TF_zycx.SpeedButton4Click(Sender: TObject);
begin
inherited;
Application.CreateForm(TF_zyjbcx, F_zyjbcx);
F_zyjbcx.ShowModal;
F_zyjbcx.Free;
end;
procedure TF_zycx.SpeedButton3Click(Sender: TObject);
begin
inherited;
change:=True;
Application.CreateForm(TF_zyjbcx, F_zyjbcx);
F_zyjbcx.ShowModal;
F_zyjbcx.Free;
end;
procedure TF_zycx.SpeedButton2Click(Sender: TObject);
begin
inherited;
try
if Application.MessageBox('是否删除当前记录?','提示',mb_yesno)=id_yes then
Adoquery1.Delete;
except
Application.MessageBox('不能删除','提示',mb_yesno);
end;
end;
procedure TF_zycx.SpeedButton1Click(Sender: TObject);
var
searchwhat:string;
begin
inherited;
Panel1.Visible:=not(Panel1.Visible);
if Panel1.Visible=False then
begin
searchwhat:='';
case combobox1.ItemIndex of
0: searchwhat:='employecode';
1: searchwhat:='fullname';
2: searchwhat:='name';
3: searchwhat:='shortcode';
end;
try
with ADoquery1 do
begin
Close;
SQL.Clear;
SQL.Add('select * from tb_employ ');
SQL.Add('where '+''+searchwhat+''+' like :a order by employecode');
parameters.ParamByName('a').Value:='%'+Trim(Edit1.Text)+'%';
open;
end;
if Application.MessageBox('是否刷新表?','提示',mb_yesno)=Id_yes then
with ADoquery1 do
begin
Close;
SQL.Clear;
SQL.Add('select * from tb_employ order by employecode');
open;
end;
except
Application.MessageBox('请正确输入条件','提示',mb_ok);
end;
end;
end;
procedure TF_zycx.SpeedButton5Click(Sender: TObject);
begin
inherited;
Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -