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

📄 untreadifo.pas

📁 资料室图书借阅管理系统
💻 PAS
字号:
unit untreadifo;

interface

uses
  Classes, SysUtils, IWAppForm, IWApplication, IWTypes, DB, ADODB,
  IWHTMLControls, IWCompLabel, IWGrids, IWDBGrids, Controls,
  IWVCLBaseControl, IWBaseControl, IWControl, IWCompButton, IWCompListbox,
  IWBaseHTMLControl;

type
  Tfrmreadifo = class(TIWAppForm)
    IWButton1: TIWButton;
    IWDBGrid1: TIWDBGrid;
    IWLabel1: TIWLabel;
    IWHRule1: TIWHRule;
    ADOQuery1: TADOQuery;
    DataSource1: TDataSource;
    IWListbox1: TIWListbox;
    procedure IWAppFormCreate(Sender: TObject);
    procedure IWButton1Click(Sender: TObject);
    //procedure IWButton2Click(Sender: TObject);
private
    procedure Move(AFormClass: TIWAppFormClass);

  end;

implementation
uses ServerController,untlog,untguest,untszglob,DateUtils, tempuntmain,U_guestMain;
{$R *.dfm}
procedure Tfrmreadifo.Move(AFormClass: TIWAppFormClass);
begin
  // Release the current form
  TIWAppForm(WebApplication.ActiveForm).Release;
  // tiwappform(webapplication.ActiveForm).Release;
  // Create the next form
  AFormClass.Create(WebApplication).Show;
end;

procedure Tfrmreadifo.IWAppFormCreate(Sender: TObject);
var
t,t1:string;
  tempadostr:string;
  tempadostr2,tempadostr3:string;
  expirebook:integer;
  expiredate:integer;

begin

t1:='借出';
t:=templogname;

adoquery1.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+strglob+';Persist Security Info=False';


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 JournalDetail INNER JOIN (book INNER JOIN borrowreturn ON book.BookID = borrowreturn.BookID) ON JournalDetail.ID = borrowreturn.journalid'+
              ' where borrowreturn.userId='+quotedstr(t)+'and booktype='+ quotedstr(t1)+' ORDER BY borrowreturn.borrowDate DESC');
adoquery1.Open;
adoquery1.First;

 while not adoquery1.Eof do
          begin
             tempadostr:=adoquery1.fieldbyname('borrowDate').AsString;
             expirebook:=DaysBetween(strtodatetime(tempadostr),Now);
             if expirebook>dqstr then
             begin
                expiredate:=expirebook-dqstr;
                tempadostr2:= adoquery1.fieldbyname('BookID').AsString;
                tempadostr3:= adoquery1.fieldbyname('journalid').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 if

             end   //end if
             else
 //if expirebook<dqstr then
 begin
  expiredate:=dqstr-expirebook;
  tempadostr2:= adoquery1.fieldbyname('BookID').AsString;
  tempadostr3:= adoquery1.fieldbyname('journalid').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;   //end while
 adoquery1.First;
 end ; //end ifelse


procedure Tfrmreadifo.IWButton1Click(Sender: TObject);
begin
 move(TIWForm_guest);
end;


initialization
  Tfrmreadifo.SetAsMainForm;

end.

⌨️ 快捷键说明

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