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.

324 lines
7.4 KiB
Plaintext

unit u_sys_data;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Mask, wwdbedit, Wwdotdot, Wwdbcomb, CheckLst, bsSkinCtrls, DB,
ADODB, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid, dxDBTLCl, dxGrClms,
Menus, bsSkinMenus, XPMenu, DBCtrls;
type
Tfra_sys_data = class(TFrame)
t_op: TADOQuery;
t_op1: TDataSource;
bsSkinGroupBox9: TbsSkinGroupBox;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton2: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
dxDBGrid1Column2: TdxDBGridCheckColumn;
dxDBGrid1Column3: TdxDBGridCheckColumn;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
N10: TMenuItem;
N12: TMenuItem;
N13: TMenuItem;
N14: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
N17: TMenuItem;
N18: TMenuItem;
XPMenu1: TXPMenu;
XPMenu2: TXPMenu;
N11: TMenuItem;
N19: TMenuItem;
N20: TMenuItem;
N21: TMenuItem;
t_sql: TADOQuery;
t_sql1: TDataSource;
bsSkinPanel2: TbsSkinPanel;
Label1: TLabel;
wwDBComboBox1: TwwDBComboBox;
DBMemo1: TDBMemo;
procedure N8Click(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure N18Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure N19Click(Sender: TObject);
procedure N20Click(Sender: TObject);
procedure t_sqlAfterInsert(DataSet: TDataSet);
procedure wwDBComboBox1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
implementation
uses u_main, u_data_share,u_sys_limited;
{$R *.dfm}
procedure Tfra_sys_data.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.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.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.N4Click(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.N6Click(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.N2Click(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.N18Click(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.N16Click(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.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>']:=1;
t_op.post;
t_op.next;
end;
end;
procedure Tfra_sys_data.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>']:=0;
t_op.post;
t_op.next;
end;
end;
procedure Tfra_sys_data.N19Click(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.N20Click(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.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.wwDBComboBox1Change(Sender: TObject);
begin
if 1=1 then
if wwDBComboBox1.text='ȫ<><C8AB>' then
N4Click(sender)
else if wwDBComboBox1.text='<27><><EFBFBD><EFBFBD>' then
N6Click(sender)
else if wwDBComboBox1.text='<27>ֹ<EFBFBD>˾' then
N19Click(sender);
end;
end.