You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

226 lines
5.9 KiB
Plaintext

11 months ago
unit u_info_tell_manage;
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, bsSkinTabs;
type
Tfrm_info_tell_manage = class(TForm)
t_info_tell: TADOQuery;
t_info_tell1: TDataSource;
bsSkinPanel1: TbsSkinPanel;
bsSkinPanel2: TbsSkinPanel;
Label1: TLabel;
Label2: TLabel;
DBEdit1: TDBEdit;
bsSkinDBCheckRadioBox1: TbsSkinDBCheckRadioBox;
wwDBDateTimePicker1: TwwDBDateTimePicker;
dxDBGrid1: TdxDBGrid;
Panel1: TPanel;
bsSkinButton7: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinButton8: TbsSkinButton;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridDateColumn;
dxDBGrid1Column3: TdxDBGridCheckColumn;
dxDBGrid1Column4: TdxDBGridDateColumn;
DBRichEdit1: TDBRichEdit;
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_tellAfterInsert(DataSet: TDataSet);
procedure t_info_tellBeforePost(DataSet: TDataSet);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormResize(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure t_info_tellAfterPost(DataSet: TDataSet);
procedure t_info_tellBeforeEdit(DataSet: TDataSet);
procedure bsSkinButton2Click(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_tell_manage: Tfrm_info_tell_manage;
implementation
uses u_main, u_info_tell_query, my_sys_function;
{$R *.dfm}
procedure Tfrm_info_tell_manage.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_info_tell_manage.Hide;
frm_info_tell_manage.ManualFloat(frm_info_tell_manage.BoundsRect );
frm_main.freeTabs('frm_info_tell_manage');
action:=cafree;
frm_info_tell_manage:=nil;
frm_main.t_info_tell.requery;
frm_main.Timer1.Interval:=10000;
frm_main.Timer1.enabled:=true;
end;
procedure Tfrm_info_tell_manage.FormShow(Sender: TObject);
begin
t_info_tell.Parameters[0].Value:=employee;
t_info_tell.open;
frm_main.Timer1.Enabled:=false;
end;
procedure Tfrm_info_tell_manage.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_info_tell_manage.bsSkinButton7Click(Sender: TObject);
begin
table_Prior(t_info_tell);
end;
procedure Tfrm_info_tell_manage.bsSkinButton6Click(Sender: TObject);
begin
table_next(t_info_tell);
end;
procedure Tfrm_info_tell_manage.bsSkinButton8Click(Sender: TObject);
begin
table_post(t_info_tell);
end;
procedure Tfrm_info_tell_manage.bsSkinButton4Click(Sender: TObject);
begin
table_delete(t_info_tell);
end;
procedure Tfrm_info_tell_manage.bsSkinButton3Click(Sender: TObject);
begin
table_cancel(t_info_tell);
end;
procedure Tfrm_info_tell_manage.bsSkinButton1Click(Sender: TObject);
begin
t_info_tell.insert;
end;
procedure Tfrm_info_tell_manage.t_info_tellAfterInsert(DataSet: TDataSet);
begin
t_info_tell['¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
t_info_tell['¼<><C2BC><EFBFBD><EFBFBD>']:=employee;
t_info_tell['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
DBEdit1.SetFocus;
end;
procedure Tfrm_info_tell_manage.t_info_tellBeforePost(DataSet: TDataSet);
begin
table_before_post(t_info_tell,'<27><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>');
table_before_post(t_info_tell,'<27>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD>');
table_before_post(t_info_tell,'<27><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>');
end;
procedure Tfrm_info_tell_manage.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
CanClose:=close_query(t_info_tell);
end;
procedure Tfrm_info_tell_manage.FormResize(Sender: TObject);
var
i:integer;
begin
i:=round(panel1.Width/9);
bsSkinButton7.Width:=i;
bsSkinButton6.Width:=i;
bsSkinButton10.Width:=i;
bsSkinButton1.Width:=i;
bsSkinButton2.Width:=i;
bsSkinButton4.Width:=i;
bsSkinButton3.Width:=i;
bsSkinButton8.Width:=i;
end;
procedure Tfrm_info_tell_manage.bsSkinButton10Click(Sender: TObject);
begin
try
frm_info_tell_query:=tfrm_info_tell_query.Create (self);
frm_info_tell_query.ShowModal;
finally
frm_info_tell_query.Free;
end;
end;
procedure Tfrm_info_tell_manage.t_info_tellAfterPost(DataSet: TDataSet);
begin
frm_main.t_info_tell.Requery();
end;
procedure Tfrm_info_tell_manage.t_info_tellBeforeEdit(DataSet: TDataSet);
begin
if modify_all=false then
begin
if t_info_tell.FieldByName('<27>Ƿ<EFBFBD>֪<EFBFBD><D6AA>').asboolean then
begin
showmessage('<27><><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD><EFBFBD>ܸ<EFBFBD><DCB8>ģ<EFBFBD><C4A3><EFBFBD>');
abort;
end;
end
else
modify_all:=false;
end;
procedure Tfrm_info_tell_manage.bsSkinButton2Click(Sender: TObject);
begin
if t_info_tell.IsEmpty then
exit;
if t_info_tell.FieldByName('<27>Ƿ<EFBFBD>֪<EFBFBD><D6AA>').asboolean then
begin
modify_all:=true;
t_info_tell.edit;
t_info_tell['<27>Ƿ<EFBFBD>֪<EFBFBD><D6AA>']:=0;
t_info_tell.post;
end
else
begin
modify_all:=true;
t_info_tell.edit;
t_info_tell['<27>Ƿ<EFBFBD>֪<EFBFBD><D6AA>']:=1;
t_info_tell.post;
end;
end;
procedure Tfrm_info_tell_manage.DBEdit1KeyPress(Sender: TObject;
var Key: Char);
begin
key_wwDBDateTimePicker(Key,wwDBDateTimePicker1);
end;
procedure Tfrm_info_tell_manage.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort(Column,t_info_tell,'<27><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>');
end;
end.