|
|
unit u_sys_data_v;
|
|
|
|
|
|
interface
|
|
|
|
|
|
uses
|
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
|
|
dxExEdtr, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxDBGrid, dxCntner,
|
|
|
bsSkinCtrls, Menus, bsSkinMenus, DB, ADODB, XPMenu, StdCtrls, DBCtrls,
|
|
|
Mask, wwdbedit, Wwdotdot, Wwdbcomb;
|
|
|
|
|
|
type
|
|
|
Tfra_sys_data_v = class(TFrame)
|
|
|
t_op: TADOQuery;
|
|
|
t_op1: TDataSource;
|
|
|
bsSkinGroupBox9: TbsSkinGroupBox;
|
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
bsSkinButton5: TbsSkinButton;
|
|
|
dxDBGrid1: TdxDBGrid;
|
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
|
dxDBGrid1Column2: TdxDBGridCheckColumn;
|
|
|
PopupMenu1: TPopupMenu;
|
|
|
N8: TMenuItem;
|
|
|
N9: TMenuItem;
|
|
|
N10: TMenuItem;
|
|
|
N11: TMenuItem;
|
|
|
N12: TMenuItem;
|
|
|
N13: TMenuItem;
|
|
|
N14: TMenuItem;
|
|
|
XPMenu1: TXPMenu;
|
|
|
N1: TMenuItem;
|
|
|
N2: TMenuItem;
|
|
|
t_sql: TADOQuery;
|
|
|
t_sql1: TDataSource;
|
|
|
bsSkinPanel2: TbsSkinPanel;
|
|
|
Label1: TLabel;
|
|
|
wwDBComboBox1: TwwDBComboBox;
|
|
|
DBMemo1: TDBMemo;
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
procedure bsSkinButton5Click(Sender: TObject);
|
|
|
procedure N8Click(Sender: TObject);
|
|
|
procedure N10Click(Sender: TObject);
|
|
|
procedure N12Click(Sender: TObject);
|
|
|
procedure N14Click(Sender: TObject);
|
|
|
procedure N2Click(Sender: TObject);
|
|
|
procedure t_sqlAfterInsert(DataSet: TDataSet);
|
|
|
procedure wwDBComboBox1Change(Sender: TObject);
|
|
|
private
|
|
|
{ Private declarations }
|
|
|
public
|
|
|
{ Public declarations }
|
|
|
end;
|
|
|
|
|
|
implementation
|
|
|
|
|
|
uses u_data_share, u_main;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
procedure Tfra_sys_data_v.bsSkinButton2Click(Sender: TObject);
|
|
|
var
|
|
|
Pnt:Tpoint;
|
|
|
begin
|
|
|
Pnt:=bsSkinButton2.ClientToScreen(Point(0,bsSkinButton2.Height));
|
|
|
PopupMenu1.Popup(Pnt.x,Pnt.y);
|
|
|
end;
|
|
|
|
|
|
procedure Tfra_sys_data_v.bsSkinButton5Click(Sender: TObject);
|
|
|
begin
|
|
|
if (t_op.State=dsedit)or(t_op.State=dsinsert)then
|
|
|
t_op.post;
|
|
|
if (t_sql.State=dsedit)or(t_sql.State=dsinsert)then
|
|
|
t_sql.post;
|
|
|
end;
|
|
|
|
|
|
procedure Tfra_sys_data_v.N8Click(Sender: TObject);
|
|
|
begin
|
|
|
t_op.first;
|
|
|
while not t_op.eof do
|
|
|
begin
|
|
|
t_op.edit;
|
|
|
t_op['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
|
|
|
t_op.post;
|
|
|
t_op.next;
|
|
|
end;
|
|
|
if t_op.Locate('ְԱ',t_op.DataSource.DataSet['<27><><EFBFBD><EFBFBD>'],[])then
|
|
|
begin
|
|
|
t_op.edit;
|
|
|
t_op['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=1;
|
|
|
t_op.post;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfra_sys_data_v.N10Click(Sender: TObject);
|
|
|
begin
|
|
|
t_op.first;
|
|
|
while not t_op.eof do
|
|
|
begin
|
|
|
t_op.edit;
|
|
|
t_op['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
|
|
|
t_op.post;
|
|
|
t_op.next;
|
|
|
end;
|
|
|
try
|
|
|
frm_data_share.t_sys_employee.FIRST;
|
|
|
while not frm_data_share.t_sys_employee.eof do
|
|
|
begin
|
|
|
if t_op.Locate('ְԱ',frm_data_share.t_sys_employee.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,[])then
|
|
|
begin
|
|
|
if (frm_data_share.t_sys_employee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
=t_op.DataSource.DataSet.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring) and (frm_data_share.t_sys_employee.fieldbyname('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
=t_op.DataSource.DataSet.fieldbyname('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').asstring) then
|
|
|
begin
|
|
|
t_op.edit;
|
|
|
t_op['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=1;
|
|
|
t_op.post;
|
|
|
end;
|
|
|
end;
|
|
|
frm_data_share.t_sys_employee.next;
|
|
|
end;
|
|
|
finally
|
|
|
;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfra_sys_data_v.N12Click(Sender: TObject);
|
|
|
begin
|
|
|
t_op.first;
|
|
|
while not t_op.eof do
|
|
|
begin
|
|
|
t_op.edit;
|
|
|
t_op['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=1;
|
|
|
t_op.post;
|
|
|
t_op.next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfra_sys_data_v.N14Click(Sender: TObject);
|
|
|
begin
|
|
|
t_op.first;
|
|
|
while not t_op.eof do
|
|
|
begin
|
|
|
t_op.edit;
|
|
|
t_op['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
|
|
|
t_op.post;
|
|
|
t_op.next;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfra_sys_data_v.N2Click(Sender: TObject);
|
|
|
begin // by lcx
|
|
|
t_op.first;
|
|
|
while not t_op.eof do
|
|
|
begin
|
|
|
t_op.edit;
|
|
|
t_op['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
|
|
|
t_op.post;
|
|
|
t_op.next;
|
|
|
end;
|
|
|
try
|
|
|
frm_data_share.t_sys_employee.FIRST;
|
|
|
while not frm_data_share.t_sys_employee.eof do
|
|
|
begin
|
|
|
if t_op.Locate('ְԱ',frm_data_share.t_sys_employee.fieldbyname('<27><><EFBFBD><EFBFBD>').asstring,[])then
|
|
|
begin
|
|
|
if (frm_data_share.t_sys_employee.fieldbyname('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
=t_op.DataSource.DataSet.fieldbyname('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>').asstring) then
|
|
|
begin
|
|
|
t_op.edit;
|
|
|
t_op['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=1;
|
|
|
t_op.post;
|
|
|
end;
|
|
|
end;
|
|
|
frm_data_share.t_sys_employee.next;
|
|
|
end;
|
|
|
finally
|
|
|
;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
|
procedure Tfra_sys_data_v.t_sqlAfterInsert(DataSet: TDataSet);
|
|
|
begin
|
|
|
t_sql['<27><>Ա']:=t_op.DataSource.DataSet['<27><><EFBFBD><EFBFBD>'];
|
|
|
t_sql['<27><><EFBFBD><EFBFBD>']:=t_op['<27><><EFBFBD><EFBFBD>'];
|
|
|
end;
|
|
|
|
|
|
procedure Tfra_sys_data_v.wwDBComboBox1Change(Sender: TObject);
|
|
|
begin
|
|
|
if wwDBComboBox1.text='ȫ<><C8AB>' then
|
|
|
N12Click(sender)
|
|
|
else if wwDBComboBox1.text='<27><><EFBFBD><EFBFBD>' then
|
|
|
N10Click(sender)
|
|
|
else if wwDBComboBox1.text='<27>ֹ<EFBFBD>˾' then
|
|
|
N2Click(sender);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end.
|