📄 mainfile.pas
字号:
mmiSearch1Click(Sender);
readeridnoForm.PageControl1.ActivePageIndex:=0;
end;
procedure TMainForm.mmiSearch2Click(Sender: TObject);
begin
createChildForm(TbookidnameForm,bookidnameForm);
bookidnameForm.Caption:='〖按书号或书名方式查询〗';
end;
procedure TMainForm.mmiSearch3Click(Sender: TObject);
begin
createChildForm(TStatisticForm,StatisticForm);
StatisticForm.Caption:='〖汇总统计分析数据〗';
end;
procedure TMainForm.SBtnSearch3Click(Sender: TObject);
begin
mmiSearch2Click(Sender);
bookidnameForm.PageControl1.ActivePageIndex:=0;
end;
procedure TMainForm.mmiStoreupClick(Sender: TObject);
var
showpnl:boolean;
begin
if pnlBtnparent.ControlCount>1 then
begin
messagedlg('要备份数据库,请先关闭所有打开的功能模块!',mtWarning,[mbOk],0);
exit;
end;
showpnl:=pnlshow.Visible;
pnlshow.Visible:=false;
if not assigned(storeupForm) then
storeupForm:=TstoreupForm.Create(application);
try
storeupform.Width:=screen.Width*5 div 6;
storeupform.Height:=screen.Height*2 div 3;
storeupForm.Top:=(screen.Height-storeupform.Height) div 2;
storeupForm.Left:=(screen.Width-storeupform.Width) div 2;
if storeupForm.ShowModal=mrok then
pnlshow.Visible:=showpnl;
finally
storeupForm.Free;
storeupForm:=nil;
end;
end;
procedure TMainForm.mmiReport1Click(Sender: TObject);
begin
createChildForm(TbookrpForm,bookrpForm);
end;
procedure TMainForm.FormDeactivate(Sender: TObject);
begin
showlogin:=false;
end;
procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
inifile.WriteInteger('BOOK2001','ReaderCount',childfrm.readercount);
TimInstNum.Enabled:=false;
end;
procedure TMainForm.mmiReport2Click(Sender: TObject);
begin
createChildForm(TborrowqpForm,borrowqpForm);
end;
procedure TMainForm.mmiReport3Click(Sender: TObject);
begin
createChildForm(TpassqpForm,passqpForm);
end;
procedure TMainForm.mmiReport4Click(Sender: TObject);
begin
createChildForm(TreaderidQPForm,readeridQPForm);
end;
procedure TMainForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
TimInstNum.Enabled:=false;
try
if assigned(BooktypeForm) then BooktypeForm.Close;
if assigned(BookidForm) then BookidForm.Close;
if assigned(BookEditForm) then BookEditForm.Close;
if assigned(ReaderidForm) then ReaderidForm.Close;
if assigned(closeidForm) then closeidForm.Close;
if assigned(readerEditForm) then readerEditForm.Close;
if assigned(borrowForm) then BorrowForm.Close;
if assigned(RenewalForm) then RenewalForm.Close;
if assigned(ReturnForm) then ReturnForm.Close;
if assigned(BookcloseForm) then BookcloseForm.Close;
if assigned(readeridnoForm) then readeridnoForm.Close;
if assigned(bookidnameForm) then bookidnameForm.Close;
if assigned(bookrpForm) then bookrpForm.Close;
if assigned(borrowqpForm) then borrowqpForm.Close;
if assigned(passqpForm) then passqpForm.Close;
if assigned(readeridQPForm) then readeridQPForm.Close;
if assigned(RightForm) then RightForm.Close;
finally
CanClose:=true;
end;
//showmessage(inttostr(CompareTime(time,childfrm.backuptime)));
if (storeupfrm.isbackup=false)and(CompareTime(time,childfrm.backuptime)=1) then
begin
showmessage('今天没有备份,请备份!');
mmiStoreupClick(Sender);
CanClose:=false;
end;
end;
procedure TMainForm.PTBOOK(var msg: TMessage);
var
isformexist:boolean;
begin
isformexist:=false;
if msg.WParam=1 then
begin
if msg.LParam=3 then
begin
if assigned(readeridQPForm) then isformexist:=true;
createChildForm(TreaderidQPForm,readeridQPForm);
readeridQPform.BitBtn1.OnClick(self);
if isformexist=false then readeridQPform.Close;
end
else begin
if assigned(bookrpForm) then isformexist:=true;
createChildForm(TbookrpForm,bookrpForm);
if msg.LParam=1 then bookrpForm.BitBtn1.OnClick(self);
if msg.LParam=2 then bookrpform.BitBtn2.OnClick(self);
if msg.LParam=4 then bookrpform.BitBtn3.OnClick(self);
if isformexist=false then bookrpform.Close;
end;
end;
if msg.WParam=2 then
begin
if msg.LParam=3 then
begin
if assigned(readeridQPForm) then isformexist:=true;
createChildForm(TreaderidQPForm,readeridQPForm);
readeridQPform.BitBtn1.OnClick(self);
if isformexist=false then readeridQPform.Close;
end
else begin
if assigned(bookrpForm) then isformexist:=true;
createChildForm(TbookrpForm,bookrpForm);
if msg.LParam=1 then bookrpForm.QRbook.Print;
if msg.LParam=2 then bookrpform.BitBtn2.OnClick(self);
if msg.LParam=4 then bookrpform.QRPbook.Print;
if isformexist=false then bookrpform.Close;
end;
end;
end;
procedure TMainForm.PTBORROW(var msg: TMessage);
var
isformexist:boolean;
begin
isformexist:=false;
if msg.WParam=1 then
begin
if (msg.LParam=1)or(msg.LParam=2)or(msg.LParam=3) then
begin
if assigned(BorrowQPForm) then isformexist:=true;
createChildForm(TBorrowQPForm,BorrowQPForm);
if msg.LParam=1 then BorrowQPForm.BitBtn1.OnClick(self);
if msg.LParam=2 then BorrowQPForm.BitBtn2.OnClick(self);
if msg.LParam=3 then BorrowQPForm.BitBtn3.OnClick(self);
if isformexist=false then BorrowQPForm.Close;
end;
if (msg.LParam=4)or(msg.LParam=5)or(msg.LParam=6) then
begin
if assigned(passqpForm) then isformexist:=true;
createChildForm(TpassqpForm,passqpForm);
if msg.LParam=4 then passqpForm.BitBtn1.OnClick(self);
if msg.LParam=5 then passqpForm.BitBtn2.OnClick(self);
if msg.LParam=6 then passqpForm.BitBtn3.OnClick(self);
if isformexist=false then passqpForm.Close;
end;
end;
if msg.WParam=2 then
begin
if (msg.LParam=1)or(msg.LParam=2)or(msg.LParam=3) then
begin
if assigned(BorrowQPForm) then isformexist:=true;
createChildForm(TBorrowQPForm,BorrowQPForm);
if msg.LParam=1 then BorrowQPForm.QRborrowhistory.Print;
if msg.LParam=2 then BorrowQPForm.QRborrow.Print;
if msg.LParam=3 then BorrowQPForm.QRreturnhistory.Print;
if isformexist=false then BorrowQPForm.Close;
end;
if (msg.LParam=4)or(msg.LParam=5)or(msg.LParam=6) then
begin
if assigned(passqpForm) then isformexist:=true;
createChildForm(TpassqpForm,passqpForm);
if msg.LParam=4 then passqpForm.QRclosetime.Print;
if msg.LParam=5 then passqpForm.QRbooklose.Print;
if msg.LParam=6 then passqpForm.QRbookrepair.Print;
if isformexist=false then passqpForm.Close;
end;
end;
end;
procedure TMainForm.PTREADER(var msg: TMessage);
var
isformexist:boolean;
begin
isformexist:=false;
if assigned(readeridQPForm) then isformexist:=true;
createChildForm(TreaderidQPForm,readeridQPForm);
if msg.WParam=1 then
begin
if msg.LParam=1 then readeridQPForm.BitBtn3.OnClick(self);
if msg.LParam=2 then readeridQPForm.BitBtn2.OnClick(self);
if msg.LParam=3 then readeridQPForm.BitBtn4.OnClick(self);
end;
if msg.WParam=2 then
begin
if msg.LParam=1 then readeridQPForm.QRreader.Print;
if msg.LParam=2 then readeridQPForm.BitBtn2.OnClick(self);
if msg.LParam=3 then readeridQPForm.QRquitreader.Print;
end;
if isformexist=false then readeridQPform.Close;
end;
procedure TMainForm.PTBOOKTYPE(var msg: TMessage);
begin
booktypeqpForm:=TbooktypeqpForm.create(self);
dmbook.closeQryTypemaster;
dmbook.openQryTypemaster;
try
if msg.WParam=1 then booktypeqpForm.QRbooktype.preview;
if msg.WParam=2 then booktypeqpForm.QRbooktype.print;
finally
booktypeqpForm.Free;
booktypeqpForm:=nil;
end;
end;
procedure TMainForm.PTBOOKCOUNT(var msg: TMessage);
begin
if msg.WParam=1 then
begin
if msg.LParam=1 then ShowFindBigSmallRPForm(false,glbFindBigType,glbTypeCount);
if msg.LParam=2 then ShowFindTypeBookRPForm(false,glbFindBigType,glbTypeCount);
if msg.LParam=3 then ShowFindTypeBookRPForm(false,glbFindSmallType,glbTypeCount);
end;
if msg.WParam=2 then
begin
if msg.LParam=1 then ShowFindBigSmallRPForm(true,glbFindBigType,glbTypeCount);
if msg.LParam=2 then ShowFindBigSmallRPForm(true,glbFindBigType,glbTypeCount);
if msg.LParam=3 then ShowFindBigSmallRPForm(true,glbFindSmallType,glbTypeCount);
end;
end;
procedure TMainForm.PTBORROWCOUNT(var msg: TMessage);
begin
if msg.WParam=1 then
begin
if msg.LParam=1 then ShowmStatisticBorrowRPForm(false,'借出书总报表',glbStatisticDate);
if msg.LParam=2 then ShowmStatisticBorrowRPForm(false,'当天借出书报表',glbStatisticDate);
if msg.LParam=3 then ShowmStatisticReturnRPForm(false,'归还书总报表',glbStatisticDate);
if msg.LParam=4 then ShowmStatisticReturnRPForm(false,'当天归还书报表',glbStatisticDate);
if msg.LParam=5 then ShowmStatisticBorrowRPForm(false,'借出书报表',glbStatisticDate);
if msg.LParam=6 then ShowmStatisticReturnRPForm(false,'归还书报表',glbStatisticDate);
end;
if msg.WParam=2 then
begin
if msg.LParam=1 then ShowmStatisticBorrowRPForm(true,'借出书总报表',glbStatisticDate);
if msg.LParam=2 then ShowmStatisticBorrowRPForm(true,'借出书报表',glbStatisticDate);
if msg.LParam=3 then ShowmStatisticReturnRPForm(true,'归还书总报表',glbStatisticDate);
if msg.LParam=4 then ShowmStatisticReturnRPForm(true,'当天归还书报表',glbStatisticDate);
if msg.LParam=5 then ShowmStatisticBorrowRPForm(true,'借出书总报表',glbStatisticDate);
if msg.LParam=6 then ShowmStatisticReturnRPForm(true,'归还书报表',glbStatisticDate);
end;
end;
procedure TMainForm.MYLOGIN(var msg: TMessage);
begin
setPnlShowNotVisble;
startlogin;
end;
procedure TMainForm.FormDestroy(Sender: TObject);
begin
inifile.free;
end;
procedure TMainForm.SBtnDataClick(Sender: TObject);
var
showpnl:boolean;
begin
if pnlBtnparent.ControlCount>1 then
begin
messagedlg('要设定功能和数据库,请先关闭所有其它打开的功能模块!',mtWarning,[mbOk],0);
exit;
end;
showpnl:=pnlshow.Visible;
pnlshow.Visible:=false;
if not assigned(dataForm) then
dataForm:=TdataForm.Create(self);
try
postmessage(dataForm.Handle,INI_WRITE,application.MainForm.Handle,integer(inifile));
dataform.Width:=screen.Width*10 div 11;
dataform.Height:=screen.Height*4 div 5;
dataform.Top:=(screen.Height-dataform.Height) div 2;
dataform.Left:=(screen.Width-dataform.Width) div 2;
// dataform.Top:=60;
// dataform.Left:=30;
if dataform.ShowModal=mrOk then pnlshow.Visible:=showpnl;
finally
dataform.Free;
dataform:=nil;
end;
end;
procedure TMainForm.mmiBookeditClick(Sender: TObject);
begin
createChildForm(TBookEditForm,BookEditForm);
end;
procedure TMainForm.mmiReaderEditClick(Sender: TObject);
begin
createChildForm(TReaderEditForm,ReaderEditForm);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -