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.

169 lines
3.7 KiB
Plaintext

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;
t_sql: TADOQuery;
t_sql1: TDataSource;
DBMemo1: TDBMemo;
bsSkinPanel2: TbsSkinPanel;
Label1: TLabel;
wwDBComboBox1: TwwDBComboBox;
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 t_sqlAfterInsert(DataSet: TDataSet);
procedure FrameResize(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['ÊÇ·ñ¿ÉÊÓ']:=0;
t_op.post;
t_op.next;
end;
if t_op.Locate('Ö°Ô±',t_op.DataSource.DataSet['ÐÕÃû'],[])then
begin
t_op.edit;
t_op['ÊÇ·ñ¿ÉÊÓ']:=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['ÊÇ·ñ¿ÉÊÓ']:=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('ÐÕÃû').asstring,[])then
begin
if frm_data_share.t_sys_employee.fieldbyname('²¿ÃÅÃû³Æ').asstring
=t_op.DataSource.DataSet.fieldbyname('²¿ÃÅÃû³Æ').asstring then
begin
t_op.edit;
t_op['ÊÇ·ñ¿ÉÊÓ']:=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['ÊÇ·ñ¿ÉÊÓ']:=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['ÊÇ·ñ¿ÉÊÓ']:=0;
t_op.post;
t_op.next;
end;
end;
procedure Tfra_sys_data_v.t_sqlAfterInsert(DataSet: TDataSet);
begin
t_sql['ÈËÔ±']:=t_op.DataSource.DataSet['ÐÕÃû'];
t_sql['ÊôÐÔ']:=t_op['ÊôÐÔ'];
end;
procedure Tfra_sys_data_v.FrameResize(Sender: TObject);
var
inifile1:Tinifile;
s_Limite:string;
begin
inifile1:=Tinifile.Create(ExtractFilePath(application.ExeName)+'main.ini');
s_Limite:=inifile1.ReadString('Limit','Limit','');
inifile1.free;
if Trim(s_Limite)='display' then
DBMemo1.Visible:=true
else
DBMemo1.Visible:=false;
end;
end.