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

📄 statisticfrm.pas

📁 基于Interbase的图书管理系统
💻 PAS
📖 第 1 页 / 共 2 页
字号:
    prtBookCount.RB3.Checked:=true;
    prtBookCount.RB2.Enabled:=false;
    prtBookCount.RB3.Enabled:=true;
    prtBookCount.ShowModal;
  finally
    prtBookCount.Free;
    prtBookCount:=nil;
  end;
end;

procedure TStatisticForm.bbtnReaderPrintClick(Sender: TObject);
begin
  inherited;
  bbtnReader.Click;
   //列印的代码
  if not assigned(prtreaderidForm) then
  prtreaderidForm:=TprtreaderidForm.Create(Application);
  try
    prtreaderidForm.RB1.Checked:=True;
    prtreaderidForm.RB2.Visible:=false;
    prtreaderidForm.ShowModal;
  finally
    prtreaderidForm.Free;
    prtreaderidForm:=nil;
  end;
end;

procedure TStatisticForm.bbtnReaderQuitPrintClick(Sender: TObject);
begin
  inherited;
  bbtnReaderQuit.Click;
    //列印的代码
  if not assigned(prtreaderidForm) then
  prtreaderidForm:=TprtreaderidForm.Create(Application);
  try
    prtreaderidForm.RB3.Checked:=True;
    prtreaderidForm.RB1.Visible:=false;
    prtreaderidForm.RB2.Visible:=false;
    prtreaderidForm.RB3.Visible:=True;
    prtreaderidForm.ShowModal;
  finally
    prtreaderidForm.Free;
    prtreaderidForm:=nil;
  end;
end;

procedure TStatisticForm.setDBGridFiledCaption(Atype: string);
begin
  if Atype='BIG' then
    begin
      dbgCount.Columns.Items[0].Title.caption:='大类';
      dbgCount.Columns.Items[1].Title.caption:='大类名称';
    end;
  if Atype='BIGSMALL' then
    begin
      dbgCount.Columns.Items[0].Title.caption:='小类编号';
      dbgCount.Columns.Items[1].Title.caption:='小类名称';
      dbgCount.Columns.Items[2].Title.caption:='所属大类';
    end;
  if (Atype='BIGBOOK')or(Atype='BIGSMALLBOOK') then
    begin
      dbgCount.Columns.Items[0].Title.caption:='书号';
      dbgCount.Columns.Items[1].Title.caption:='书名';
      dbgCount.Columns.Items[2].Title.caption:='出版社';
      dbgCount.Columns.Items[3].Title.caption:='出版日期';
      dbgCount.Columns.Items[4].Title.caption:='库存数量';
      dbgCount.Columns.Items[5].Title.caption:='书价';
      dbgCount.Columns.Items[6].Title.caption:='入库日期';
   end;
  if (Atype='READERDATA')or(Atype='READERQUITDATA') then
    begin
      dbgCount.Columns.Items[0].Title.caption:='借书证号';
      dbgCount.Columns.Items[1].Title.caption:='工 号';
      dbgCount.Columns.Items[2].Title.caption:='姓 名';
      dbgCount.Columns.Items[3].Title.caption:='部 门';
      dbgCount.Columns.Items[4].Title.caption:='办证日期';
      if Atype='READERQUITDATA' then
      dbgCount.Columns.Items[5].Title.caption:='退证日期';
    end;
   if (Atype='BORROWBOOK')or(Atype='CURBORROWBOOK') then
     begin
      dbgCount.Columns.Items[0].Title.caption:='书 号';
      dbgCount.Columns.Items[1].Title.caption:='书 名';
      dbgCount.Columns.Items[2].Title.caption:='借书日期';
      dbgCount.Columns.Items[3].Title.caption:='借 期';
     end;
   if (Atype='RETURNBOOK')or(Atype='CURRETURNBOOK') then
     begin
       dbgCount.Columns.Items[0].Title.caption:='书 号';
       dbgCount.Columns.Items[1].Title.caption:='书 名';
       dbgCount.Columns.Items[2].Title.caption:='还书日期';
     end;
end;

procedure TStatisticForm.bbtnBorrowCountClick(Sender: TObject);
begin
  inherited;
  dbgCount.DataSource:=nil;
  dmBook.CountBorrowDataFromWhere('BORROWCOUNT',now());
  lbBorrowCount.Caption:=DMbook.QryStatisticBorrow.FieldByName('borrowcount').AsString;
end;

procedure TStatisticForm.bbtnCurBorrowCountClick(Sender: TObject);
begin
  inherited;
  dbgCount.DataSource:=nil;
  dmBook.CountBorrowDataFromWhere('CURBORROWCOUNT',now());
  lbcurBorrowCount.Caption:=DMbook.QryStatisticBorrow.FieldByName('curborrowcount').AsString;
end;

procedure TStatisticForm.bbtnCurRetureCountClick(Sender: TObject);
begin
  inherited;
  dbgCount.DataSource:=nil;
  dmBook.CountBorrowDataFromWhere('CURRETURNCOUNT',now());
  lbCurReturnCount.Caption:=DMbook.QryStatisticBorrow.FieldByName('curreturncount').AsString;
end;

procedure TStatisticForm.bbtnBorrowBookClick(Sender: TObject);
begin
  inherited;
  dbgCount.DataSource:=nil;
  DMbook.CountBorrowDataFromWhere('BORROWBOOK',now());
  dbgCount.DataSource:=DMbook.dsStatisticBorrow;
  setDBGridFiledCaption('BORROWBOOK');
end;

procedure TStatisticForm.bbtnBorrowBookPrintClick(Sender: TObject);
begin
  inherited;
  bbtnBorrowBook.Click;
  glbStatisticDate:='';
  if not assigned(prtBorrowCount) then
     prtBorrowCount:=TprtBorrowCount.Create(Application);
  try
    prtBorrowCount.RB1.Enabled:=true;
    prtBorrowCount.RB1.Checked:=true;
    prtBorrowCount.RB2.Enabled:=false;
    prtBorrowCount.RB3.Enabled:=false;
    prtBorrowCount.RB4.Enabled:=false;
    prtBorrowCount.RB5.Enabled:=false;
    prtBorrowCount.RB6.Enabled:=false;
    prtBorrowCount.ShowModal;
  finally
    prtBorrowCount.Free;
    prtBorrowCount:=nil;
  end;
end;

procedure TStatisticForm.bbtnCurBorrowBookClick(Sender: TObject);
begin
  inherited;
  dbgCount.DataSource:=nil;
  DMbook.CountBorrowDataFromWhere('CURBORROWBOOK',now());
  dbgCount.DataSource:=DMbook.dsStatisticBorrow;
  setDBGridFiledCaption('CURBORROWBOOK');
end;

procedure TStatisticForm.bbtnCurBorrowBookPrintClick(Sender: TObject);
begin
  inherited;
  bbtnCurBorrowBook.Click;
  glbStatisticDate:='日期为'+Datetostr(now)+'时';
  if not assigned(prtBorrowCount) then
     prtBorrowCount:=TprtBorrowCount.Create(Application);
  try
    prtBorrowCount.RB1.Enabled:=false;
    prtBorrowCount.RB2.Checked:=true;
    prtBorrowCount.RB2.Enabled:=true;
    prtBorrowCount.RB3.Enabled:=false;
    prtBorrowCount.RB4.Enabled:=false;
    prtBorrowCount.RB5.Enabled:=false;
    prtBorrowCount.RB6.Enabled:=false;
    prtBorrowCount.ShowModal;
  finally
    prtBorrowCount.Free;
    prtBorrowCount:=nil;
  end;
end;

procedure TStatisticForm.bbtnRetureBookClick(Sender: TObject);
begin
  inherited;
  dbgCount.DataSource:=nil;
  DMbook.CountBorrowDataFromWhere('RETURNBOOK',now());
  dbgCount.DataSource:=DMbook.dsStatisticBorrow;
  setDBGridFiledCaption('RETURNBOOK');
end;

procedure TStatisticForm.bbtnRetureBookPrintClick(Sender: TObject);
begin
  inherited;
  bbtnRetureBook.Click;
  glbStatisticDate:='';
  if not assigned(prtBorrowCount) then
     prtBorrowCount:=TprtBorrowCount.Create(Application);
  try
    prtBorrowCount.RB1.Enabled:=false;
    prtBorrowCount.RB3.Checked:=true;
    prtBorrowCount.RB2.Enabled:=false;
    prtBorrowCount.RB3.Enabled:=true;
    prtBorrowCount.RB4.Enabled:=false;
    prtBorrowCount.RB5.Enabled:=false;
    prtBorrowCount.RB6.Enabled:=false;
    prtBorrowCount.ShowModal;
  finally
    prtBorrowCount.Free;
    prtBorrowCount:=nil;
  end;
end;

procedure TStatisticForm.bbtnCurRetureBookClick(Sender: TObject);
begin
  inherited;
  dbgCount.DataSource:=nil;
  DMbook.CountBorrowDataFromWhere('CURRETURNBOOK',now());
  dbgCount.DataSource:=DMbook.dsStatisticBorrow;
  setDBGridFiledCaption('CURRETURNBOOK');
end;

procedure TStatisticForm.bbtnCurRetureBookPrintClick(Sender: TObject);
begin
  inherited;
  bbtnCurRetureBook.Click;
  glbStatisticDate:='日期为'+Datetostr(now)+'时';
  if not assigned(prtBorrowCount) then
     prtBorrowCount:=TprtBorrowCount.Create(Application);
  try
    prtBorrowCount.RB1.Enabled:=false;
    prtBorrowCount.RB4.Checked:=true;
    prtBorrowCount.RB2.Enabled:=false;
    prtBorrowCount.RB3.Enabled:=false;
    prtBorrowCount.RB4.Enabled:=true;
    prtBorrowCount.RB5.Enabled:=false;
    prtBorrowCount.RB6.Enabled:=false;
    prtBorrowCount.ShowModal;
  finally
    prtBorrowCount.Free;
    prtBorrowCount:=nil;
  end;
end;

procedure TStatisticForm.bbtnEachBorrowbookClick(Sender: TObject);
var
  tmpWhere:string;
begin
  inherited;
  dbgCount.DataSource:=nil;
  FindDataWhereDate('查询借出书','借书日期',tmpWhere,glbStatisticDate);
  if tmpWhere<>'' then
    begin
      bbtnEachBorrowBookPrint.Tag:=0;
      DMbook.CounteachBorrowDataFromWhere('BORROWBOOK',tmpWhere);
      dbgCount.DataSource:=DMbook.dsStatisticBorrow;
      setDBGridFiledCaption('BORROWBOOK');
    end
  else
    bbtnEachBorrowBookPrint.Tag:=1;
end;

procedure TStatisticForm.bbtnEachBorrowbookPrintClick(Sender: TObject);
begin
  inherited;
  bbtnEachBorrowbook.Click;
  if bbtnEachBorrowBookPrint.Tag=1 then exit;
  if not assigned(prtBorrowCount) then
     prtBorrowCount:=TprtBorrowCount.Create(Application);
  try
    prtBorrowCount.RB1.Enabled:=false;
    prtBorrowCount.RB5.Checked:=true;
    prtBorrowCount.RB2.Enabled:=false;
    prtBorrowCount.RB3.Enabled:=false;
    prtBorrowCount.RB4.Enabled:=false;
    prtBorrowCount.RB5.Enabled:=true;
    prtBorrowCount.RB6.Enabled:=false;
    prtBorrowCount.ShowModal;
  finally
    prtBorrowCount.Free;
    prtBorrowCount:=nil;
  end;
end;

procedure TStatisticForm.bbtnEachReturnBookClick(Sender: TObject);
var
  tmpWhere:string;
begin
  inherited;
  dbgCount.DataSource:=nil;
  FindDataWhereDate('查询归还书','还书日期',tmpWhere,glbStatisticDate);
  if tmpWhere<>'' then
  begin
    bbtnEachReturnBookPrint.Tag:=0;
    DMbook.CounteachBorrowDataFromWhere('RETURNBOOK',tmpWhere);
    dbgCount.DataSource:=DMbook.dsStatisticBorrow;
    setDBGridFiledCaption('RETURNBOOK');
  end
  else
    bbtnEachReturnBookPrint.Tag:=1;
end;

procedure TStatisticForm.bbtnEachReturnBookPrintClick(Sender: TObject);
begin
  inherited;
  bbtnEachReturnBook.Click;
  if bbtnEachReturnBookPrint.Tag=1 then exit;
  if not assigned(prtBorrowCount) then
     prtBorrowCount:=TprtBorrowCount.Create(Application);
  try
    prtBorrowCount.RB1.Enabled:=false;
    prtBorrowCount.RB6.Checked:=true;
    prtBorrowCount.RB2.Enabled:=false;
    prtBorrowCount.RB3.Enabled:=false;
    prtBorrowCount.RB4.Enabled:=false;
    prtBorrowCount.RB5.Enabled:=false;
    prtBorrowCount.RB6.Enabled:=true;
    prtBorrowCount.ShowModal;
  finally
    prtBorrowCount.Free;
    prtBorrowCount:=nil;
  end;
end;

end.

⌨️ 快捷键说明

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