table2.Close;
table3.Close;
with Mainform do
begin
// StatusBar.Panels[1].Text:='仪器库已关闭';
if MDIChildCount=1 then
StatusBar.Panels[1].Text:='';
end;
Action := caFree;
end;
procedure Tfrm_YQ_Lab.PageControl1Change(Sender: TObject);
begin
case PageControl1.ActivePageIndex of
0:begin
DataSource1.DataSet:=Table1;
Table1.Open;
end;
1:begin
DataSource1.DataSet:=Query1;
// AllRec;
end;
end;
end;
procedure Tfrm_YQ_Lab.SpeedButton2Click(Sender: TObject);
begin
AllRec;
end;
procedure Tfrm_YQ_Lab.SpeedButton1Click(Sender: TObject);
var
SQLStr,SQLAll,Log:String;
SQLTemp:Pchar;
arrstr:array[1..7]of String;
i,l:integer;
function getsth(CurrEdit:TEdit):boolean;
begin
result:=false;
if CurrEdit.Text<>'' then
result:=true;
end;
begin
SQLAll:='';
SQLStr:='SELECT * FROM "仪器库.db" WHERE ';
if RadioGroup1.ItemIndex=1 then Log:='OR' else Log:='AND';
if Getsth(Edit_name) then
arrstr[1]:='(仪器名称='''+Edit_name.Text+''')';
arrstr[2]:=ComboBox1.text;
if arrstr[2]<>'' then
arrstr[2]:='(状况='''+arrstr[2]+''')';
if Getsth(Edit_No) then
arrstr[3]:='(型号='''+Edit_No.Text+''')';
if Getsth(Edit_date) then
arrstr[4]:='(启用日期='''+Edit_date.Text+''')';
if GetSth(Edit_address) then
arrstr[5]:='(放置位置='''+Edit_address.Text+''')';
if GetSth(Edit_experi) then
arrstr[6]:='(所属实验='''+Edit_experi.Text+''')';
arrstr[7]:='';
for i:=1 to 6 do
begin
arrstr[7]:=arrstr[7]+arrstr[i];
if arrstr[i]<>'' then
SQLAll:=SQLAll+Log+arrstr[i];
end;
if arrstr[7]='' then
begin
showmessage('没有查询项目?');
exit;
end;
l:=strlen(Pchar(SQLAll));
GetMem(SQLTemp,l);
SQLTemp^ := Chr(0);
if SQLAll[1]='O' then
StrCat(SQLTemp,Pchar(SQLAll)+2);
if SQLAll[1]='A' then
StrCat(SQLTemp,Pchar(SQLAll)+3);
SQLStr:=SQLStr+SQLTemp+' ORDER BY 仪器名称,型号,启用日期,状况,放置位置,所属实验';
FreeMem(SQLTemp);
// Application.MessageBox(Pchar(SQLStr),'预查询的SQL语句',MB_OK);
with Query1 do
begin
SQL.Clear;
SQL.Add(SQLStr);
Prepare;
ExecSQL;
Open;
end;
end;
procedure Tfrm_YQ_Lab.SpeedButton3Click(Sender: TObject);
begin
Application.CreateForm(Tfrm_prt_Lab, frm_prt_Lab);
Case RadioGroup2.ItemIndex of
0:beg
首页 上一页 2 3 4 5 6 7 8 下一页 尾页 5/13/13
delphi实验室仪器管理系统(五)由毕业论文网(www.huoyuandh.com)会员上传。