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

📄 mc_wzxxdy.pas

📁 1、系统环境要求:所有程序均在Windows98/XP操作系统下测试运行。 2、建议用户在系统上安装DELPHI7.0企业版。 3、如果数据库为SQL Server数据库
💻 PAS
字号:
unit MC_WZXXDY;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Db, DBTables, StdCtrls, Buttons, Grids, DBGrids, Qrctrls, QuickRpt,
  ExtCtrls;

type
  TWZXXDY = class(TForm)
    Label1: TLabel;
    DBGrid1: TDBGrid;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    Edit1: TEdit;
    BitBtn1: TBitBtn;
    Query1: TQuery;
    Query1BDEDesigner: TStringField;
    Query1BDEDesigner2: TStringField;
    Query1BDEDesigner3: TStringField;
    Query1BDEDesigner4: TStringField;
    Query1BDEDesigner5: TDateTimeField;
    Query1BDEDesigner6: TStringField;
    Query1BDEDesigner7: TStringField;
    Query1BDEDesigner8: TMemoField;
    DataSource1: TDataSource;
    BitBtn2: TBitBtn;
    BitBtn3: TBitBtn;
    QuickRep1: TQuickRep;
    PageHeaderBand1: TQRBand;
    QRLabel1: TQRLabel;
    QRShape1: TQRShape;
    TitleBand1: TQRBand;
    QRShape2: TQRShape;
    QRLabel2: TQRLabel;
    QRLabel3: TQRLabel;
    QRLabel4: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel6: TQRLabel;
    QRLabel7: TQRLabel;
    QRLabel8: TQRLabel;
    QRShape3: TQRShape;
    QRShape4: TQRShape;
    QRShape5: TQRShape;
    QRShape6: TQRShape;
    QRShape7: TQRShape;
    QRShape8: TQRShape;
    DetailBand1: TQRBand;
    QRShape9: TQRShape;
    QRShape10: TQRShape;
    QRShape11: TQRShape;
    QRShape12: TQRShape;
    QRShape13: TQRShape;
    QRShape14: TQRShape;
    QRShape15: TQRShape;
    QRDBText1: TQRDBText;
    QRDBText2: TQRDBText;
    QRDBText3: TQRDBText;
    QRDBText4: TQRDBText;
    QRDBText5: TQRDBText;
    QRDBText6: TQRDBText;
    QRDBText7: TQRDBText;
    SummaryBand1: TQRBand;
    QRShape16: TQRShape;
    QRLabel9: TQRLabel;
    QRExpr1: TQRExpr;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure QuickRep1Preview(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  WZXXDY: TWZXXDY;

implementation

uses MC_DYYLBrose;

{$R *.DFM}

procedure TWZXXDY.FormClose(Sender: TObject; var Action: TCloseAction);
begin
     WZXXDY.Release;
     WZXXDY:=Nil;
end;

procedure TWZXXDY.BitBtn1Click(Sender: TObject);
begin
     if ComboBox2.Text='Like' then
        begin
             if Edit1.Text='*' then
                begin
                     Query1.Close;
                     Query1.SQL.Clear;
                     Query1.SQL.Add('Select * From 违章信息');
                     Query1.Open;
                end
             else
                Begin
                     With Query1 do
                     begin
                          Close;
                          SQL.Clear;
                          SQL.Add('Select * From 违章信息');
                          SQL.Add('where '+ComboBox1.Items[ComboBox1.ItemIndex]
                              +' Like '''+Edit1.Text+'%''');
                          Open;
                     end;
                end;
        end;
//--------------------------------------------------------------------
     if ComboBox2.Text='=' then
        begin
             With Query1 do
             begin
                  Close;
                  SQL.Clear;
                  SQL.Add('Select * From 违章信息');
                  SQL.Add('where '+ComboBox1.Items[ComboBox1.ItemIndex]
                         +' = '''+Edit1.Text+'''');
                  Open;
             end;
        end;
//--------------------------------------------------------------------
     if ComboBox2.Text='>' then
        begin
             With Query1 do
             begin
                  Close;
                  SQL.Clear;
                  SQL.Add('Select * From 违章信息');
                  SQL.Add('where '+ComboBox1.Items[ComboBox1.ItemIndex]+' > '''+Edit1.Text+'''');
                  Open;
             end;
        end;
//--------------------------------------------------------------------
     if ComboBox2.Text='<' then
        begin
             With Query1 do
             begin
                  Close;
                  SQL.Clear;
                  SQL.Add('Select * From 违章信息');
                  SQL.Add('where '+ComboBox1.Items[ComboBox1.ItemIndex]
                         +' < '''+Edit1.Text+'''');
                  Open;
             end;
        end;
//--------------------------------------------------------------------
end;

procedure TWZXXDY.BitBtn3Click(Sender: TObject);
begin
     Close;
end;

procedure TWZXXDY.FormShow(Sender: TObject);
begin
     ComboBox1.ItemIndex:=0;
     ComboBox2.ItemIndex:=0;
end;

procedure TWZXXDY.QuickRep1Preview(Sender: TObject);
begin
     DYYLBrose.QRPreview1.QRPrinter:=QuickRep1.QRPrinter;
end;

procedure TWZXXDY.BitBtn2Click(Sender: TObject);
begin
     if Query1.ACtive then
     if Query1.Recordcount<>0 then
        begin
             DYYLBrose.Show;
             QuickRep1.Preview;
        end;
end;

end.

⌨️ 快捷键说明

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