|
|
unit u_info_bulletin_manage;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
Dialogs, DB, ADODB, dxExEdtr, StdCtrls, ComCtrls, DBCtrls, Mask, dxTL,
|
|
|
dxDBCtrl, dxDBGrid, dxCntner, bsSkinCtrls, ExtCtrls;
|
|
|
|
|
|
type
|
|
|
Tfrm_info_bulletin_manage = class(TForm)
|
|
|
t_info_bulletin: TADOQuery;
|
|
|
t_info_bulletin1: TDataSource;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
Label1: TLabel;
|
|
|
DBEdit1: TDBEdit;
|
|
|
Label2: TLabel;
|
|
|
DBEdit2: TDBEdit;
|
|
|
Label3: TLabel;
|
|
|
DBEdit3: TDBEdit;
|
|
|
DBRichEdit1: TDBRichEdit;
|
|
|
DBEdit4: TDBEdit;
|
|
|
Label4: TLabel;
|
|
|
dxDBGrid1Column3: TdxDBGridColumn;
|
|
|
dxDBGrid1Column4: TdxDBGridColumn;
|
|
|
Panel1: TPanel;
|
|
|
bsSkinButton7: TbsSkinButton;
|
|
|
bsSkinButton6: TbsSkinButton;
|
|
|
bsSkinButton10: TbsSkinButton;
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton4: TbsSkinButton;
|
|
|
bsSkinButton3: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure bsSkinButton7Click(Sender: TObject);
|
|
|
procedure bsSkinButton6Click(Sender: TObject);
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton4Click(Sender: TObject);
|
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
procedure t_info_bulletinAfterInsert(DataSet: TDataSet);
|
|
|
procedure t_info_bulletinBeforePost(DataSet: TDataSet);
|
|
|
procedure t_info_bulletinBeforeEdit(DataSet: TDataSet);
|
|
|
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
|
|
procedure FormResize(Sender: TObject);
|
|
|
procedure bsSkinButton10Click(Sender: TObject);
|
|
|
procedure t_info_bulletinAfterPost(DataSet: TDataSet);
|
|
|
procedure t_info_bulletinBeforeCancel(DataSet: TDataSet);
|
|
|
procedure t_info_bulletinAfterDelete(DataSet: TDataSet);
|
|
|
procedure DBEdit1KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure DBEdit2KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure DBEdit3KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure DBEdit4KeyPress(Sender: TObject; var Key: Char);
|
|
|
procedure dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
frm_info_bulletin_manage: Tfrm_info_bulletin_manage;
|
|
|
bulletin_manage_insert:boolean;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_main, my_sys_function, u_info_bulletin_query, my_sys_chat;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.FormClose(Sender: TObject;
|
|
|
var Action: TCloseAction);
|
|
|
begin
|
|
|
frm_info_bulletin_manage.Hide;
|
|
|
frm_info_bulletin_manage.ManualFloat(frm_info_bulletin_manage.BoundsRect );
|
|
|
frm_main.freeTabs('frm_info_bulletin_manage');
|
|
|
action:=cafree;
|
|
|
frm_info_bulletin_manage:=nil;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.FormShow(Sender: TObject);
|
|
|
begin
|
|
|
t_info_bulletin.Parameters[0].Value:=date;
|
|
|
t_info_bulletin.Parameters[1].Value:=employee;
|
|
|
t_info_bulletin.open;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
close;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.bsSkinButton7Click(Sender: TObject);
|
|
|
begin
|
|
|
table_Prior(t_info_bulletin);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.bsSkinButton6Click(Sender: TObject);
|
|
|
begin
|
|
|
table_next(t_info_bulletin);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.bsSkinButton2Click(Sender: TObject);
|
|
|
begin
|
|
|
table_post(t_info_bulletin);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.bsSkinButton4Click(Sender: TObject);
|
|
|
begin
|
|
|
table_delete(t_info_bulletin);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.bsSkinButton3Click(Sender: TObject);
|
|
|
begin
|
|
|
table_cancel(t_info_bulletin);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.bsSkinButton1Click(Sender: TObject);
|
|
|
begin
|
|
|
t_info_bulletin.insert;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.t_info_bulletinAfterInsert(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
t_info_bulletin['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=date;
|
|
|
t_info_bulletin['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=employee;
|
|
|
t_info_bulletin['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=1;
|
|
|
DBEdit1.SetFocus;
|
|
|
bulletin_manage_insert:=true;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.t_info_bulletinBeforePost(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
table_before_post(t_info_bulletin,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
table_before_post(t_info_bulletin,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
table_before_post(t_info_bulletin,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.t_info_bulletinBeforeEdit(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
if t_info_bulletin.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring<>employee then
|
|
|
begin
|
|
|
showmessage('<27>Բ<EFBFBD><D4B2>𣬴˹<F0A3ACB4><CBB9>治<EFBFBD><E6B2BB><EFBFBD>㷢<EFBFBD><E3B7A2><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>ģ<DEB8><C4A3><EFBFBD>');
|
|
|
abort;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.FormCloseQuery(Sender: TObject;
|
|
|
var CanClose: Boolean);
|
|
|
begin
|
|
|
CanClose:=close_query(t_info_bulletin);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.FormResize(Sender: TObject);
|
|
|
var
|
|
|
i:integer;
|
|
|
begin
|
|
|
i:=round(panel1.Width/8);
|
|
|
bsSkinButton7.Width:=i;
|
|
|
bsSkinButton6.Width:=i;
|
|
|
bsSkinButton10.Width:=i;
|
|
|
bsSkinButton1.Width:=i;
|
|
|
bsSkinButton2.Width:=i;
|
|
|
bsSkinButton4.Width:=i;
|
|
|
bsSkinButton3.Width:=i;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.bsSkinButton10Click(Sender: TObject);
|
|
|
begin
|
|
|
try
|
|
|
frm_info_bulletin_query:=tfrm_info_bulletin_query.Create (self);
|
|
|
frm_info_bulletin_query.ShowModal;
|
|
|
finally
|
|
|
frm_info_bulletin_query.Free;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.t_info_bulletinAfterPost(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
frm_main.t_info_bulletin.Requery();
|
|
|
// SendMsg_gonggao('48',t_info_bulletin.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring);
|
|
|
if bulletin_manage_insert then
|
|
|
begin
|
|
|
bulletin_manage_insert:=false;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.t_info_bulletinBeforeCancel(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
bulletin_manage_insert:=false;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.t_info_bulletinAfterDelete(
|
|
|
DataSet: TDataSet);
|
|
|
begin
|
|
|
bulletin_manage_insert:=false;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.DBEdit1KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit2);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.DBEdit2KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit3);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.DBEdit3KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
key_DBEdit(Key,DBEdit4);
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.DBEdit4KeyPress(Sender: TObject;
|
|
|
var Key: Char);
|
|
|
begin
|
|
|
if key=#13 then
|
|
|
begin
|
|
|
key:=#0;
|
|
|
DBRichEdit1.SetFocus;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfrm_info_bulletin_manage.dxDBGrid1ColumnSorting(Sender: TObject;
|
|
|
Column: TdxDBTreeListColumn; var Allow: Boolean);
|
|
|
begin
|
|
|
Column_sort(Column,t_info_bulletin,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|
|
end;
|
|
|
|
|
|
end.
|