othermoenydef.pas
来自「pasa人力资源考勤管理系统」· PAS 代码 · 共 681 行 · 第 1/2 页
PAS
681 行
procedure TFormothermoneydef.DateTimePicker1CloseUp(Sender: TObject);
begin
maskedit1.text:=datetostr(datetimepicker1.date);
end;
procedure TFormothermoneydef.Button1Click(Sender: TObject);
var i,id,ygbhcd:integer;
hangh:string;
fmat1:string;
begin
if fmat='/' then
fmat1:=' / / ';
if fmat='-' then
fmat1:=' - - ';
with datamod do
begin
if not isdate(maskedit1.text) then
begin
application.messagebox('请输入正确的日期,否则将不能保存!','Warning',mb_ok+mb_iconwarning);
maskedit1.setfocus;
exit;
end; //if
Panel1.Visible:=true;
Gauge1.MaxValue:=Listbox2.Items.Count;
Gauge1.Progress :=0;
adopublic.open;
ygbhcd:=adopublicworknolength.AsInteger;
For i:=0 to Listbox2.Items.Count -1 do
begin
hanGh:=Copy(Listbox2.Items[i],1,ygbhcd );
try
Query1.close;
Query1.sql.clear;
// query1.sql.add('delete per24014 where left(convert(varchar,rq,111),7)=left(convert(varchar,'''+maskedit1.text+''',111),7) and workno='''+hangh+''' ');
Query1.sql.add('Insert into per24014 (workno,rq,addother,lastgive,decrese,memo,operator,cdate ,noname5,noname6,noname7,noname8,noname9,noname10,noname11) '+
'Select '''+hangh+''','''+maskedit1.text+''','+edit3.text+','+edit2.text+','+edit9.text+','''+memo1.text+''','''+pubworkname+''','''+datetostr(date)+''' '+
','+edit4.text+','+edit5.text+','+edit6.text+','+edit7.text+','+edit8.text+','+edit10.text+','+edit11.text+' ');
query1.sql.add('update per24014 set name=a.name from per24010 a where a.workno=per24014.workno and per24014.rq='''+maskedit1.text+''' ');
query1.sql.add('update per24014 set cardno=a.cardno from per24010 a where a.workno=per24014.workno and per24014.rq='''+maskedit1.text+''' ');
query1.sql.add('update per24014 set dept=a.dept from per24010 a where a.workno=per24014.workno and per24014.rq='''+maskedit1.text+''' ');
if checkbox1.checked then
query1.SQL.add('update per24014 set noname5b=1 where workno='''+hangh+''' and rq='''+maskedit1.text+''' ')
else
query1.sql.add('update per24014 set noname5b=0 where workno='''+hangh+''' and rq='''+maskedit1.text+''' ');
if checkbox2.checked then
query1.sql.add('update per24014 set noname6b=1 where workno='''+hangh+''' and rq='''+maskedit1.text+'''')
else
query1.sql.add('update per24014 set noname6b=0 where workno='''+hangh+''' and rq='''+maskedit1.text+'''');
if checkbox3.checked then
query1.sql.add('update per24014 set noname7b=1 where workno='''+hangh+''' and rq='''+maskedit1.text+'''')
else
query1.sql.add('update per24014 set noname7b=0 where workno='''+hangh+'''and rq='''+maskedit1.text+''' ');
if checkbox4.checked then
query1.sql.add('update per24014 set noname8b=1 where workno='''+hangh+''' and rq='''+maskedit1.text+''' ')
else
query1.sql.add('update per24014 set noname8b=0 where workno='''+hangh+''' and rq='''+maskedit1.text+'''');
if checkbox5.checked then
query1.sql.add('update per24014 set noname9b=1 where workno='''+hangh+''' and rq='''+maskedit1.text+'''')
else
query1.sql.add('update per24014 set noname9b=0 where workno='''+hangh+'''and rq='''+maskedit1.text+''' ');
if checkbox6.Checked then
query1.sql.add('update per24014 set noname10b=1 where workno='''+hangh+'''and rq='''+maskedit1.text+''' ')
else
query1.sql.add('update per24014 set noname10b=0 where workno='''+hangh+''' and rq='''+maskedit1.text+'''');
if checkbox7.checked then
query1.sql.add('update per24014 set noname11b=1 where workno='''+hangh+'''and rq='''+maskedit1.text+''' ')
else
query1.sql.add('update per24014 set noname11b=0 where workno='''+hangh+''' and rq='''+maskedit1.text+'''');
Query1.execsql;
except
end;
Gauge1.AddProgress(1);
end; //for
panel1.visible:=false;
adopublic.close;
id:=application.messagebox('继续新增吗?','请问',mb_yesnocancel+mb_iconquestion);
if (id=7) then
close
else if (id=6) then
begin
formcreate(sender);
edit4.Text:='0';
edit5.Text:='0';
edit6.Text:='0';
edit7.Text:='0';
edit8.Text:='0';
edit10.Text:='0';
edit11.Text:='0';
maskedit1.Text:=fmat1;
listbox1.Items.Clear;
listbox2.Items.Clear;
combobox1.text:='';
end;
end; //with
end;
procedure TFormothermoneydef.N1Click(Sender: TObject);
var
clickok:boolean;
aqy,aqy1:tadoquery;
noname5:string;
begin
clickok:=inputquery('请录入新的薪资名称','薪资名称',noname5);
if clickok or (noname5<>' ') then
begin
aqy:=tadoquery.create(application);
aqy.connection:=datamod.database1;
aqy.Close;
aqy.SQL.clear;
aqy.sql.add('select * from salnoname where noname5 is not null');
aqy.open;
aqy1:=tadoquery.create(application);
aqy1.connection:=datamod.database1;
aqy1.close;
aqy1.sql.clear;
if aqy.Eof then
begin
aqy1.sql.add('insert into salnoname(noname5) values ('''+noname5+''') ');
end else
begin
aqy1.sql.add('update salnoname set noname5='''+noname5+''' ');
end;
aqy1.ExecSQL;
label7.caption:=noname5;
label7.update;
end;
//end;
end;
procedure TFormothermoneydef.N2Click(Sender: TObject);
var
noname6:string;
clickok:boolean;
aqy,aqy1:tadoquery;
begin
clickok:=inputquery('请录入新的薪资名称','薪资名称',noname6);
if clickok or(noname6<>' ') then
begin
aqy:=tadoquery.create(application);
aqy.connection:=datamod.database1;
aqy.Close;
aqy.SQL.clear;
aqy.sql.add('select * from salnoname where noname6 is not null ');
aqy.Open;
aqy1:=tadoquery.Create(application);
aqy1.connection:=datamod.database1;
aqy1.close;
aqy1.sql.clear;
if aqy.eof then
begin
aqy1.SQL.add('insert into salnoname(noname6) values ('''+noname6+''')');
end else
begin
aqy1.sql.Add('update salnoname set noname6 ='''+noname6+''' ');
end ;
aqy1.execsql;
label15.Caption:=noname6;
label15.update;
end;
//end;
end;
procedure TFormothermoneydef.N3Click(Sender: TObject);
var
noname7:string;
clickok:boolean;
aqy,aqy1:tadoquery;
begin
clickok:=inputquery('请录入新的薪资名称','薪资名称',noname7);
if clickok or(noname7<>' ') then
begin
aqy:=tadoquery.create(application);
aqy.connection:=datamod.database1;
aqy.Close;
aqy.SQL.clear;
aqy.sql.add('select * from salnoname where noname7 is not null ');
aqy.Open;
aqy1:=tadoquery.Create(application);
aqy1.connection:=datamod.database1;
aqy1.close;
aqy1.sql.clear;
if aqy.eof then
begin
aqy1.SQL.add('insert into salnoname(noname7) values ('''+noname7+''')');
end else
begin
aqy1.sql.Add('update salnoname set noname7 ='''+noname7+''' ');
end ;
aqy1.execsql;
label16.Caption:=noname7;
label16.update;
end;
//end;
end;
procedure TFormothermoneydef.N4Click(Sender: TObject);
var
noname8:string;
clickok:boolean;
aqy,aqy1:tadoquery;
begin
clickok:=inputquery('请录入新的薪资名称','薪资名称',noname8);
if clickok or(noname8<>' ') then
begin
aqy:=tadoquery.create(application);
aqy.connection:=datamod.database1;
aqy.Close;
aqy.SQL.clear;
aqy.sql.add('select * from salnoname where noname8 is not null ');
aqy.Open;
aqy1:=tadoquery.Create(application);
aqy1.connection:=datamod.database1;
aqy1.close;
aqy1.sql.clear;
if aqy.eof then
begin
aqy1.SQL.add('insert into salnoname(noname8) values ('''+noname8+''')');
end else
begin
aqy1.sql.Add('update salnoname set noname8 ='''+noname8+''' ');
end ;
aqy1.execsql;
label17.Caption:=noname8;
label17.update;
end;
//end;
end;
procedure TFormothermoneydef.N5Click(Sender: TObject);
var
noname9:string;
clickok:boolean;
aqy,aqy1:tadoquery;
begin
clickok:=inputquery('请录入新的薪资名称','薪资名称',noname9);
if clickok or(noname9<>' ') then
begin
aqy:=tadoquery.create(application);
aqy.connection:=datamod.database1;
aqy.Close;
aqy.SQL.clear;
aqy.sql.add('select * from salnoname where noname9 is not null ');
aqy.Open;
aqy1:=tadoquery.Create(application);
aqy1.connection:=datamod.database1;
aqy1.close;
aqy1.sql.clear;
if aqy.eof then
begin
aqy1.SQL.add('insert into salnoname(noname9) values ('''+noname9+''')');
end else
begin
aqy1.sql.Add('update salnoname set noname9 ='''+noname9+''' ');
end ;
aqy1.execsql;
label9.Caption:=noname9;
label9.update;
end;
//end;
end;
procedure TFormothermoneydef.N6Click(Sender: TObject);
var
noname10:string;
clickok:boolean;
aqy,aqy1:tadoquery;
begin
clickok:=inputquery('请录入新的薪资名称','薪资名称',noname10);
if clickok or(noname10<>' ') then
begin
aqy:=tadoquery.create(application);
aqy.connection:=datamod.database1;
aqy.Close;
aqy.SQL.clear;
aqy.sql.add('select * from salnoname where noname10 is not null ');
aqy.Open;
aqy1:=tadoquery.Create(application);
aqy1.connection:=datamod.database1;
aqy1.close;
aqy1.sql.clear;
if aqy.eof then
begin
aqy1.SQL.add('insert into salnoname(noname10) values ('''+noname10+''')');
end else
begin
aqy1.sql.Add('update salnoname set noname10 ='''+noname10+''' ');
end ;
aqy1.execsql;
label13.Caption:=noname10;
label13.update;
end;
//end;
end;
procedure TFormothermoneydef.N7Click(Sender: TObject);
var
noname11:string;
clickok:boolean;
aqy,aqy1:tadoquery;
begin
clickok:=inputquery('请录入新的薪资名称','薪资名称',noname11);
if clickok or(noname11<>' ') then
begin
aqy:=tadoquery.create(application);
aqy.connection:=datamod.database1;
aqy.Close;
aqy.SQL.clear;
aqy.sql.add('select * from salnoname where noname11 is not null ');
aqy.Open;
aqy1:=tadoquery.Create(application);
aqy1.connection:=datamod.database1;
aqy1.close;
aqy1.sql.clear;
if aqy.eof then
begin
aqy1.SQL.add('insert into salnoname(noname11) values ('''+noname11+''')');
end else
begin
aqy1.sql.Add('update salnoname set noname11 ='''+noname11+''' ');
end ;
aqy1.execsql;
label11.Caption:=noname11;
label11.update;
end;
//end;
end;
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?