|
|
unit u_info_rules;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, DB, ADODB, dxExEdtr, bsSkinCtrls, ExtCtrls, dxDBTLCl, dxGrClms,
|
|
|
dxDBCtrl, dxDBGrid, dxTL, dxCntner, StdCtrls, ComCtrls, DBCtrls,
|
|
|
wwdbdatetimepicker, bsdbctrls, Mask;
|
|
|
|
|
|
type
|
|
|
Tfrm_info_rules = class(TForm)
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
Label1: TLabel;
|
|
|
DBEdit1: TDBEdit;
|
|
|
DBRichEdit1: TDBRichEdit;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
Panel1: TPanel;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
bsSkinButton8: TbsSkinButton;
|
|
|
t_info_rules: TADOQuery;
|
|
|
t_info_rules1: TDataSource;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column3: TdxDBGridDateColumn;
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure bsSkinButton8Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure t_info_rulesAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_info_rulesBeforePost(DataSet: TDataSet);
|
|
|
procedure t_info_rulesBeforeEdit(DataSet: TDataSet);
|
|
|
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
|
|
procedure FormResize(Sender: TObject);
|
|
|
procedure DBEdit1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_info_rules: Tfrm_info_rules;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, my_sys_function;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_info_rules.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
frm_info_rules.Hide;
|
|
|
frm_info_rules.ManualFloat(frm_info_rules.BoundsRect );
|
|
|
frm_main.freeTabs('frm_info_rules');
|
|
|
action:=cafree;
|
|
|
frm_info_rules:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
t_info_rules.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.bsSkinButton7Click(Sender: TObject);
|
|
|
begin
|
|
|
table_Prior(t_info_rules);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.bsSkinButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
table_next(t_info_rules);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.bsSkinButton8Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_info_rules);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
table_delete(t_info_rules);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
table_cancel(t_info_rules);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.bsSkinButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
t_info_rules.insert;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.t_info_rulesAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_info_rules['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
|
|
|
t_info_rules['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
|
|
|
DBEdit1.SetFocus;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.t_info_rulesBeforePost(DataSet: TDataSet);
|
|
|
begin
|
|
|
table_before_post(t_info_rules,'<27><><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD>');
|
|
|
table_before_post(t_info_rules,'<27><><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.t_info_rulesBeforeEdit(DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_info_rules.fieldbyname('¼<><C2BC><EFBFBD><EFBFBD>').asstring<>employee then
|
|
|
begin
|
|
|
showmessage('<27>Բ<EFBFBD><D4B2>𣬴˹<F0A3ACB4><CBB9>治<EFBFBD><E6B2BB><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>ģ<DEB8><C4A3><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.FormCloseQuery(Sender: TObject;
|
|
|
var CanClose: Boolean);
|
|
|
begin
|
|
|
CanClose:=close_query(t_info_rules);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.FormResize(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
i:=round(panel1.Width/7);
|
|
|
bsSkinButton7.Width:=i;
|
|
|
bsSkinButton8.Width:=i;
|
|
|
bsSkinButton6.Width:=i;
|
|
|
bsSkinButton1.Width:=i;
|
|
|
bsSkinButton4.Width:=i;
|
|
|
bsSkinButton3.Width:=i;
|
|
|
DBEdit1.Width:=bsSkinPanel2.Width-DBEdit1.Left-6;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.DBEdit1KeyPress(Sender: TObject; var Key: Char);
|
|
|
begin
|
|
|
if key=#13 then
|
|
|
begin
|
|
|
key:=#0;
|
|
|
DBRichEdit1.SetFocus;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_rules.dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
begin
|
|
|
Column_sort(Column,t_info_rules,'<27><><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
end.
|