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.

201 lines
4.6 KiB
Plaintext

unit u_sys_data_d;
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_d = class(TFrame)
t_op: TADOQuery;
t_op1: TDataSource;
bsSkinGroupBox9: TbsSkinGroupBox;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton2: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column3: TdxDBGridCheckColumn;
PopupMenu1: TPopupMenu;
N8: TMenuItem;
N9: TMenuItem;
N10: TMenuItem;
N11: TMenuItem;
N12: TMenuItem;
N13: TMenuItem;
N14: TMenuItem;
XPMenu1: TXPMenu;
N1: TMenuItem;
N2: TMenuItem;
bsSkinPanel2: TbsSkinPanel;
Label1: TLabel;
wwDBComboBox1: TwwDBComboBox;
DBMemo1: TDBMemo;
t_sql: TADOQuery;
t_sql1: TDataSource;
dxDBGrid1Column4: TdxDBGridCheckColumn;
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_d.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_d.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_d.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_d.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_d.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_d.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_d.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_d.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_d.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.