⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 randomsystem.pas

📁 一个不错的信息管理系统
💻 PAS
📖 第 1 页 / 共 2 页
字号:
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text ='')and(combobox1.Text<>'') and (combobox2.Text='') and (combobox5.Text<>'') and (combobox4.text<>'') and (combobox6.Text<>'' ) and (combobox3.Text<>'')and(combobox7.Text<>'') then
 begin                            //性别、年龄、学历和人事单位名称
adoquery1.Active:=false;
adoquery1.sql.Clear;
s:='select * from a01,a08 where 性别='''+trim(combobox3.text)+''''+' and '+' 年龄 between '+combobox4.Text+' and '+combobox5.Text+' and '+' a08.学历代码 between '+inttostr(combobox6.ItemIndex)+' and '+inttostr(combobox7.ItemIndex)+' and '+'人事单位名称='''+trim(combobox1.Text)+''''+' and '+' a01.标识号=a08.标识号';
adoquery1.sql.Add(s);
adoquery1.Active :=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text ='')and(combobox1.Text<>'') and (combobox2.Text<>'') and (combobox5.Text<>'') and (combobox4.text<>'') and (combobox6.Text<>'' ) and (combobox3.Text<>'')and(combobox7.Text<>'') then
begin                //性别、年龄、学历、人事单位名称和专家名称
adoquery1.Active:=false;
adoquery1.sql.Clear;
s:='select * from a01,a08,a24 where 性别='''+trim(combobox3.text)+''''+' and '+' 年龄 between '+combobox4.Text+' and '+combobox5.Text+' and '+' a08.学历代码 between '+inttostr(combobox6.ItemIndex)+' and '+inttostr(combobox7.ItemIndex)+' and '+'人事单位名称='''+trim(combobox1.Text)+''''+' and '+'专家名称='''+trim(combobox2.Text)+''''+' and '+' a01.标识号=a24.标识号 '+' and '+' a01.标识号=a08.标识号';
adoquery1.sql.Add(s);
adoquery1.Active :=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text ='')and(combobox1.Text='') and (combobox2.Text<>'') and (combobox5.Text<>'') and (combobox4.text<>'') and (combobox6.Text<>'' ) and (combobox3.Text<>'')and(combobox7.Text<>'') then
begin                //性别、年龄、学历和专家名称
adoquery1.Active:=false;
adoquery1.sql.Clear;
s:='select * from a01,a08,a24 where 性别='''+trim(combobox3.text)+''''+' and '+' 年龄 between '+trim(combobox4.Text)+' and '+trim(combobox5.Text)+' and '+' a08.学历代码 between '+inttostr(combobox6.ItemIndex)+' and '+inttostr(combobox7.ItemIndex)+' and '+' 专家名称='''+trim(combobox2.Text)+''''+' and '+' a01.标识号=a24.标识号 '+' and '+' a01.标识号=a08.标识号';
adoquery1.sql.Add(s);
adoquery1.Active :=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text ='')and(combobox1.Text<>'') and (combobox2.Text='') and (combobox5.Text='') and (combobox4.text='') and (combobox6.Text<>'' ) and (combobox3.Text<>'')and(combobox7.Text<>'') then
begin                     //性别、学历和人事单位名称
adoquery1.Active:=false;
adoquery1.sql.Clear;
s:='select * from a01,a08 where 性别='''+trim(combobox3.text)+''''+' and '+' a08.学历代码 between '+inttostr(combobox6.ItemIndex)+' and '+inttostr(combobox7.ItemIndex)+' and '+' 人事单位名称='''+trim(combobox1.Text)+''''+' and '+' a01.标识号=a08.标识号 ';
adoquery1.sql.Add(s);
adoquery1.Active :=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text ='')and(combobox1.Text<>'') and (combobox2.Text<>'') and (combobox5.Text='') and (combobox4.text='') and (combobox6.Text<>'' ) and (combobox3.Text<>'')and(combobox7.Text<>'') then
begin                //性别、学历、人事单位名称和专家名称
adoquery1.Active:=false;
adoquery1.sql.Clear;
s:='select * from a01,a08,a24 where 性别='''+trim(combobox3.text)+''''+' and '+' a08.学历代码 between '+inttostr(combobox6.ItemIndex)+' and '+inttostr(combobox7.ItemIndex)+' and '+'人事单位名称='''+trim(combobox1.Text)+''''+' and '+'专家名称='''+trim(combobox2.Text)+''''+' and '+' a01.标识号=a08.标识号';
adoquery1.sql.Add(s);
adoquery1.Active :=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text='') and (combobox1.Text='') and (combobox2.Text='') and (combobox5.Text='') and (combobox4.text='') and (combobox6.Text<>'' ) and (combobox3.Text<>'')and(combobox7.Text<>'') then
begin                              //学历和性别
adoquery1.Active :=false;
adoquery1.SQL.Clear;
s:='select * from a01,a08 where 性别='''+trim(combobox3.Text)+''''+' and a08.学历代码 between '+inttostr(combobox6.itemindex)+' and '+inttostr(combobox7.ItemIndex)+' and '+' a01.标识号=a08.标识号 ';
adoquery1.SQL.Add(s);
adoquery1.Active:=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text ='')and(combobox1.Text='') and (combobox2.Text<>'') and (combobox5.Text<>'') and (combobox4.text<>'') and (combobox6.Text<>'' ) and (combobox3.Text='')and(combobox7.Text<>'') then
 begin                                    //年龄和学历和专家名称
adoquery1.Active:=false;
adoquery1.sql.Clear;
s:='select * from a01,a08,a24 where 专家名称='''+trim(combobox2.text)+''''+' and '+' 年龄 between '+combobox4.Text+' and '+combobox5.Text+' and '+' a08.学历代码 between '+inttostr(combobox6.ItemIndex)+' and '+inttostr(combobox7.ItemIndex)+' and '+' a01.标识号=a08.标识号'+' and '+'a01.标识号=a24.标识号';
adoquery1.sql.Add(s);
adoquery1.Active :=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text ='')and(combobox1.Text='') and (combobox2.Text<>'') and (combobox5.Text<>'') and (combobox4.text<>'') and (combobox6.Text='' ) and (combobox3.Text='')and(combobox7.Text='') then
 begin                                   //年龄和专家名称
adoquery1.Active:=false;
adoquery1.sql.Clear;
s:='select * from a01,a24 where 专家名称='''+trim(combobox2.text)+''''+' and '+' 年龄 between '+combobox4.Text+' and '+combobox5.Text+' and '+' a01.标识号=a24.标识号';
adoquery1.sql.Add(s);
adoquery1.Active :=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text ='')and(combobox1.Text<>'') and (combobox2.Text<>'') and (combobox5.Text='') and (combobox4.text='') and (combobox6.Text<>'' ) and (combobox3.Text='')and(combobox7.Text<>'') then
 begin                            //人事单位名称和学历和专家名称
adoquery1.Active:=false;
adoquery1.sql.Clear;
s:='select * from a01,a08,a24 where 专家名称='''+trim(combobox2.text)+''''+' and '+' 人事单位名称='''+trim(combobox1.Text)+''''+' and '+' a08.学历代码 between '+inttostr(combobox6.ItemIndex)+' and '+inttostr(combobox7.ItemIndex)+' and '+' a01.标识号=a08.标识号';
adoquery1.sql.Add(s);
adoquery1.Active :=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text='') and (combobox1.Text<>'') and (combobox2.Text='') and (combobox5.Text='') and (combobox4.text='') and (combobox6.Text<>'' ) and (combobox3.Text='')and(combobox7.Text<>'') then
begin                              //人事单位名称和学历
adoquery1.Active :=false;
adoquery1.sql.Clear;
s:='select * from a01,a08 where 人事单位名称='''+trim(combobox1.Text)+''''+' and '+' 学历代码 between '+inttostr(combobox6.itemindex)+' and '+inttostr(combobox7.itemindex)+' and '+' a01.标识号 = a08.标识号';
adoquery1.SQL.Add(s);
adoquery1.Active :=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text='') and (combobox1.Text='') and (combobox2.Text<>'') and (combobox5.Text='') and (combobox4.text='') and (combobox6.Text<>'' ) and (combobox3.Text='')and(combobox7.Text<>'') then
begin                              //专家名称和学历
adoquery1.Active :=false;
adoquery1.sql.Clear;
s:='select * from a01,a08,a24 where a24.专家名称='''+trim(combobox2.Text)+''''+' and '+' a08.学历代码 between '+inttostr(combobox6.itemindex)+' and '+inttostr(combobox7.itemindex)+' and '+' a08.标识号 = a24.标识号'+' and '+' a01.标识号=a08.标识号 ';
adoquery1.SQL.Add(s);
adoquery1.Active :=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text='') and (combobox1.Text<>'') and (combobox2.Text='') and (combobox5.Text='') and (combobox4.text='') and (combobox6.Text='' ) and (combobox3.Text<>'')and(combobox7.Text='') then
begin                              //人事单位名称和性别
adoquery1.Active :=false;
adoquery1.sql.Clear;
s:='select * from a01 where 人事单位名称='''+trim(combobox1.Text)+''''+' and '+' 性别='''+trim(combobox3.Text)+'''';
adoquery1.SQL.Add(s);
adoquery1.Active :=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else if (edit1.Text='') and (combobox1.Text<>'') and (combobox2.Text<>'') and (combobox5.Text='') and (combobox4.text='') and (combobox6.Text='' ) and (combobox3.Text='')and(combobox7.Text='') then
begin                              //人事单位名称和专家名称
adoquery1.Active :=false;
adoquery1.sql.Clear;
s:='select * from a01,a24 where a01.人事单位名称='''+trim(combobox1.Text)+''''+' and '+' a24.专家名称='''+trim(combobox2.Text)+''''+' and '+' a01.标识号=a24.标识号';
adoquery1.SQL.Add(s);
adoquery1.Active :=true;
if adoquery1.RecordCount<>0 then
begin
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
end
else
begin
beep();
application.MessageBox('没有您想要的记录!','提示',32);
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
adoquery1.Active :=false;
end;
end
else
application.MessageBox('没有找到符合条件的记录!','提示',32);
end;
end;
end;
 end;
   end;

procedure TForm9.Button11Click(Sender: TObject);
begin                     //清空条件
combobox1.Text :='';
combobox2.Text :='';
combobox3.Text :='';
combobox4.Text :='';
combobox5.Text :='';
combobox6.Text :='';
combobox7.Text :='';
edit1.Text :='';
adoquery1.SQL.Text:='';
adoquery1.Active:=false;
button1.Enabled :=false;
button2.Enabled :=false;
button3.Enabled :=false;
button4.Enabled :=false;
button6.Enabled :=false;
button7.Enabled :=false;
button8.Enabled :=false;
button10.Enabled :=false;
button12.Enabled :=false;
combobox4.SetFocus;
end;

procedure TForm9.Button10Click(Sender: TObject);
begin                //提交
adoquery1.Post ;
dbgrid1.ReadOnly:=true;
button10.Enabled :=false;
button12.Enabled :=false;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
end;

procedure TForm9.FormShow(Sender: TObject);
begin                //窗体显示时初始化
combobox1.Text :='';
combobox2.Text :='';
combobox3.Text :='';
combobox4.Text :='';
combobox5.Text :='';
combobox6.Text :='';
combobox7.Text :='';
edit1.Text :='';
combobox4.SetFocus;
end;
procedure TForm9.Button12Click(Sender: TObject);
begin               //取消
adoquery1.Cancel;
dbgrid1.ReadOnly:=true;
if adoquery1.RecordCount<>0 then
begin
button10.Enabled :=false;
button12.Enabled :=false;
button6.Enabled :=true;
button7.Enabled :=true;
button8.Enabled :=true;
button1.Enabled :=true;
button2.Enabled :=true;
button3.Enabled :=true;
button4.Enabled :=true;
end;
end;



procedure TForm9.FormActivate(Sender: TObject);
begin            //让第一条获得焦点
combobox4.SetFocus;
end;

procedure TForm9.FormClose(Sender: TObject; var Action: TCloseAction);
begin
button5.Click;
end;

end.


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -