计算机应用 | 古代文学 | 市场营销 | 生命科学 | 交通物流 | 财务管理 | 历史学 | 毕业 | 哲学 | 政治 | 财税 | 经济 | 金融 | 审计 | 法学 | 护理学 | 国际经济与贸易
计算机软件 | 新闻传播 | 电子商务 | 土木工程 | 临床医学 | 旅游管理 | 建筑学 | 文学 | 化学 | 数学 | 物理 | 地理 | 理工 | 生命 | 文化 | 企业管理 | 电子信息工程
计算机网络 | 语言文学 | 信息安全 | 工程力学 | 工商管理 | 经济管理 | 计算机 | 机电 | 材料 | 医学 | 药学 | 会计 | 硕士 | 法律 | MBA
现当代文学 | 英美文学 | 通讯工程 | 网络工程 | 行政管理 | 公共管理 | 自动化 | 艺术 | 音乐 | 舞蹈 | 美术 | 本科 | 教育 | 英语 |

delphi实验室仪器管理系统(一)毕业论文(5)

2013-06-04 01:56
导读:; table1.Close; table2.Close; table3.Close; with Mainform do begin // StatusBar.Panels[1].Text:='仪器库已关闭'; if MDIChildCount=1 then StatusBar.Panels[1].Text:=''; end; Action := caFree; end;
; table1.Close;
  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

(转载自http://zw.nseac.coM科教作文网)


    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

上一篇:delphi+access网络考试系统[开题报告+论文+源代码 下一篇:没有了