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.

584 lines
19 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

unit u_sys_dep_emp;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, BusinessSkinForm, bsSkinCtrls, dxExEdtr, dxCntner,
dxTL, dxDBCtrl, dxDBGrid, dxDBTLCl, dxGrClms, Menus;
type
Tfrm_sys_dep_emp = class(TForm)
t_sys_department: TADOQuery;
t_sys_department1: TDataSource;
t_sys_employee1: TDataSource;
t_sys_employee: TADOQuery;
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinPanel2: TbsSkinPanel;
dxDBGrid3: TdxDBGrid;
dxDBGrid3Column1: TdxDBGridMaskColumn;
dxDBGrid3Column2: TdxDBGridMaskColumn;
dxDBGrid3Column3: TdxDBGridMaskColumn;
dxDBGrid3Column4: TdxDBGridMaskColumn;
dxDBGrid3Column5: TdxDBGridMaskColumn;
dxDBGrid3Column6: TdxDBGridMaskColumn;
dxDBGrid3Column7: TdxDBGridDateColumn;
dxDBGrid3Column8: TdxDBGridMaskColumn;
dxDBGrid3Column9: TdxDBGridMaskColumn;
dxDBGrid3Column10: TdxDBGridMaskColumn;
bsSkinPanel4: TbsSkinPanel;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridMaskColumn;
v_all_employee: TADOQuery;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton1: TbsSkinButton;
bsSkinButton2: TbsSkinButton;
bsSkinButton4: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
bsSkinPanel3: TbsSkinPanel;
bsSkinButton9: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
bsSkinButton11: TbsSkinButton;
bsSkinButton12: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinButton6: TbsSkinButton;
p_employee_change: TADOStoredProc;
p_employee_delete: TADOStoredProc;
t_sys_code_data: TADOQuery;
t_sys_code: TADOQuery;
t_sys_code_emp: TADOQuery;
t_sys_code_data_all: TADOQuery;
p_employee_change_no: TADOStoredProc;
p_employee_delete_no: TADOStoredProc;
bsSkinButton7: TbsSkinButton;
dxDBGrid3Column11: TdxDBGridColumn;
bsSkinButton8: TbsSkinButton;
dxDBGrid3Column12: TdxDBGridCheckColumn;
bsSkinButton13: TbsSkinButton;
ADOQuery1: TADOQuery;
dxDBGrid3Column13: TdxDBGridDateColumn;
dxDBGrid3Column14: TdxDBGridDateColumn;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
dxDBGrid1Column2: TdxDBGridCheckColumn;
dxDBGrid1Column3: TdxDBGridColumn;
procedure t_sys_departmentBeforePost(DataSet: TDataSet);
procedure t_sys_employeeBeforePost(DataSet: TDataSet);
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton11Click(Sender: TObject);
procedure bsSkinButton12Click(Sender: TObject);
procedure t_sys_department_twoBeforeInsert(DataSet: TDataSet);
procedure t_sys_employeeBeforeInsert(DataSet: TDataSet);
procedure t_sys_departmentDeleteError(DataSet: TDataSet;
E: EDatabaseError; var Action: TDataAction);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure bsSkinButton5Click(Sender: TObject);
procedure v_all_employeeAfterScroll(DataSet: TDataSet);
procedure bsSkinButton6Click(Sender: TObject);
procedure t_sys_employeeAfterPost(DataSet: TDataSet);
procedure t_sys_employeeBeforeEdit(DataSet: TDataSet);
procedure bsSkinButton7Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject);
procedure t_sys_employeeAfterInsert(DataSet: TDataSet);
procedure N3Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure bsSkinButton13Click(Sender: TObject);
private
function isopvisible(emp,otemp,quan:string):Integer;
{ Private declarations }
public
{ Public declarations }
end;
var
frm_sys_dep_emp: Tfrm_sys_dep_emp;
dep_emp_insert:boolean;
dep_emp_name:string;
implementation
uses u_main, my_sys_function, u_data_share, u_sys_dep_emp_delete,
u_sys_progress, u_sys_dep_emp_department;
{$R *.dfm}
procedure Tfrm_sys_dep_emp.t_sys_departmentBeforePost(
DataSet: TDataSet);
begin
table_before_post(t_sys_department,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_sys_dep_emp.t_sys_employeeBeforePost(DataSet: TDataSet);
begin
table_before_post(t_sys_employee,'<27><><EFBFBD><EFBFBD>');
if t_sys_employee.State=dsinsert then
dep_emp_insert:=true
else
dep_emp_insert:=false;
end;
procedure Tfrm_sys_dep_emp.FormShow(Sender: TObject);
begin
t_sys_department.open;
t_sys_employee.open;
v_all_employee.Open;
end;
procedure Tfrm_sys_dep_emp.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_data_share.t_sys_employee.requery;
frm_data_share.t_sys_department.requery;
end;
procedure Tfrm_sys_dep_emp.bsSkinButton1Click(Sender: TObject);
begin
t_sys_department.insert;
end;
procedure Tfrm_sys_dep_emp.bsSkinButton2Click(Sender: TObject);
begin
table_post(t_sys_department);
end;
procedure Tfrm_sys_dep_emp.bsSkinButton4Click(Sender: TObject);
begin
table_delete(t_sys_department);
end;
procedure Tfrm_sys_dep_emp.bsSkinButton3Click(Sender: TObject);
begin
table_cancel(t_sys_department);
end;
procedure Tfrm_sys_dep_emp.bsSkinButton9Click(Sender: TObject);
begin
t_sys_employee.insert;
end;
procedure Tfrm_sys_dep_emp.bsSkinButton10Click(Sender: TObject);
begin
table_post(t_sys_employee);
end;
procedure Tfrm_sys_dep_emp.bsSkinButton11Click(Sender: TObject);
begin
if t_sys_employee.IsEmpty then
exit;
if v_all_employee.IsEmpty then
begin
if t_sys_employee.State=dsinsert then
begin
t_sys_employee.cancel;
end
else
begin
t_sys_employee.cancel;
p_employee_delete_no.Parameters.ParamByName('name').Value:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
p_employee_delete_no.ExecProc;
t_sys_employee.delete;
end;
end
else
begin
try
frm_sys_dep_emp_delete:=Tfrm_sys_dep_emp_delete.Create(self);
frm_sys_dep_emp_delete.ShowModal;
finally
frm_sys_dep_emp_delete.Free;
frm_sys_dep_emp_delete:=nil;
end;
end;
end;
procedure Tfrm_sys_dep_emp.bsSkinButton12Click(Sender: TObject);
begin
table_cancel(t_sys_employee);
end;
procedure Tfrm_sys_dep_emp.t_sys_department_twoBeforeInsert(
DataSet: TDataSet);
begin
table_before_insert(t_sys_department);
end;
procedure Tfrm_sys_dep_emp.t_sys_employeeBeforeInsert(DataSet: TDataSet);
begin
table_before_insert(t_sys_department);
end;
procedure Tfrm_sys_dep_emp.t_sys_departmentDeleteError(
DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction);
begin
showmessage('<27><><EFBFBD><EFBFBD>ְԱ<D6B0><D4B1>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>');
abort;
end;
procedure Tfrm_sys_dep_emp.FormCloseQuery(Sender: TObject;
var CanClose: Boolean);
begin
CanClose:=frm_close_query(t_sys_department);
CanClose:=frm_close_query(t_sys_employee);
end;
procedure Tfrm_sys_dep_emp.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_sys_dep_emp.v_all_employeeAfterScroll(DataSet: TDataSet);
begin
if v_all_employee.IsEmpty then
dxDBGrid3Column1.ReadOnly:=false
else
dxDBGrid3Column1.ReadOnly:=true;
end;
procedure Tfrm_sys_dep_emp.bsSkinButton6Click(Sender: TObject);
var
old_str,str:string;
begin
if t_sys_employee.IsEmpty then
exit;
if v_all_employee.IsEmpty then
begin
showmessage('<27><>ְԱ<D6B0><D4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>л<EFBFBD>û<EFBFBD><C3BB>ʹ<EFBFBD>ã<EFBFBD><C3A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD>Ӹ<EFBFBD><D3B8>ģ<EFBFBD>');
exit;
end;
str:=trim(InputBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ְԱ<D6B0>µ<EFBFBD><C2B5><EFBFBD><EFBFBD><EFBFBD>', '<27>µ<EFBFBD><C2B5><EFBFBD><EFBFBD>֣<EFBFBD>', ''));
if str=''then
begin
exit;
end;
try
old_str:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_employee.Edit;
t_sys_employee['<27><><EFBFBD><EFBFBD>']:=str;
t_sys_employee.post;
p_employee_change.Parameters.ParamByName('old_name').Value:=old_str;
p_employee_change.Parameters.ParamByName('new_name').Value:=str;
p_employee_change.ExecProc;
v_all_employee.requery;
except
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>');
end;
end;
procedure Tfrm_sys_dep_emp.t_sys_employeeAfterPost(DataSet: TDataSet);
begin
if dep_emp_insert then
begin
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(self);
frm_sys_progress.bsSkinGauge1.ProgressText:='<27><><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>Ȩ<EFBFBD>޴<EFBFBD><DEB4><EFBFBD><EBA1A3><EFBFBD><EFBFBD>';
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.MaxValue:=20000;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.Update;
t_sys_code.close;
t_sys_code.open;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_data_all.close;
t_sys_code_data_all.open;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_data.close;
t_sys_code_data.open;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_emp.Close;
t_sys_code_emp.open;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
frm_data_share.t_sys_employee.requery;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
frm_sys_progress.bsSkinGauge1.MaxValue:=10+t_sys_code.RecordCount
+frm_data_share.t_sys_employee.RecordCount*(t_sys_code_data_all.RecordCount*2-1);
t_sys_code.first;
while not t_sys_code.eof do
begin
t_sys_code_emp.insert;
t_sys_code_emp['Ȩ<>޴<EFBFBD><DEB4><EFBFBD>']:=t_sys_code['Ȩ<>޴<EFBFBD><DEB4><EFBFBD>'];
t_sys_code_emp['һ<><D2BB>ģ<EFBFBD><C4A3>']:=t_sys_code['һ<><D2BB>ģ<EFBFBD><C4A3>'];
t_sys_code_emp['<27><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>']:=t_sys_code['<27><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>'];
t_sys_code_emp['Ȩ<><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_code['Ȩ<><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_sys_code_emp['<27><>Ա']:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_emp['<27>Ƿ<EFBFBD><C7B7>ɲ<EFBFBD><C9B2><EFBFBD>']:=0;
t_sys_code_emp.post;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code.next;
end;
frm_data_share.t_sys_employee.first;
while not frm_data_share.t_sys_employee.eof do
begin
if frm_data_share.t_sys_employee['<27><><EFBFBD><EFBFBD>']<>t_sys_employee['<27><><EFBFBD><EFBFBD>'] then
begin
t_sys_code_data_all.first;
while not t_sys_code_data_all.eof do
begin
t_sys_code_data.insert;
t_sys_code_data['<27><>Ա']:=frm_data_share.t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_data['<27><><EFBFBD><EFBFBD>']:=t_sys_code_data_all['<27><><EFBFBD><EFBFBD>'];
// t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=isopvisible(t_sys_employee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,frm_data_share.t_sys_employee['<27><><EFBFBD><EFBFBD>'],t_sys_code_data_all['<27><><EFBFBD><EFBFBD>']);
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['ְԱ']:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_data.post;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_data_all.next;
end;
end;
frm_data_share.t_sys_employee.next;
end;
frm_data_share.t_sys_employee.first;
while not frm_data_share.t_sys_employee.eof do
begin
t_sys_code_data_all.first;
while not t_sys_code_data_all.eof do
begin
t_sys_code_data.insert;
t_sys_code_data['<27><>Ա']:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_data['<27><><EFBFBD><EFBFBD>']:=t_sys_code_data_all['<27><><EFBFBD><EFBFBD>'];
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['ְԱ']:=frm_data_share.t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_data.post;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_data_all.next;
end;
frm_data_share.t_sys_employee.next;
end;
t_sys_code_data.insert;
t_sys_code_data['<27><>Ա']:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_data['<27><><EFBFBD><EFBFBD>']:='3006';
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['ְԱ']:='<27>׼۹<D7BC><DBB9><EFBFBD>';
t_sys_code_data.post;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_data.insert;
t_sys_code_data['<27><>Ա']:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_data['<27><><EFBFBD><EFBFBD>']:='3006';
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['ְԱ']:='<27><><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>';
t_sys_code_data.post;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_data.insert;
t_sys_code_data['<27><>Ա']:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_data['<27><><EFBFBD><EFBFBD>']:='3006';
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['ְԱ']:='ȫ<><C8AB><EFBFBD>׼<EFBFBD>';
t_sys_code_data.post;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_data.insert;
t_sys_code_data['<27><>Ա']:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_data['<27><><EFBFBD><EFBFBD>']:='3006';
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['ְԱ']:='<27><><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>';
t_sys_code_data.post;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_data.insert;
t_sys_code_data['<27><>Ա']:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_data['<27><><EFBFBD><EFBFBD>']:='3006';
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['ְԱ']:='һ<><D2BB><EFBFBD>ۼ<EFBFBD>';
t_sys_code_data.post;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
frm_sys_progress.close;
frm_sys_progress:=nil;
end;
if dep_emp_name<>t_sys_employee['<27><><EFBFBD><EFBFBD>'] then
begin
p_employee_change_no.Parameters.ParamByName('old_name').Value:=dep_emp_name;
p_employee_change_no.Parameters.ParamByName('new_name').Value:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
p_employee_change_no.ExecProc;
end;
end;
procedure Tfrm_sys_dep_emp.t_sys_employeeBeforeEdit(DataSet: TDataSet);
begin
dep_emp_name:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
end;
procedure Tfrm_sys_dep_emp.bsSkinButton7Click(Sender: TObject);
begin
if t_sys_employee.isempty then
exit;
try
frm_sys_dep_emp_department:=Tfrm_sys_dep_emp_department.Create(self);
frm_sys_dep_emp_department.ShowModal;
finally
frm_sys_dep_emp_department.Free;
frm_sys_dep_emp_department:=nil;
end;
end;
procedure Tfrm_sys_dep_emp.bsSkinButton8Click(Sender: TObject);
begin
if t_sys_employee.IsEmpty then
exit;
if t_sys_employee['ͣ<><CDA3>']=0 then begin
t_sys_employee.Edit;
t_sys_employee['ͣ<><CDA3>']:=1;
t_sys_employee.Post;
end else begin
t_sys_employee.Edit;
t_sys_employee['ͣ<><CDA3>']:=0;
t_sys_employee.Post;
end;
end;
procedure Tfrm_sys_dep_emp.t_sys_employeeAfterInsert(DataSet: TDataSet);
begin
t_sys_employee['ͣ<><CDA3>']:=0;
end;
procedure Tfrm_sys_dep_emp.N3Click(Sender: TObject);
var
aQuery:TADOQuery;
begin
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Clear;
SQL.Add('Select * from t_op_seae where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+t_sys_employee.fieldByName('<27><><EFBFBD><EFBFBD>').AsString+''' and <20><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD><>'''+t_sys_employee.fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' and (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> between '''+t_sys_employee.fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''' and '''+t_sys_employee.fieldByName('ͣ<><CDA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString+''')');
Open;
First;
while not eof do begin
Edit;
FieldByName('<27><><EFBFBD>۲<EFBFBD><DBB2><EFBFBD>').AsString:=t_sys_employee.fieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
Post;
Next;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
procedure Tfrm_sys_dep_emp.N1Click(Sender: TObject);
begin
if not ASSIGNED(frm_sys_progress) then
frm_sys_progress:=tfrm_sys_progress.Create(self);
frm_sys_progress.bsSkinGauge1.ProgressText:='<27><><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>Ȩ<EFBFBD>޴<EFBFBD><DEB4><EFBFBD><EBA1A3><EFBFBD><EFBFBD>';
frm_sys_progress.Show;
frm_sys_progress.bsSkinGauge1.MaxValue:=20000;
frm_sys_progress.bsSkinGauge1.MinValue:=0;
frm_sys_progress.bsSkinGauge1.Value:=0;
frm_sys_progress.Update;
t_sys_code.close;
t_sys_code.open;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_data_all.close;
t_sys_code_data_all.open;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_data.close;
t_sys_code_data.open;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_emp.Close;
t_sys_code_emp.open;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
frm_data_share.t_sys_employee.requery;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
frm_sys_progress.bsSkinGauge1.MaxValue:=10+t_sys_code.RecordCount
+frm_data_share.t_sys_employee.RecordCount*(t_sys_code_data_all.RecordCount*2-1);
t_sys_code.first;
while not t_sys_code.eof do
begin
IF NOT t_sys_code_emp.Locate('Ȩ<>޴<EFBFBD><DEB4><EFBFBD>;<3B><>Ա',VarArrayOf([t_sys_code['Ȩ<>޴<EFBFBD><DEB4><EFBFBD>'],t_sys_employee['<27><><EFBFBD><EFBFBD>']]),[]) then begin
t_sys_code_emp.insert;
t_sys_code_emp['Ȩ<>޴<EFBFBD><DEB4><EFBFBD>']:=t_sys_code['Ȩ<>޴<EFBFBD><DEB4><EFBFBD>'];
t_sys_code_emp['һ<><D2BB>ģ<EFBFBD><C4A3>']:=t_sys_code['һ<><D2BB>ģ<EFBFBD><C4A3>'];
t_sys_code_emp['<27><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>']:=t_sys_code['<27><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3>'];
t_sys_code_emp['Ȩ<><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=t_sys_code['Ȩ<><C8A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
t_sys_code_emp['<27><>Ա']:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_emp['<27>Ƿ<EFBFBD><C7B7>ɲ<EFBFBD><C9B2><EFBFBD>']:=0;
t_sys_code_emp.post;
end;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code.next;
end;
ADOQuery1.Open;
frm_data_share.t_sys_employee.first;
while not frm_data_share.t_sys_employee.eof do
begin
if frm_data_share.t_sys_employee['<27><><EFBFBD><EFBFBD>']<>t_sys_employee['<27><><EFBFBD><EFBFBD>'] then
begin
t_sys_code_data_all.first;
while not t_sys_code_data_all.eof do
begin
if not ADOQuery1.Locate('<27><>Ա;<3B><><EFBFBD><EFBFBD>;ְԱ',VarArrayOf([frm_data_share.t_sys_employee.FieldByName('<27><><EFBFBD><EFBFBD>').asstring,t_sys_code_data_all.FieldByName('<27><><EFBFBD><EFBFBD>').asstring,t_sys_employee.FieldByName('<27><><EFBFBD><EFBFBD>').asstring]),[]) then begin
t_sys_code_data.insert;
t_sys_code_data['<27><>Ա']:=frm_data_share.t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_data['<27><><EFBFBD><EFBFBD>']:=t_sys_code_data_all['<27><><EFBFBD><EFBFBD>'];
// t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=isopvisible(t_sys_employee.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString,frm_data_share.t_sys_employee['<27><><EFBFBD><EFBFBD>'],t_sys_code_data_all['<27><><EFBFBD><EFBFBD>']);
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>']:=0;
t_sys_code_data['ְԱ']:=t_sys_employee['<27><><EFBFBD><EFBFBD>'];
t_sys_code_data.post;
END;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
t_sys_code_data_all.next;
end;
end;
frm_data_share.t_sys_employee.next;
end;
ADOQuery1.Close;
frm_sys_progress.bsSkinGauge1.Value:=frm_sys_progress.bsSkinGauge1.Value+1;
frm_sys_progress.close;
frm_sys_progress:=nil;
end;
procedure Tfrm_sys_dep_emp.bsSkinButton13Click(Sender: TObject);
var
Pnt:Tpoint;
begin
Pnt:=bsSkinButton13.ClientToScreen(Point(0,bsSkinButton13.Height));
PopupMenu1.Popup(Pnt.x,Pnt.y);
end;
function Tfrm_sys_dep_emp.isopvisible(emp, otemp, quan: string):Integer;
var
aQuery:TADOQuery;
begin
result:=0;
aQuery:=CreateAdoQuery;
try
with aQuery do begin
Close;SQL.Text:='select <20><><EFBFBD>ӷ<EFBFBD>Χ from t_sys_code_sql where <20><><EFBFBD><EFBFBD>='''+quan+''' and <20><>Ա='''+otemp+''' '
+' and <20><>Ա in (select <20><><EFBFBD><EFBFBD> from t_sys_employee where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+emp+''')';
Open;
if not IsEmpty then begin
if FieldByName('<27><><EFBFBD>ӷ<EFBFBD>Χ').AsString='<27><><EFBFBD><EFBFBD>' then begin
result:=1;
end;
end;
end;
finally
FreeAndNil(aQuery);
end;
end;
end.