📄 u_cx_czjl.pas
字号:
unit U_cx_czjl;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ComCtrls, Grids, DBGrids, ExtCtrls,DateUtils;
type
TForm_cx_czjl = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
DBGrid1: TDBGrid;
Label1: TLabel;
cx_rq: TDateTimePicker;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form_cx_czjl: TForm_cx_czjl;
cx_nian,cx_yue:word;
implementation
uses U_gzda_dm, U_main;
{$R *.dfm}
procedure TForm_cx_czjl.BitBtn3Click(Sender: TObject);
begin
close;
end;
procedure TForm_cx_czjl.BitBtn1Click(Sender: TObject);
begin
cx_nian:=yearof(cx_rq.date);
cx_yue:=monthof(cx_rq.date);
with gzda_dm.ADODataSet_cx do begin
if active then active:=false;
commandtext:='select * from czyjl where (year(jrsj)=:nian) and (month(jrsj)=:yue) order by xh';
Parameters.ParamByName('nian').Value:=cx_nian;
Parameters.ParamByName('yue').Value:=cx_yue;
open;
first;
end;
dbgrid1.SetFocus;
dbgrid1.Refresh;
end;
procedure TForm_cx_czjl.BitBtn2Click(Sender: TObject);
begin
if Application.MessageBox('确实要清除所有操作员记录吗?','提示',MB_YesNO+ MB_DEFBUTTON2) <> IDYes then
Abort;
with gzda_dm.ADOCommand1 do begin
commandtext:='delete from czyjl where (year(jrsj)=:nian) and (month(jrsj)=:yue)';
Parameters.ParamByName('nian').Value:=cx_nian;
Parameters.ParamByName('yue').Value:=cx_yue;
Execute;
end;
with gzda_dm.ADODataSet_cx do begin
if active then active:=false;
commandtext:='select * from czyjl where (year(jrsj)=:nian) and (month(jrsj)=:yue) order by xh';
Parameters.ParamByName('nian').Value:=cx_nian;
Parameters.ParamByName('yue').Value:=cx_yue;
open;
first;
end;
dbgrid1.SetFocus;
dbgrid1.Refresh;
end;
procedure TForm_cx_czjl.FormShow(Sender: TObject);
begin
cx_rq.Date:=now;
if copy(Form_main.main_czrybm,1,1)<>'1' then bitbtn2.Enabled:=false;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -