📄 find.pas
字号:
if i>=6 then
showmessage('查询条件不能超过6条');
checkeducation.Checked:=true;
cmbeducation.Clear;
btnok.SetFocus;
end;
end;
procedure Tfrmfind.cmbbmExit(Sender: TObject);
begin
if (cmbbm.Text<>'') and (i<6) then
begin
i:=i+1;
end
else
begin
if i>=6 then
showmessage('查询条件不能超过6条');
checkbm.Checked:=false;
cmbbm.Clear;
btnok.SetFocus;
end;
end;
procedure Tfrmfind.cmbsortworkExit(Sender: TObject);
begin
if (cmbsortwork.Text<>'') and (i<6) then
begin
i:=i+1;
end
else
begin
if i>=6 then
showmessage('查询条件不能超过6条');
checksortwork.Checked:=false;
cmbsortwork.Clear;
btnok.SetFocus;
end;
end;
procedure Tfrmfind.edbirthdayExit(Sender: TObject);
begin
if (edbirthday.Text<>'') and (i<6) then
begin
i:=i+1;
end
else
begin
if i>=6 then
showmessage('查询条件不能超过6条');
checkbirthday.Checked:=false;
edbirthday.Clear;
btnok.SetFocus;
end;
end;
procedure Tfrmfind.btnokClick(Sender: TObject);
var s1,s2:string;
//var j:integer;
begin
if i=1 then
begin //实现单一查询
if edid.Text<>'' then
begin
dmrsgl.ygjbzlqry.Close;
dmrsgl.ygjbzlqry.SQL.Clear;
dmrsgl.ygjbzlqry.SQL.Add('select * from employeer where number='+quotedstr(edid.Text));
dmrsgl.ygjbzlqry.Open;
if dmrsgl.ygjbzlqry.RecordCount=0 then
begin
showmessage('对不起!找不到'+trim(edid.Text)+'记录,请重新查询.');
i:=0;
checkid.Checked:=false;
edid.Text:='';
edid.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;
edid.Text:='';
edid.SetFocus;
checkid.Checked:=false;
end
else
begin
if edname.Text<>'' then
begin
dmrsgl.ygjbzlqry.Close;
dmrsgl.ygjbzlqry.SQL.Clear;
dmrsgl.ygjbzlqry.SQL.Add('select * from employeer where name='+quotedstr(edname.Text));
dmrsgl.ygjbzlqry.Open;
if dmrsgl.ygjbzlqry.RecordCount=0 then
begin
showmessage('对不起!找不到姓名是'+trim(edname.Text)+'记录,请重新查询.');
i:=0;
checkname.Checked:=false;
edname.Text:='';
edname.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;
edname.Text:='';
edname.SetFocus;
checkname.Checked:=false;
end
else
begin
if cmbsex.Text<>'' then
begin
dmrsgl.ygjbzlqry.Close;
dmrsgl.ygjbzlqry.SQL.Clear;
dmrsgl.ygjbzlqry.SQL.Add('select * from employeer where sex='+quotedstr(cmbsex.Text));
dmrsgl.ygjbzlqry.Open;
if dmrsgl.ygjbzlqry.RecordCount=0 then
begin
showmessage('对不起!找不到性别是'+trim(cmbsex.Text)+'记录,请重新查询.');
i:=0;
checksex.Checked:=false;
cmbsex.Text:='';
cmbsex.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;
cmbsex.Text:='';
cmbsex.SetFocus;
checksex.Checked:=false;
end
else
begin
if edmz.Text<>'' then
begin
dmrsgl.ygjbzlqry.Close;
dmrsgl.ygjbzlqry.SQL.Clear;
dmrsgl.ygjbzlqry.SQL.Add('select * from employeer where ygmz='+quotedstr(edmz.Text));
dmrsgl.ygjbzlqry.Open;
if dmrsgl.ygjbzlqry.RecordCount=0 then
begin
showmessage('对不起!找不到民族是'+trim(edmz.Text)+'记录,请重新查询.');
i:=0;
checkmz.Checked:=false;
edmz.Text:='';
edmz.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;
edmz.Text:='';
edmz.SetFocus;
checkmz.Checked:=false;
end
else
begin
if cmbhf.Text<>'' then
begin
dmrsgl.ygjbzlqry.Close;
dmrsgl.ygjbzlqry.SQL.Clear;
dmrsgl.ygjbzlqry.SQL.Add('select * from employeer where isjh='+quotedstr(cmbhf.Text));
dmrsgl.ygjbzlqry.Open;
if dmrsgl.ygjbzlqry.RecordCount=0 then
begin
showmessage('对不起!找不到'+trim(cmbhf.Text)+'记录,请重新查询.');
i:=0;
checkhf.Checked:=false;
cmbhf.Text:='';
cmbhf.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;
cmbhf.Text:='';
cmbhf.SetFocus;
checkhf.Checked:=false;
end
else
begin
if cmbeducation.Text<>'' then
begin
dmrsgl.ygjbzlqry.Close;
dmrsgl.ygjbzlqry.SQL.Clear;
dmrsgl.ygjbzlqry.SQL.Add('select * from employeer where education='+quotedstr(cmbeducation.Text));
dmrsgl.ygjbzlqry.Open;
if dmrsgl.ygjbzlqry.RecordCount=0 then
begin
showmessage('对不起!找不到学历是'+trim(cmbeducation.text)+'记录,请重新查询.');
i:=0;
checkeducation.Checked:=false;
cmbeducation.Text:='';
cmbeducation.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');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -