📄 main.~pas
字号:
if day<>adotable2.FieldByName('发放工资日期').AsDateTime then
n26.Enabled:=false
else
n26.Enabled:=true;
adotable2.Close;
end;
procedure Tmain_form.xtcshClick(Sender: TObject);
var k:integer;adoquery1:tadoquery;
begin
statusbar1.Panels[1].Text:=' 系统初始化!';
k:=application.MessageBox('确定要清空所有数据库信息吗?','严重警告!',49);
if k=id_ok then
begin
adoquery1:=tadoquery.Create(self);
adoquery1.Connection:=adoConnection1;
adoquery1.Close();
adoquery1.SQL.Clear;
adoquery1.SQL.Add('delete * from 当月工资表');
adoquery1.ExecSQL;
adoquery1.Close();
adoquery1.SQL.Clear;
adoquery1.SQL.Add('delete * from 分征点设置表');
adoquery1.ExecSQL;
adoquery1.Close();
adoquery1.SQL.Clear;
adoquery1.SQL.Add('delete * from 工资历史信息表');
adoquery1.ExecSQL;
adoquery1.Close();
adoquery1.SQL.Clear;
adoquery1.SQL.Add('delete * from 职工信息表');
adoquery1.ExecSQL;
adoquery1.Close();
adoquery1.SQL.Clear;
adoquery1.SQL.Add('delete * from 职工工资信息表');
adoquery1.ExecSQL;
adoquery1.Close();
application.MessageBox('初始化结束!','提示!',mb_ok);
end;
end;
procedure Tmain_form.N8Click(Sender: TObject);
begin
statusbar1.Panels[1].Text:=' 职工资料录入!';
Zgxxlr_Form:=TZgxxlr_Form.Create(Application);
Zgxxlr_Form.Show;
end;
procedure Tmain_form.N22Click(Sender: TObject);
begin
statusbar1.Panels[1].Text:=' 设置背景一!';
icon_str:=ExtractFilePath(application.ExeName)+'\icon\1.bmp';
form_draw;
end;
procedure Tmain_form.N23Click(Sender: TObject);
begin
statusbar1.Panels[1].Text:=' 设置背景二!';
icon_str:=ExtractFilePath(application.ExeName)+'\icon\2.bmp';
form_draw;
end;
procedure Tmain_form.N24Click(Sender: TObject);
begin
statusbar1.Panels[1].Text:=' 职工资料删除!';
Zl_Del_Form:=TZl_Del_Form.Create(application);
Zl_Del_Form.Show;
end;
procedure Tmain_form.N17Click(Sender: TObject);
begin
statusbar1.Panels[1].Text:=' 职工资料修改!';
Zl_Update_Form:=TZl_Update_Form.Create(application);
Zl_Update_Form.Show;
end;
procedure Tmain_form.N31Click(Sender: TObject);
begin
statusbar1.Panels[1].Text:=' 设置背景三!';
icon_str:=ExtractFilePath(application.ExeName)+'\icon\3.bmp';
form_draw;
end;
procedure Tmain_form.N15Click(Sender: TObject);
begin
statusbar1.Panels[1].Text:=' 查看当月工资表!';
Dygzxxb_Form:=TDygzxxb_Form.Create(application);
Dygzxxb_Form.Show;
end;
procedure Tmain_form.N26Click(Sender: TObject);
var k:integer;adoquery1:tadoquery;
begin
statusbar1.Panels[1].Text:=' 生成当月工资表!';
decodedate(now,year,month,day);
k:=application.MessageBox('确定要生成当月工资表吗?','严重警告!',49);
if k=id_ok then
begin
//---------------------------------------------------------
//***********************删除当月工资表信息重新生成*********
//----------------------------------------------------------
adoquery1:=tadoquery.Create(self);
adoquery1.Connection:=adoConnection1;
adoquery1.Close();
adoquery1.SQL.Clear;
adoquery1.SQL.Add('delete * from 当月工资表');
adoquery1.ExecSQL;
adoquery1.Close();
adotable1.Close;
adotable1.Connection:=ADOConnection1;
adotable1.TableName:='职工工资信息表';
adotable1.Active:=true;
adotable2.Close;
adotable2.Connection:=ADOConnection1;
adotable2.TableName:='当月工资表';
adotable2.Active:=true;
adotable3.Close;
adotable3.Connection:=ADOConnection1;
adotable3.TableName:='工资历史信息表';
adotable3.Active:=true;
while adotable1.Eof <> true do
begin
adotable2.Append;
adotable3.Append;
if adotable1.FieldByName('冻结标志').AsBoolean=false then
begin
//-------------------------------------------------------------------------------------------------
//----------------------------向当月工资信息表写信息-----------------------------------------------
//-------------------------------------------------------------------------------------------------
adotable2.FieldByName('职工编号').AsInteger:=adotable1.FieldByName('职工编号').AsInteger;
adotable2.FieldByName('职工姓名').AsString:=adotable1.FieldByName('职工姓名').AsString;
adotable2.FieldByName('工资编号').AsInteger:=adotable1.FieldByName('工资编号').AsInteger;
adotable2.FieldByName('基本工资').AsCurrency:=adotable1.FieldByName('基本工资').AsCurrency;
adotable2.FieldByName('浮动工资').AsCurrency:=adotable1.FieldByName('浮动工资').AsCurrency;
adotable2.FieldByName('津贴').AsCurrency:=adotable1.FieldByName('津贴').AsCurrency;
adotable2.FieldByName('工龄工资').AsCurrency:=adotable1.FieldByName('工龄工资').AsCurrency;
adotable2.FieldByName('奖金').AsCurrency:=adotable1.FieldByName('奖金').AsCurrency;
adotable2.FieldByName('补贴').AsCurrency:=adotable1.FieldByName('补贴').AsCurrency;
adotable2.FieldByName('其他').AsCurrency:=adotable1.FieldByName('其他').AsCurrency;
adotable2.FieldByName('保险费').AsCurrency:=adotable1.FieldByName('保险费').AsCurrency;
adotable2.FieldByName('房租').AsCurrency:=adotable1.FieldByName('房租费').AsCurrency;
adotable2.FieldByName('补扣').AsCurrency:=adotable1.FieldByName('补扣').AsCurrency;
adotable2.FieldByName('工资总额').AsCurrency:=adotable1.FieldByName('工资总额').AsCurrency;
adotable2.FieldByName('实发工资').AsCurrency:=adotable1.FieldByName('实发工资').AsCurrency;
adotable2.FieldByName('税率').AsFloat:=adotable1.FieldByName('税率').AsFloat;
adotable2.FieldByName('所得税').AsCurrency:=adotable1.FieldByName('所得税').AsCurrency;
adotable2.FieldByName('工资月份').AsInteger:=month;
adotable2.FieldByName('操作员').AsString:=username;
adotable2.FieldByName('说明').AsString:=inttostr(year)+'年'+inttostr(month)+'月'+'的工资表';
adotable2.Post;
adotable2.Next;
//-------------------------------------------------------------------------------------------------
//----------------------------向工资历史信息表写信息-----------------------------------------------
//-------------------------------------------------------------------------------------------------
adotable3.FieldByName('职工编号').AsInteger:=adotable1.FieldByName('职工编号').AsInteger;
adotable3.FieldByName('职工姓名').AsString:=adotable1.FieldByName('职工姓名').AsString;
adotable3.FieldByName('工资编号').AsInteger:=adotable1.FieldByName('工资编号').AsInteger;
adotable3.FieldByName('基本工资').AsCurrency:=adotable1.FieldByName('基本工资').AsCurrency;
adotable3.FieldByName('浮动工资').AsCurrency:=adotable1.FieldByName('浮动工资').AsCurrency;
adotable3.FieldByName('津贴').AsCurrency:=adotable1.FieldByName('津贴').AsCurrency;
adotable3.FieldByName('工龄工资').AsCurrency:=adotable1.FieldByName('工龄工资').AsCurrency;
adotable3.FieldByName('奖金').AsCurrency:=adotable1.FieldByName('奖金').AsCurrency;
adotable3.FieldByName('补贴').AsCurrency:=adotable1.FieldByName('补贴').AsCurrency;
adotable3.FieldByName('其他').AsCurrency:=adotable1.FieldByName('其他').AsCurrency;
adotable3.FieldByName('保险费').AsCurrency:=adotable1.FieldByName('保险费').AsCurrency;
adotable3.FieldByName('房租费').AsCurrency:=adotable1.FieldByName('房租费').AsCurrency;
adotable3.FieldByName('补扣').AsCurrency:=adotable1.FieldByName('补扣').AsCurrency;
adotable3.FieldByName('工资总额').AsCurrency:=adotable1.FieldByName('工资总额').AsCurrency;
adotable3.FieldByName('实发工资').AsCurrency:=adotable1.FieldByName('实发工资').AsCurrency;
adotable3.FieldByName('所得税').AsCurrency:=adotable1.FieldByName('所得税').AsCurrency;
adotable3.FieldByName('税率').AsFloat:=adotable1.FieldByName('税率').AsFloat;
adotable3.FieldByName('工资月份').AsInteger:=month;
adotable3.FieldByName('操作时间').AsDateTime:=date();
adotable3.FieldByName('操作员').AsString:=username;
adotable3.FieldByName('说明').AsString:=inttostr(year)+'年'+inttostr(month)+'月'+'的工资表';
adotable3.Post;
adotable3.Next
end;
adotable1.Next;
end;
adotable1.Close;
adotable3.Close;
end;
end;
procedure Tmain_form.S1Click(Sender: TObject);
begin
//设置税率
statusbar1.Panels[1].Text:=' 设置所得税率!';
Tax_Form:=TTax_Form.Create(application);
Tax_Form.ShowModal;
end;
procedure Tmain_form.C1Click(Sender: TObject);
begin
//工资信息设定
statusbar1.Panels[1].Text:=' 工资信息设定!';
Gzxxsd_Form:=TGzxxsd_Form.Create(application);
Gzxxsd_Form.ShowModal;
end;
procedure Tmain_form.N30Click(Sender: TObject);
var K:integer;
begin
statusbar1.Panels[1].Text:=' 工资发放日期设定!';
k:=application.MessageBox('确定要将今日设为发工资日吗?','提醒!',49);
if k=id_ok then
begin
adotable2.Close;
adotable2.Connection:=ADOConnection1;
adotable2.TableName:='发放工资日期';
adotable2.Active:=true;
adotable2.Edit;
adotable2.FieldByName('发放工资日期').AsDateTime:=day;
adotable2.Post;
adotable2.Close;
n26.Enabled:=true;
application.MessageBox('设定完成!','提醒!',mb_ok);
end;
end;
procedure Tmain_form.N13Click(Sender: TObject);
begin
statusbar1.Panels[1].Text:=' 查看当月工资!';
CX_DYGZ_Form:=TCX_DYGZ_Form.Create(application);
CX_DYGZ_Form.ShowModal;
end;
procedure Tmain_form.N7Click(Sender: TObject);
begin
statusbar1.Panels[1].Text:=' 查看人事资料!';
CX_Renshi_Form:=TCX_Renshi_Form.Create(application);
CX_Renshi_Form.ShowModal;
end;
procedure Tmain_form.N16Click(Sender: TObject);
begin
statusbar1.Panels[1].Text:=' 查看全部工资信息!';
Gx_LSJL_Form:=TGx_LSJL_Form.Create(application);
Gx_LSJL_Form.ShowModal;
end;
procedure Tmain_form.N19Click(Sender: TObject);
begin
statusbar1.Panels[1].Text:=' 本软件信息!';
Help_Form:=THelp_Form.Create(application);
Help_Form.ShowModal;
end;
procedure Tmain_form.N20Click(Sender: TObject);
var str:string;
begin
str:=ExtractFilePath(application.ExeName)+'\help\help.hlp';
statusbar1.Panels[1].Text:=' 对于给您带来的不便,深表歉意,如有疑问可以与我联系!';
ShellExecute(application.Handle, 'open', pchar(str), NiL, NiL,SW_MINIMIZE );
end;
procedure Tmain_form.N29Click(Sender: TObject);
var str:pchar;
begin
str:='mailto:dingchangling001221@126.com?subject=遇到新问题';
ShellExecute(application.Handle, nil,pchar(str) , NiL, NiL, SW_SHOWNORMAL);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -