📄 find.pas
字号:
dbgdshowfind.Columns[8].Field:=datasource1.DataSet.FieldByName('isjh');
dbgdshowfind.Columns[8].Width:=datasource1.DataSet.Fields[8].DisplayWidth+50;
dbgdshowfind.Columns[9].Field:=datasource1.DataSet.FieldByName('worksort');
dbgdshowfind.Columns[9].Width:=datasource1.DataSet.Fields[9].DisplayWidth+50;
dbgdshowfind.Columns[10].Field:=datasource1.DataSet.FieldByName('position');
dbgdshowfind.Columns[10].Width:=datasource1.DataSet.Fields[10].DisplayWidth+40;
dbgdshowfind.Columns[11].Field:=datasource1.DataSet.FieldByName('ygbm');
dbgdshowfind.Columns[11].Width:=datasource1.DataSet.Fields[11].DisplayWidth+50;
dbgdshowfind.Columns[12].Field:=datasource1.DataSet.FieldByName('rcrq');
dbgdshowfind.Columns[12].Width:=datasource1.DataSet.Fields[12].DisplayWidth+50;
dbgdshowfind.Columns[13].Field:=datasource1.DataSet.FieldByName('ygjy');
dbgdshowfind.Columns[13].Width:=datasource1.DataSet.Fields[13].DisplayWidth+40;
i:=0;
cmbeducation.Text:='';
cmbeducation.SetFocus;
checkeducation.Checked:=false;
end
else
begin
if cmbbm.Text<>'' then
begin
dmrsgl.ygjbzlqry.Close;
dmrsgl.ygjbzlqry.SQL.Clear;
dmrsgl.ygjbzlqry.SQL.Add('select * from employeer where ygbm='+quotedstr(cmbbm.Text));
dmrsgl.ygjbzlqry.Open;
if dmrsgl.ygjbzlqry.RecordCount=0 then
begin
showmessage('对不起!找不到部门是'+trim(cmbbm.Text)+'记录,请重新查询.');
i:=0;
checkbm.Checked:=false;
cmbbm.Text:='';
cmbbm.SetFocus;
exit;
end;
dbgdshowfind.DataSource:=datasource1;
dbgdshowfind.Columns[0].Field:=datasource1.DataSet.FieldByName('number');
dbgdshowfind.Columns[0].Width:=datasource1.DataSet.Fields[0].DisplayWidth+50;
dbgdshowfind.Columns[1].Field:=datasource1.DataSet.FieldByName('name');
dbgdshowfind.Columns[1].Width:=datasource1.DataSet.Fields[1].DisplayWidth+40;
dbgdshowfind.Columns[2].Field:=datasource1.DataSet.FieldByName('sex');
dbgdshowfind.Columns[2].Width:=datasource1.DataSet.Fields[2].DisplayWidth+50;
dbgdshowfind.Columns[3].Field:=datasource1.DataSet.FieldByName('comefrom');
dbgdshowfind.Columns[3].Width:=datasource1.DataSet.Fields[3].DisplayWidth+50;
dbgdshowfind.Columns[4].Field:=datasource1.DataSet.FieldByName('birthday');
dbgdshowfind.Columns[4].Width:=datasource1.DataSet.Fields[4].DisplayWidth+40;
dbgdshowfind.Columns[5].Field:=datasource1.DataSet.FieldByName('ygmz');
dbgdshowfind.Columns[5].Width:=datasource1.DataSet.Fields[5].DisplayWidth+50;
dbgdshowfind.Columns[6].Field:=datasource1.DataSet.FieldByName('education');
dbgdshowfind.Columns[6].Width:=datasource1.DataSet.Fields[6].DisplayWidth+50;
dbgdshowfind.Columns[7].Field:=datasource1.DataSet.FieldByName('phone');
dbgdshowfind.Columns[7].Width:=datasource1.DataSet.Fields[7].DisplayWidth+40;
dbgdshowfind.Columns[8].Field:=datasource1.DataSet.FieldByName('isjh');
dbgdshowfind.Columns[8].Width:=datasource1.DataSet.Fields[8].DisplayWidth+50;
dbgdshowfind.Columns[9].Field:=datasource1.DataSet.FieldByName('worksort');
dbgdshowfind.Columns[9].Width:=datasource1.DataSet.Fields[9].DisplayWidth+50;
dbgdshowfind.Columns[10].Field:=datasource1.DataSet.FieldByName('position');
dbgdshowfind.Columns[10].Width:=datasource1.DataSet.Fields[10].DisplayWidth+40;
dbgdshowfind.Columns[11].Field:=datasource1.DataSet.FieldByName('ygbm');
dbgdshowfind.Columns[11].Width:=datasource1.DataSet.Fields[11].DisplayWidth+50;
dbgdshowfind.Columns[12].Field:=datasource1.DataSet.FieldByName('rcrq');
dbgdshowfind.Columns[12].Width:=datasource1.DataSet.Fields[12].DisplayWidth+50;
dbgdshowfind.Columns[13].Field:=datasource1.DataSet.FieldByName('ygjy');
dbgdshowfind.Columns[13].Width:=datasource1.DataSet.Fields[13].DisplayWidth+40;
i:=0;
cmbbm.Text:='';
cmbbm.SetFocus;
checkbm.Checked:=false;
end
else
begin
if cmbsortwork.Text<>'' then
begin
dmrsgl.ygjbzlqry.Close;
dmrsgl.ygjbzlqry.SQL.Clear;
dmrsgl.ygjbzlqry.SQL.Add('select * from employeer where worksort='+quotedstr(cmbsortwork.Text));
dmrsgl.ygjbzlqry.Open;
if dmrsgl.ygjbzlqry.RecordCount=0 then
begin
showmessage('对不起!找不到工种是'+trim(cmbsortwork.Text)+'记录,请重新查询.');
i:=0;
checksortwork.Checked:=false;
cmbsortwork.Text:='';
cmbsortwork.SetFocus;
exit;
end;
dbgdshowfind.DataSource:=datasource1;
dbgdshowfind.Columns[0].Field:=datasource1.DataSet.FieldByName('number');
dbgdshowfind.Columns[0].Width:=datasource1.DataSet.Fields[0].DisplayWidth+50;
dbgdshowfind.Columns[1].Field:=datasource1.DataSet.FieldByName('name');
dbgdshowfind.Columns[1].Width:=datasource1.DataSet.Fields[1].DisplayWidth+40;
dbgdshowfind.Columns[2].Field:=datasource1.DataSet.FieldByName('sex');
dbgdshowfind.Columns[2].Width:=datasource1.DataSet.Fields[2].DisplayWidth+50;
dbgdshowfind.Columns[3].Field:=datasource1.DataSet.FieldByName('comefrom');
dbgdshowfind.Columns[3].Width:=datasource1.DataSet.Fields[3].DisplayWidth+50;
dbgdshowfind.Columns[4].Field:=datasource1.DataSet.FieldByName('birthday');
dbgdshowfind.Columns[4].Width:=datasource1.DataSet.Fields[4].DisplayWidth+40;
dbgdshowfind.Columns[5].Field:=datasource1.DataSet.FieldByName('ygmz');
dbgdshowfind.Columns[5].Width:=datasource1.DataSet.Fields[5].DisplayWidth+50;
dbgdshowfind.Columns[6].Field:=datasource1.DataSet.FieldByName('education');
dbgdshowfind.Columns[6].Width:=datasource1.DataSet.Fields[6].DisplayWidth+50;
dbgdshowfind.Columns[7].Field:=datasource1.DataSet.FieldByName('phone');
dbgdshowfind.Columns[7].Width:=datasource1.DataSet.Fields[7].DisplayWidth+40;
dbgdshowfind.Columns[8].Field:=datasource1.DataSet.FieldByName('isjh');
dbgdshowfind.Columns[8].Width:=datasource1.DataSet.Fields[8].DisplayWidth+50;
dbgdshowfind.Columns[9].Field:=datasource1.DataSet.FieldByName('worksort');
dbgdshowfind.Columns[9].Width:=datasource1.DataSet.Fields[9].DisplayWidth+50;
dbgdshowfind.Columns[10].Field:=datasource1.DataSet.FieldByName('position');
dbgdshowfind.Columns[10].Width:=datasource1.DataSet.Fields[10].DisplayWidth+40;
dbgdshowfind.Columns[11].Field:=datasource1.DataSet.FieldByName('ygbm');
dbgdshowfind.Columns[11].Width:=datasource1.DataSet.Fields[11].DisplayWidth+50;
dbgdshowfind.Columns[12].Field:=datasource1.DataSet.FieldByName('rcrq');
dbgdshowfind.Columns[12].Width:=datasource1.DataSet.Fields[12].DisplayWidth+50;
dbgdshowfind.Columns[13].Field:=datasource1.DataSet.FieldByName('ygjy');
dbgdshowfind.Columns[13].Width:=datasource1.DataSet.Fields[13].DisplayWidth+40;
i:=0;
cmbsortwork.Text:='';
cmbsortwork.SetFocus;
checksortwork.Checked:=false;
end
else
begin
if edbirthday.Text<>'' then
begin
dmrsgl.ygjbzlqry.Close;
dmrsgl.ygjbzlqry.SQL.Clear;
dmrsgl.ygjbzlqry.SQL.Add('select * from employeer where birthday='+'#'+edbirthday.Text+'#');
dmrsgl.ygjbzlqry.Open;
if dmrsgl.ygjbzlqry.RecordCount=0 then
begin
showmessage('对不起!找不到出生日期是'+trim(edbirthday.Text)+'记录,请重新查询.');
i:=0;
checkbirthday.Checked:=false;
edbirthday.Text:='';
edbirthday.SetFocus;
exit;
end;
dbgdshowfind.DataSource:=datasource1;
dbgdshowfind.Columns[0].Field:=datasource1.DataSet.FieldByName('number');
dbgdshowfind.Columns[0].Width:=datasource1.DataSet.Fields[0].DisplayWidth+50;
dbgdshowfind.Columns[1].Field:=datasource1.DataSet.FieldByName('name');
dbgdshowfind.Columns[1].Width:=datasource1.DataSet.Fields[1].DisplayWidth+40;
dbgdshowfind.Columns[2].Field:=datasource1.DataSet.FieldByName('sex');
dbgdshowfind.Columns[2].Width:=datasource1.DataSet.Fields[2].DisplayWidth+50;
dbgdshowfind.Columns[3].Field:=datasource1.DataSet.FieldByName('comefrom');
dbgdshowfind.Columns[3].Width:=datasource1.DataSet.Fields[3].DisplayWidth+50;
dbgdshowfind.Columns[4].Field:=datasource1.DataSet.FieldByName('birthday');
dbgdshowfind.Columns[4].Width:=datasource1.DataSet.Fields[4].DisplayWidth+40;
dbgdshowfind.Columns[5].Field:=datasource1.DataSet.FieldByName('ygmz');
dbgdshowfind.Columns[5].Width:=datasource1.DataSet.Fields[5].DisplayWidth+50;
dbgdshowfind.Columns[6].Field:=datasource1.DataSet.FieldByName('education');
dbgdshowfind.Columns[6].Width:=datasource1.DataSet.Fields[6].DisplayWidth+50;
dbgdshowfind.Columns[7].Field:=datasource1.DataSet.FieldByName('phone');
dbgdshowfind.Columns[7].Width:=datasource1.DataSet.Fields[7].DisplayWidth+40;
dbgdshowfind.Columns[8].Field:=datasource1.DataSet.FieldByName('isjh');
dbgdshowfind.Columns[8].Width:=datasource1.DataSet.Fields[8].DisplayWidth+50;
dbgdshowfind.Columns[9].Field:=datasource1.DataSet.FieldByName('worksort');
dbgdshowfind.Columns[9].Width:=datasource1.DataSet.Fields[9].DisplayWidth+50;
dbgdshowfind.Columns[10].Field:=datasource1.DataSet.FieldByName('position');
dbgdshowfind.Columns[10].Width:=datasource1.DataSet.Fields[10].DisplayWidth+40;
dbgdshowfind.Columns[11].Field:=datasource1.DataSet.FieldByName('ygbm');
dbgdshowfind.Columns[11].Width:=datasource1.DataSet.Fields[11].DisplayWidth+50;
dbgdshowfind.Columns[12].Field:=datasource1.DataSet.FieldByName('rcrq');
dbgdshowfind.Columns[12].Width:=datasource1.DataSet.Fields[12].DisplayWidth+50;
dbgdshowfind.Columns[13].Field:=datasource1.DataSet.FieldByName('ygjy');
dbgdshowfind.Columns[13].Width:=datasource1.DataSet.Fields[13].DisplayWidth+40;
i:=0;
edbirthday.Text:='';
edbirthday.SetFocus;
checkbirthday.Checked:=false;
end
else
begin
showmessage('请输入要查询的内容');
i:=0;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end
else
begin
//j:=0;
s1:='select * from employeer';
s2:='';
if cmbif.Text='' then
begin
messagedlg('对于多重查询连接条件不能为空,请选择条件!',mtwarning,[mbok],0);
cmbif.SetFocus;
abort;
end;
if cmbsex.text<>'' then
begin
s2:=s2+' where sex='''+trim(cmbsex.Text)+''' ';
//j:=j+1;
end
else
begin
s2:='';
end;
if (edmz.text<>'') and (s2<>'') then
begin
s2:=s2+cmbif.Text+' ygmz='''+trim(edmz.Text)+''' ';
end
else
begin
if s2='' then
s2:=' where ygmz='''+trim(edmz.Text)+''' ';
if cmbhf.Text='' then
s2:=s2;
end;
if (cmbhf.Text<>'') and (s2<>'') then
begin
s2:=s2+cmbif.Text+' isjh='''+trim(cmbhf.Text)+''' ';
end
else
begin
if s2='' then
s2:=' where isjh='''+trim(cmbhf.Text)+''' ';
if cmbeducation.Text='' then
s2:=s2;
end;
if (cmbeducation.Text<>'') and (s2<>'') then
begin
s2:=s2+cmbif.Text+' education='''+trim(cmbeducation.Text)+''' ';
end
else
begin
if s2='' then
s2:=' where education='''+trim(cmbeducation.Text)+''' ';
if cmbbm.Text='' then
s2:=s2;
end;
if (cmbbm.text<>'') and (s2<>'') then
begin
s2:=s2+cmbif.text+' ygbm='''+trim(cmbbm.Text)+''' ';
end
else
begin
if s2='' then
s2:=' where ygbm='''+trim(cmbbm.Text)+''' ';
if cmbsortwork.Text='' then
s2:=s2;
end;
if (cmbsortwork.Text<>'') and (s2<>'') then
begin
s2:=s2+cmbif.text+' worksort='''+trim(cmbsortwork.Text)+''' ';
end
else
begin
if s2='' then
s2:=' where worksort='''+trim(cmbsortwork.Text)+''' ';
if edbirthday.Text='' then
s2:=s2;
end;
if (edbirthday.Text<>'') and (s2<>'') then
begin
s2:=s2+cmbif.Text+' birthday='+'#'+edbirthday.Text+'#';
end
else
begin
if s2='' then
s2:=' where birthday='+'#'+edbirthday.Text+'#';
end;
s1:=s1+s2;
dmrsgl.ygjbzlqry.Close;
dmrsgl.ygjbzlqry.SQL.Clear;
dmrsgl.ygjbzlqry.sql.add(s1);
dmrsgl.ygjbzlqry.Open;
if dmrsgl.ygjbzlqry.RecordCount=0 then
begin
showmessage('对不起!'+'找不到您要查找的记录');
cmbsex.Text:='';
cmbhf.Text:='';
cmbeducation.Text:='';
cmbbm.Text:='';
cmbsortwork.Text:='';
edbirthday.Text:='';
edmz.Text:='';
checksex.Checked:=false;
checkmz.Checked:=false;
checkhf.Checked:=false;
checkeducation.Checked:=false;
checkbm.Checked:=false;
checksortwork.Checked:=false;
checkbirthday.Checked:=false;
//j:=0;
i:=0;
exit;
end
else
begin
dbgdshowfind.DataSource:=datasource1;
dbgdshowfind.Columns[0].Field:=datasource1.DataSet.FieldByName('number');
dbgdshowfind.Columns[0].Width:=datasource1.DataSet.Fields[0].DisplayWidth+50;
dbgdshowfind.Columns[1].Field:=datasource1.DataSet.FieldByName('name');
dbgdshowfind.Columns[1].Width:=datasource1.DataSet.Fields[1].DisplayWidth+40;
dbgdshowfind.Columns[2].Field:=datasource1.DataSet.FieldByName('sex');
dbgdshowfind.Columns[2].Width:=datasource1.DataSet.Fields[2].DisplayWidth+50;
dbgdshowfind.Columns[3].Field:=datasource1.DataSet.FieldByName('comefrom');
dbgdshowfind.Columns[3].Width:=datasource1.DataSet.Fields[3].DisplayWidth+50;
dbgdshowfind.Columns[4].Field:=datasource1.DataSet.FieldByName('birthday');
dbgdshowfind.Columns[4].Width:=datasource1.DataSet.Fields[4].DisplayWidth+40;
dbgdshowfind.Columns[5].Field:=datasource1.DataSet.FieldByName('ygmz');
dbgdshowfind.Columns[5].Width:=datasource1.DataSet.Fields[5].DisplayWidth+50;
dbgdshowfind.Columns[6].Field:=datasource1.DataSet.FieldByName('education');
dbgdshowfind.Columns[6].Width:=datasource1.DataSet.Fields[6].DisplayWidth+50;
dbgdshowfind.Columns[7].Field:=datasource1.DataSet.FieldByName('phone');
dbgdshowfind.Columns[7].Width:=datasource1.DataSet.Fields[7].DisplayWidth+40;
dbgdshowfind.Columns[8].Field:=datasource1.DataSet.FieldByName('isjh');
dbgdshowfind.Columns[8].Width:=datasource1.DataSet.Fields[8].DisplayWidth+50;
dbgdshowfind.Columns[9].Field:=datasource1.DataSet.FieldByName('worksort');
dbgdshowfind.Columns[9].Width:=datasource1.DataSet.Fields[9].DisplayWidth+50;
dbgdshowfind.Columns[10].Field:=datasource1.DataSet.FieldByName('position');
dbgdshowfind.Columns[10].Width:=datasource1.DataSet.Fields[10].DisplayWidth+40;
dbgdshowfind.Columns[11].Field:=datasource1.DataSet.FieldByName('ygbm');
dbgdshowfind.Columns[11].Width:=datasource1.DataSet.Fields[11].DisplayWidth+50;
dbgdshowfind.Columns[12].Field:=datasource1.DataSet.FieldByName('rcrq');
dbgdshowfind.Columns[12].Width:=datasource1.DataSet.Fields[12].DisplayWidth+50;
dbgdshowfind.Columns[13].Field:=datasource1.DataSet.FieldByName('ygjy');
dbgdshowfind.Columns[13].Width:=datasource1.DataSet.Fields[13].DisplayWidth+40;
cmbsex.Text:='';
edmz.Text:='';
cmbhf.Text:='';
cmbeducation.Text:='';
cmbbm.Text:='';
cmbsortwork.Text:='';
edbirthday.Text:='';
checksex.Checked:=false;
checkmz.Checked:=false;
checkhf.Checked:=false;
checkeducation.Checked:=false;
checkbm.Checked:=false;
checksortwork.Checked:=false;
checkbirthday.Checked:=false;
//j:=0;
i:=0;
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -