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

📄 fysyf.pas

📁 操作系统:Windows ME/2000/XP 开发工具:Delphi 7.0 数据库:SQL Server 2000 硬件配置:CPU:Pentium 200MHz 以上 内存:32MBRA
💻 PAS
字号:
unit Fysyf;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Fbase, DB, ADODB, Buttons, Grids, DBGrids, ComCtrls, ToolWin,
  ExtCtrls;

type
  TF_ysyf = class(TF_base)
    ADOQuery1: TADOQuery;
    StringGrid1: TStringGrid;
    Panel1: TPanel;
    StatusBar1: TStatusBar;
    procedure FormShow(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  F_ysyf: TF_ysyf;

implementation
  uses Fdm,Ffyzc;
{$R *.dfm}

procedure TF_ysyf.FormShow(Sender: TObject);
var
  grow,gcol:integer;
  sum:real;
begin
  inherited;
  sum:=0;
  Panel1.Caption:='科目全称:'+F_fyzc.ADOQuery1.Fields[1].AsString;
  with stringgrid1 do
  begin
    cells[1,0]:='日期';
    cells[2,0]:='单据编号';
    cells[3,0]:='说明';
    cells[4,0]:='金额';
  end;
  with Adoquery1 do
  begin
    Close;
    SQL.Clear;
    SQL.Add('select * from tb_cf  where number='+''''+F_fyzc.ADOQuery1.Fields[0].AsString+''''+'and billdate between :one and :two ');
    Parameters.ParamByName('one').Value:=F_fyzc.DateTimePicker1.Date;
    Parameters.ParamByName('two').Value:=F_fyzc.DateTimePicker2.Date;
    Open;
  end;
  with stringgrid1 do
  begin
    for grow:=1 to Adoquery1.RecordCount do
    begin
      cells[0,grow]:=inttostr(grow);
      for gcol:=1 to 4 do
      begin
        if gcol<=2 then
          cells[gcol,grow]:=adoquery1.Fields[gcol-1].AsString;
        if gcol=3 then
          if adoquery1.Fields[2].AsString='' then
            cells[3,grow]:='本单位'
          else
            cells[3,grow]:=adoquery1.Fields[2].AsString;
        if gcol=4 then
          cells[4,grow]:=Adoquery1.Fields[7].AsString;
      end;
      Adoquery1.Next;
    end;
  end;
  stringgrid1.RowCount:=Adoquery1.RecordCount+1;
  for grow:=1 to adoquery1.RecordCount+1 do
  begin
    if stringgrid1.Cells[4,grow]<>'' then
      sum:=sum+strtofloat(stringgrid1.Cells[4,grow]);
    statusbar1.Panels[1].Text:=floattostr(sum);
  end;
end;

procedure TF_ysyf.SpeedButton2Click(Sender: TObject);
begin
  inherited;
  Close;
end;

end.

⌨️ 快捷键说明

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