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

📄 untreturn.~pas

📁 资料室图书借阅管理系统
💻 ~PAS
📖 第 1 页 / 共 2 页
字号:
              else
              begin
                webapplication.ShowMessage('书号输入错误,请重新输入');
              end;
               adoquery1.Close;
               adoquery1.SQL.Clear;

             adoquery1.SQL.Add('SELECT   borrowreturn.BookID as 书号, book.Name as 书名, borrowreturn.journalid as 期刊号, '+
             ' JournalDetail.JournalBasicID as 期刊名, borrowreturn.userId as 用户编号, borrowreturn.username as 用户名称, '+
             ' borrowreturn.borrowDate as 借书日期, borrowreturn.MEmo as 备注'+
              ' FROM JournalDetail INNER JOIN (book INNER JOIN borrowreturn ON book.BookID = borrowreturn.BookID) ON JournalDetail.ID = borrowreturn.journalid '+
              ' where borrowreturn.username='+quotedstr(tempname)+' ORDER BY borrowreturn.borrowDate DESC');
          adoquery1.Open;

          iwdbgrid1.DataSource:=datasource1;

             end;     //end case 02
         end;      //end case
         end;  //end case 0




      1:begin


         { adoquery1.Close;
          adoquery1.SQL.Clear;
          adoquery1.SQL.Add('SELECT borrowreturn.BookID, book.Name, borrowreturn.journalid, JournalDetail.JournalBasicID, borrowreturn.userId, borrowreturn.username, borrowreturn.Booktype, borrowreturn.borrowDate, borrowreturn.MEmo '+
              'FROM book INNER JOIN (JournalDetail INNER JOIN borrowreturn ON JournalDetail.ID = borrowreturn.journalid) ON book.BookID = borrowreturn.BookID'+
              ' where borrowreturn.Booktype='+quotedstr('借出'));
          adoquery1.Open;  }
          if adoquery1.Active=false then
             adoquery1.Open;

         case tempint of
            1:begin
              if adoquery1.Locate('书号',trim(iwedit1.Text),[]) then

              begin
                str2:='在库';
               // str3:=datetimetostr(now);

                adoquery1.Close;

                adoquery1.SQL.Clear;
                adoquery1.SQL.Add('SELECT * FROM borrowreturn ');
                adoquery1.Open;

                adoquery1.Locate('BookID',trim(iwedit1.Text),[]);
                adoquery1.Edit;

                adoquery1.FieldByName('username').AsString:='资料室';
                adoquery1.FieldByName('userId').AsString:='00';
                adoquery1.FieldByName('Booktype').AsString:=str2;
                adoquery1.FieldByName('borrowDate').AsString:='';
                adoquery1.Post;
                adoquery1.Refresh;
                adoquery1.Close;
                   j:=j+1;

              end  //end if
              else
              begin
                webapplication.ShowMessage('书号输入错误,请重新输入');
               // adoquery1.EnableControls;
              end;
               adoquery1.Close;
               adoquery1.SQL.Clear;

              adoquery1.SQL.Add('SELECT   borrowreturn.BookID as 书号, book.Name as 书名, borrowreturn.journalid as 期刊号, JournalDetail.JournalBasicID as 期刊名,'+
              ' borrowreturn.userId as 用户编号, borrowreturn.username as 用户名称,  borrowreturn.borrowDate as 借书日期, borrowreturn.MEmo as 备注'+
              ' FROM JournalDetail INNER JOIN (book INNER JOIN borrowreturn ON book.BookID = borrowreturn.BookID) ON JournalDetail.ID = borrowreturn.journalid '+
              ' where borrowreturn.username='+quotedstr(tempname)+' ORDER BY borrowreturn.borrowDate DESC');
          adoquery1.Open;
         
          iwdbgrid1.DataSource:=datasource1;


          adoquery1.First;
          iwlistbox1.Items.Clear;
          while not adoquery1.Eof do
          begin
             tempadostr:=adoquery1.fieldbyname('借书日期').AsString;

             expirebook:=DaysBetween(strtodatetime(tempadostr),Now);
             if expirebook>dqstr then
             begin
                expiredate:=expirebook-dqstr;
                tempadostr2:= adoquery1.fieldbyname('书号').AsString;
                tempadostr3:= adoquery1.fieldbyname('期刊号').AsString;
                if trim(tempadostr2)='' then
                begin
                   // webapplication.ShowMessage(tempadostr2+inttostr(expiredate));
                     iwlistbox1.Items.Add(tempadostr3+'以超期'+inttostr(expiredate)+'天!');
                end
                else
                begin
                    iwlistbox1.Items.Add(tempadostr2+'以超期'+inttostr(expiredate)+'天!');
                    end;
                end
                 else
 //if expirebook<dqstr then
 begin
  expiredate:=dqstr-expirebook;
  tempadostr2:= adoquery1.fieldbyname('书号').AsString;
  tempadostr3:= adoquery1.fieldbyname('期刊号').AsString;
  if trim(tempadostr2)='' then
  begin
    iwlistbox1.Items.Add (tempadostr3+'还有'+inttostr(expiredate)+'天到期!借出时间');
    end
 else
 begin
 iwlistbox1.Items.Add(tempadostr2+'还有'+inttostr(expiredate)+'天到期!');
 end;
             end;
             adoquery1.Next;
          end;
          adoquery1.First;





             end;    //end case 01

           2:begin

           if adoquery1.Locate('期刊号',trim(iwedit1.Text),[]) then

              begin
                str2:='在库';
               // str3:=datetimetostr(now);

                adoquery1.Close;

                adoquery1.SQL.Clear;
                adoquery1.SQL.Add('SELECT * FROM borrowreturn ');
                adoquery1.Open;

                adoquery1.Locate('journalid',trim(iwedit1.Text),[]);
                adoquery1.Edit;

                adoquery1.FieldByName('username').AsString:='资料室';
                adoquery1.FieldByName('userId').AsString:='00';
                adoquery1.FieldByName('Booktype').AsString:=str2;
                adoquery1.FieldByName('borrowDate').AsString:='';
                adoquery1.Post;
                adoquery1.Refresh;
                adoquery1.Close;
                   j:=j+1;
              end  //end if
              else
              begin
                webapplication.ShowMessage('书号输入错误,请重新输入');
              end;
               adoquery1.Close;
               adoquery1.SQL.Clear;
               
              adoquery1.SQL.Add('SELECT   borrowreturn.BookID as 书号, book.Name as 书名, borrowreturn.journalid as 期刊号, '+
              ' JournalDetail.JournalBasicID as 期刊名, borrowreturn.userId as 用户编号, borrowreturn.username as 用户名称,  borrowreturn.borrowDate as 借书日期, borrowreturn.MEmo as 备注'+
              ' FROM JournalDetail INNER JOIN (book INNER JOIN borrowreturn ON book.BookID = borrowreturn.BookID) ON JournalDetail.ID = borrowreturn.journalid '+
              ' where borrowreturn.username='+quotedstr(tempname)+' ORDER BY borrowreturn.borrowDate DESC');
          adoquery1.Open;
         
          iwdbgrid1.DataSource:=datasource1;



           adoquery1.First;
           iwlistbox1.Items.Clear;
          while not adoquery1.Eof do
          begin
             tempadostr:=adoquery1.fieldbyname('借书日期').AsString;

             expirebook:=DaysBetween(strtodatetime(tempadostr),Now);
             if expirebook>dqstr then
             begin
                expiredate:=expirebook-dqstr;
                tempadostr2:= adoquery1.fieldbyname('书号').AsString;
                tempadostr3:= adoquery1.fieldbyname('期刊号').AsString;
                if trim(tempadostr2)='' then
                begin
                   // webapplication.ShowMessage(tempadostr2+inttostr(expiredate));
                     iwlistbox1.Items.Add(tempadostr3+'以超期'+inttostr(expiredate)+'天!');
                end
                else
                begin
                    iwlistbox1.Items.Add(tempadostr2+'以超期'+inttostr(expiredate)+'天!');
                    end;
                end
                 else
 //if expirebook<dqstr then
 begin
  expiredate:=dqstr-expirebook;
  tempadostr2:= adoquery1.fieldbyname('书号').AsString;
  tempadostr3:= adoquery1.fieldbyname('期刊号').AsString;
  if trim(tempadostr2)='' then
  begin
    iwlistbox1.Items.Add (tempadostr3+'还有'+inttostr(expiredate)+'天到期!');
    end
 else
 begin
 iwlistbox1.Items.Add(tempadostr2+'还有'+inttostr(expiredate)+'天到期!');
 end;
             end;
             adoquery1.Next;
          end;
          adoquery1.First;





             end;     //end case 02
         end;      //end case
        end;  //end case 1

    2:begin  

         { adoquery1.Close;
          adoquery1.SQL.Clear;
          adoquery1.SQL.Add('SELECT borrowreturn.BookID, book.Name, borrowreturn.journalid, JournalDetail.JournalBasicID, borrowreturn.userId, borrowreturn.username, borrowreturn.Booktype, borrowreturn.borrowDate, borrowreturn.MEmo '+
              'FROM book INNER JOIN (JournalDetail INNER JOIN borrowreturn ON JournalDetail.ID = borrowreturn.journalid) ON book.BookID = borrowreturn.BookID'+
              ' where borrowreturn.Booktype='+quotedstr('借出'));
          adoquery1.Open; }
           if adoquery1.Active=false then
             adoquery1.Open;


         case tempint of
            1:begin
              if adoquery1.Locate('书号',trim(iwedit1.Text),[]) then

              begin
                str2:='挂失';
               // str3:=datetimetostr(now);

                adoquery1.Close;

                adoquery1.SQL.Clear;
                adoquery1.SQL.Add('SELECT * FROM borrowreturn ');
                adoquery1.Open;

                adoquery1.Locate('BookID',trim(iwedit1.Text),[]);
                adoquery1.Edit;

                adoquery1.FieldByName('username').AsString:='资料室';
                adoquery1.FieldByName('userId').AsString:='00';
                adoquery1.FieldByName('Booktype').AsString:=str2;
                adoquery1.FieldByName('borrowDate').AsString:='';
                adoquery1.Post;
                adoquery1.Refresh;
                adoquery1.Close;
                   q:=q+1;
                   iwlistbox1.Items.Add(trim(iwedit1.Text)+'已被'+tempuser+'用户挂失!') ;
              end  //end if
              else
              begin
                webapplication.ShowMessage('书号输入错误,请重新输入');
               // adoquery1.EnableControls;
              end;
               adoquery1.Close;
               adoquery1.SQL.Clear;

               adoquery1.SQL.Add('SELECT   borrowreturn.BookID as 书号, book.Name as 书名, borrowreturn.journalid as 期刊号, '+
               ' JournalDetail.JournalBasicID as 期刊名, borrowreturn.userId as 用户编号, borrowreturn.username as 用户名称,  borrowreturn.borrowDate as 借书日期, borrowreturn.MEmo as 备注'+
              ' FROM JournalDetail INNER JOIN (book INNER JOIN borrowreturn ON book.书号 = borrowreturn.BookID) ON JournalDetail.ID = borrowreturn.journalid '+
              ' where borrowreturn.username='+quotedstr(tempname)+' ORDER BY borrowreturn.borrowDate DESC');
          adoquery1.Open;
         
          iwdbgrid1.DataSource:=datasource1;

             end;    //end case 01

           2:begin

             if adoquery1.Locate('期刊号',trim(iwedit1.Text),[]) then

              begin
                str2:='挂失';
               // str3:=datetimetostr(now);

                adoquery1.Close;

                adoquery1.SQL.Clear;
                adoquery1.SQL.Add('SELECT * FROM borrowreturn ');
                adoquery1.Open;

                adoquery1.Locate('journalid ',trim(iwedit1.Text),[]);
                adoquery1.Edit;

                adoquery1.FieldByName('username').AsString:='资料室';
                adoquery1.FieldByName('userId').AsString:='00';
                adoquery1.FieldByName('Booktype').AsString:=str2;
                adoquery1.FieldByName('borrowDate').AsString:='';
                adoquery1.Post;
                adoquery1.Refresh;
                adoquery1.Close;
                   q:=q+1;
                   iwlistbox1.Items.Add(trim(iwedit1.Text)+'已被'+tempuser+'用户挂失!') ;
              end  //end if
              else
              begin
                webapplication.ShowMessage('书号输入错误,请重新输入');
              end;
               adoquery1.Close;
               adoquery1.SQL.Clear;
               
                 adoquery1.SQL.Add('SELECT   borrowreturn.BookID as 书号, book.Name as 书名, borrowreturn.journalid as 期刊号, '+
               ' JournalDetail.JournalBasicID as 期刊名, borrowreturn.userId as 用户编号, borrowreturn.username as 用户名称,  borrowreturn.borrowDate as 借书日期, borrowreturn.MEmo as 备注'+
              ' FROM JournalDetail INNER JOIN (book INNER JOIN borrowreturn ON book.BookID = borrowreturn.BookID) ON JournalDetail.ID = borrowreturn.journalid '+
              ' where borrowreturn.username='+quotedstr(tempname)+' ORDER BY borrowreturn.borrowDate DESC');
          adoquery1.Open;
         
          iwdbgrid1.DataSource:=datasource1;

             end;     //end case 02
         end;      //end case
    end;  //end 2
    end; //end  global case
 end;  //end ifelse
 end;


procedure Tfrmreturn.IWDBGrid1RenderCell(ACell: TIWGridCell; const ARow,
  AColumn: Integer);
begin
  if ARow = -1 then
  begin
    ACell.BGColor := clSilver;
    if AColumn = 0 then begin
      ACell.Font.Color :=clblue;
      m:=k+h-j;
      ACell.Text := tempname+'已借'+IntToStr(m) + '本书籍。';
    end;
  end
  else if iwdbgrid1.RowIsCurrent then begin
    ACell.BGColor := clYellow;
  end;
end;

procedure Tfrmreturn.IWAppFormCreate(Sender: TObject);
begin
adoquery1.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+strglob+';Persist Security Info=False';
adoquery2.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+strglob+';Persist Security Info=False';
adoquery3.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+strglob+';Persist Security Info=False';

end;

end.


⌨️ 快捷键说明

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