📄 fmain.~pas
字号:
bran.Button1.Top:=80;
bran.Button2.Top:=80;
bran.GroupBox1.Caption:='分部名称';
bran.ShowModal;
end;
procedure TMain.N29Click(Sender: TObject);
var tmpid:string;
begin
if self.staffinfo.RecordCount=0 then exit;
faddman:=tfaddman.create(application);
main.tmpquery.Close;
main.tmpquery.SQL.Clear;
main.tmpquery.SQL.Add('select * from r_staffclasscode');
main.tmpquery.Open;
faddman.PageControl1.ActivePageIndex:=0;
faddman.etype:=2;
faddman.Edit12.Text:=self.staffinfo.FieldByName('staffid').AsString;
faddman.Edit1.Text:=self.staffinfo.FieldByName('name').AsString; //姓名
faddman.ComboBox1.Text:=self.staffinfo.FieldByName('sex').AsString; //性别
faddman.Edit2.Text:=self.staffinfo.FieldByName('ename').AsString; //英文名
faddman.Edit3.Text:=self.staffinfo.FieldByName('idnum').AsString; //身份证号码
faddman.ComboBox2.Text:=self.staffinfo.FieldByName('ifmarriage').AsString; //婚否
faddman.DateTimePicker1.Date:=self.staffinfo.FieldByName('birthday').AsDateTime; //生日
faddman.ComboBox3.Text:=self.staffinfo.FieldByName('Nationality').AsString; //民族
faddman.Edit4.Text:=self.staffinfo.FieldByName('Nativeplace').AsString; //籍贯
faddman.Edit5.Text:=self.staffinfo.FieldByName('Residence').AsString; //户口所在地
faddman.ComboBox4.Text:=self.staffinfo.FieldByName('knowledge').AsString; //学历
faddman.Edit6.Text:=self.staffinfo.FieldByName('School').AsString; //毕业院校
faddman.ComboBox5.Text:=self.staffinfo.FieldByName('forlang').AsString; //外语语种
faddman.ComboBox6.Text:=self.staffinfo.FieldByName('howforlang').AsString; //熟练程度
faddman.DateTimePicker2.Date:=self.staffinfo.FieldByName('intime').AsDateTime; //入职日期
faddman.Edit7.Text:=self.staffinfo.FieldByName('exigenceman').AsString; //紧急联系人
faddman.Edit8.Text:=self.staffinfo.FieldByName('exigencephone').AsString; //紧急联系电话号码
faddman.Edit9.Text:=self.staffinfo.FieldByName('Telephone').AsString;//联系电话
faddman.Edit10.Text:=self.staffinfo.FieldByName('Address').AsString;//通讯地址
faddman.Edit11.Text:=self.staffinfo.FieldByName('Email').AsString;//电子邮件
//faddman.dxLookupTreeView1.Selected.Item[self.branch.FieldByName('id').AsInteger].Selected;
faddman.dxLookupTreeView1.Text:=self.branch.fieldbyname('branchname').AsString;
faddman.Memo1.Lines.Text:=self.staffinfo.FieldByName('imemo').AsVariant;//备注
faddman.cxLookupComboBox1.EditValue:=self.staffinfo.FieldByName('classcodeID').AsInteger;//职工类别
//..设变量部门变动
faddman.bmchange:=self.branch.fieldbyname('id').AsInteger;
faddman.bmname:=self.branch.fieldbyname('branchname').AsString;
//..显示最后一次部门的变动日期
tmpid:=self.staffinfo.fieldbyname('r_staffinfo.id').AsString;
self.tmpquery2.Close;
self.tmpquery2.SQL.Clear;
self.tmpquery2.SQL.Add('select * from r_staffbranchedit where 1=1');
self.tmpquery2.SQL.Add(' order by id desc');
self.tmpquery2.Filtered:=false;
self.tmpquery2.Filter:=format('staffid'+'='+'''%s''',[tmpid]);
self.tmpquery2.Filtered:=true;
self.tmpquery2.Open;
faddman.DateTimePicker3.Date:=self.tmpquery2.fieldbyname('indate').AsDateTime;
//..打开窗口
faddman.showmodal;
self.staffinfo.Close;
self.staffinfo.open;
self.r_staffbranchedit.Close;
self.r_staffbranchedit.Open;
end;
procedure TMain.dxDBTreeView1Click(Sender: TObject);
var tmpid:string;
begin
if self.ToolButton6.Down then
begin
try
myagent.Show(0);
myagent.Play('GetAttention');
myagent.Speak('您所指的是部门树状图','');
myagent.Play('LookLeft');
myagent.Speak('点击鼠标右键,您可以增加和管理部门','');
myagent.Play('LookLeft');
myagent.Hide(0);
except
end;
exit;
end;
tmpid:=self.branch.fieldbyname('id').AsString;
self.staffinfo.Close;
self.staffinfo.SQL.Text:=self.sqlstring;
self.staffinfo.Filtered:=false;
self.staffinfo.Filter:=format('branchid'+'='+'''%s''',[tmpid]);
self.staffinfo.Filtered:=true;
self.staffinfo.Open;
self.N34.Checked:=false;
end;
procedure TMain.N34Click(Sender: TObject);
begin
if self.N34.Checked=true then
begin
self.N34.Checked:=false;
self.staffinfo.Close;
self.staffinfo.SQL.Clear;
self.staffinfo.SQL.Add('select * from r_staffinfo,r_staffclasscode where');
self.staffinfo.SQL.Add(' r_staffinfo.delrecy='''+'0'+''' and r_staffinfo.classcodeID=r_staffclasscode.id');
self.staffinfo.Open;
self.showdel:='0';
end
else
begin
self.N34.Checked:=true;
self.staffinfo.Close;
self.staffinfo.SQL.Clear;
self.staffinfo.SQL.Add('select * from r_staffinfo,r_staffclasscode where');
self.staffinfo.SQL.Add(' r_staffinfo.classcodeID=r_staffclasscode.id');
self.staffinfo.Open;
self.showdel:='1';
end;
end;
procedure TMain.N31Click(Sender: TObject);
var tmpid:string;
begin
if self.staffinfo.RecordCount=0 then exit;
if self.staffinfo.FieldByName('r_staffinfo.delrecy').AsString='1' then
begin
if Application.MessageBox('确认要删除所选择数据吗?','提示',MB_ICONwarning or MB_YESNO )=IDNO then exit;
begin
try
tmpid:=self.staffinfo.fieldbyname('r_staffinfo.id').AsString;
self.stafftable.Close;
self.stafftable.Filtered:=false;
self.stafftable.Filter:=format('id'+'='+'''%s''',[tmpid]);
self.stafftable.Filtered:=true;
self.stafftable.Open;
self.stafftable.Delete;
self.staffinfo.Close;
self.staffinfo.Open;
except
end;
end;
exit;
end;
if Application.MessageBox('确认要删除所选择数据吗?','提示',MB_ICONwarning or MB_YESNO )=IDNO then exit;
try
tmpid:=self.staffinfo.fieldbyname('r_staffinfo.id').AsString;
self.stafftable.Close;
self.stafftable.Filtered:=false;
self.stafftable.Filter:=format('id'+'='+'''%s''',[tmpid]);
self.stafftable.Filtered:=true;
self.stafftable.Open;
self.stafftable.edit;
self.stafftable.FieldByName('delrecy').AsString:='1';
self.stafftable.Post;
self.stafftable.Close;
self.staffinfo.Close;
self.staffinfo.Open;
self.r_staffbranchedit.Close;
self.r_staffbranchedit.Open;
except
end;
end;
procedure TMain.cxGrid1DBTableView1CellClick(
Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
var tmpid:string;
begin
tmpid:=self.staffinfo.fieldbyname('r_staffinfo.id').AsString;
if self.staffinfo.FieldByName('r_staffinfo.delrecy').AsString='1' then
self.N32.Enabled:=true
else
self.N32.Enabled:=false;
self.N60.OnClick(self);
//---------------职位变动---------------//
(*self.stachpostedit.Close;
self.stachpostedit.Filtered:=false;
self.stachpostedit.Filter:=format('staffid'+'='+'''%s''',[tmpid]);
self.stachpostedit.Filtered:=true;
self.stachpostedit.Open; *)
//--------------------------------------//
end;
procedure TMain.cxGrid1DBTableView1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if self.ToolButton6.Down then
begin
try
myagent.Show(0);
myagent.Play('GetAttention');
myagent.Speak('您所指的是职工基本信息列表'#13,'');
myagent.Play('Lookright');
myagent.Speak('在这里您可以增加和设置职工信息,并能让您及时了解,作出分析','');
myagent.Play('Lookright');
myagent.Hide(0);
except
end;
exit;
end;
if self.staffinfo.FieldByName('r_staffinfo.delrecy').AsString='1' then
self.N32.Enabled:=true
else
self.N32.Enabled:=false;
end;
procedure TMain.cxGrid1DBTableView1SelectionChanged(
Sender: TcxCustomGridTableView);
begin
if self.staffinfo.FieldByName('r_staffinfo.delrecy').AsString='1' then
self.N32.Enabled:=true
else
self.N32.Enabled:=false;
end;
procedure TMain.N32Click(Sender: TObject);
var tmpid:string;
begin
if Application.MessageBox('确认要恢复所选择的被删数据吗?','提示',MB_ICONinformation or MB_YESNO )=IDNO then exit;
tmpid:=self.staffinfo.fieldbyname('r_staffinfo.id').AsString;
self.stafftable.Close;
self.stafftable.Filtered:=false;
self.stafftable.Filter:=format('id'+'='+'''%s''',[tmpid]);
self.stafftable.Filtered:=true;
self.stafftable.Open;
self.stafftable.edit;
self.stafftable.FieldByName('delrecy').AsString:='0';
self.stafftable.Post;
self.stafftable.Close;
self.staffinfo.Close;
self.staffinfo.Open;
end;
procedure TMain.FormShow(Sender: TObject);
var xa,ya:longint;
stra,strb:string;
begin
xa:=GetSystemMetrics(SM_CXSCREEN);
Str(xa,stra);
ya:=GetSystemMetrics(SM_CySCREEN);
Str(ya,strb);
try
self.dxDBTreeView1.OnClick(self);
except
end;
self.dxDBTreeView1.FullExpand;
self.dxDBTreeView1.SetFocus;
self.TabSheet9.TabVisible:=false;
if self.ReadDataControl='1' then
self.ToolBar1.Visible:=true
else
self.ToolBar1.Visible:=false;
if self.ReadSheet='1' then
self.tbsFormatting.Visible:=true
else
self.tbsFormatting.Visible:=false;
if self.ReadStyle='1' then
self.cxSpreadSheetBook1.PainterType:=ptOffice97Style
else
self.cxSpreadSheetBook1.PainterType:=ptOfficeXPStyle;
try
Agent1.Characters.Load('myagent', ExtractFilePath(ParamStr(0))+'dot.acs');
myagent:=Agent1.Characters.Character('myagent');
myagent.Left:=strtoint(stra)-80;
myagent.Top:=strtoint(strb)-80;
myagent.MoveTo(100,500,100);
except
end;
if self.Readeidolon='1' then
begin
self.N136.Checked:=true;
try
myagent.Show(0);
myagent.Play('Wave');
myagent.Speak('欢迎使用RedHr-Office'+#13,'');
myagent.Play('LookLeft');
myagent.Speak('今天是'+FormatDateTime('dddddd',now),'');
myagent.Play('LookLeft');
myagent.Hide(0);
except
end;
end
else
self.N136.Checked:=false;
end;
procedure TMain.FormResize(Sender: TObject);
begin
self.PageControl1.Height:=(self.Height-60) div 2;
end;
procedure TMain.N46Click(Sender: TObject);
begin
postedit:=tpostedit.create(application);
postedit.showmodal;
self.r_staffpost.Refresh;
end;
procedure TMain.N42Click(Sender: TObject);
begin
if self.staffinfo.RecordCount=0 then exit;
self.PageControl1.ActivePageIndex:=0;
changepost:=tchangepost.create(application);
changepost.etype:=1;
changepost.showmodal;
self.stachpostedit.Close;
self.stachpostedit.Open;
self.r_staffpost.Close;
self.r_staffpost.Open;
end;
procedure TMain.N45Click(Sender: TObject);
begin
if self.staffinfo.RecordCount=0 then exit;
if self.stachpostedit.Active=false then exit;
if self.stachpostedit.RecordCount=0 then exit;
if Application.MessageBox('确认要删除所选择的职位变动记录吗?','提示',MB_YESNO )=IDYES then
begin
self.stachpostedit.Delete;
self.stachpostedit.Close;
self.stachpostedit.Open;
end;
end;
procedure TMain.N44Click(Sender: TObject);
var tmpid:string;
begin
if self.staffinfo.RecordCount=0 then exit;
if self.stachpostedit.Active=false then exit;
if self.stachpostedit.RecordCount=0 then exit;
changepost:=tchangepost.create(application);
tmpid:=self.stachpostedit.fieldbyname('postid').AsString;
changepost.etype:=2;
changepost.Label1.Caption:='现职位';
changepost.GroupBox1.Enabled:=false;
changepost.dxLookupTreeView1.Enabled:=false;
self.tmpquery.Close;
self.tmpquery.SQL.Clear;
self.tmpquery.SQL.Add('select * from r_staffpost');
self.tmpquery.Filtered:=false;
self.tmpquery.Filter:=format('id'+'='+'''%s''',[tmpid]);
self.tmpquery.Filtered:=true;
self.tmpquery.Open;
changepost.dxLookupTreeView1.Text:=self.tmpquery.fieldbyname('postname').AsString;
changepost.DateTimePicker1.Date:=self.stachpostedit.fieldbyname('postdate').AsDateTime;
changepost.Memo1.Lines.Text:=self.stachpostedit.fieldbyname('memo').AsVariant;
changepost.showmodal;
self.stachpostedit.Close;
self.stachpostedit.Open;
end;
procedure TMain.N20Click(Sender: TObject);
begin
corpmessage:=tcorpmessage.create(application);
corpmessage.showmodal;
end;
procedure TMain.N48Click(Sender: TObject);
var tmpid:string;
begin
if self.staffinfo.RecordCount=0 then exit;
tmpid:=self.staffinfo.fieldbyname('r_staffinfo.id').AsString;
RepStaffinfo:=tRepStaffinfo.create(application);
RepStaffinfo.ADOQuery2.Close;
RepStaffinfo.ADOQuery2.SQL.Clear;
RepStaffinfo.ADOQuery2.SQL.Add('select * from r_usercorp');
RepStaffinfo.ADOQuery2.Open;
RepStaffinfo.QRLabel2.Caption:=RepStaffinfo.ADOQuery2.fieldbyname('username').AsString+'员工资料卡';
RepStaffinfo.QRLabel1.Caption:='联系电话:'+RepStaffinfo.ADOQuery2.fieldbyname('tel').AsString
+' 传真号码:'+RepStaffinfo.ADOQuery2.fieldbyname('fax').AsString
+' 通讯地址:'+RepStaffinfo.ADOQuery2.fieldbyname('add').AsString;
RepStaffinfo.ADOQuery1.Close;
RepStaffinfo.ADOQuery1.SQL.Clear;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -