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

📄 csjkzl.pas

📁 根据箱号
💻 PAS
字号:
unit Csjkzl;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Cmodel, Menus, StdCtrls, ExtCtrls, Buttons, DB, ADODB, Gauges;

type
  Tsjkzl = class(Tmodel)
    Panel1: TPanel;
    Label1: TLabel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    ADOQuery1: TADOQuery;
    Memo1: TMemo;
    ADOQuery2: TADOQuery;
    ADOQuery3: TADOQuery;
    ADOQuery4: TADOQuery;
    Label3: TLabel;
    Gauge_process: TGauge;
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  sjkzl: Tsjkzl;

implementation

{$R *.dfm}

procedure Tsjkzl.BitBtn1Click(Sender: TObject);
var
  mess:string;
begin
  inherited;
  adoquery1.Close;
  adoquery1.SQL.Clear;
  adoquery1.SQL.Add('select * from 串号管理');
  adoquery1.Open;
  mess:='当前数据库共有〖'+inttostr(adoquery1.RecordCount)+'〗条记录:';
  adoquery2.Close;
  adoquery2.SQL.Clear;
  adoquery2.SQL.Add('select * from 串号管理 where 箱号有无=''无''');
  adoquery2.Open;
  mess:=mess+#13#10+'  其中厂家生成箱号数据有【'+inttostr(adoquery1.RecordCount-adoquery2.RecordCount)+'】条;';
  mess:=mess+#13#10+'  其中系统生成箱号数据有【'+inttostr(adoquery2.RecordCount)+'】条;'; 
  adoquery3.Close;
  adoquery3.SQL.Clear;
  adoquery3.SQL.Add('select DISTINCT 箱号 from 串号管理 ');
  adoquery3.Open;
  mess:=mess+#13#10+'  其中自动生成箱号数据有【'+inttostr(adoquery3.RecordCount)+'】条';
  memo1.Text:=mess;
  begin
    Gauge_process.Visible:=true;
      With Gauge_process do
           begin
             Gauge_process.MaxValue:=adoquery3.recordcount;
             Gauge_process.Progress:=0;
             while not adoquery3.Eof do
               begin
                 adoquery4.Close;
                 adoquery4.SQL.Clear;
                 adoquery4.SQL.Add('select * from 串号管理 where 箱号='''+adoquery3.fieldbyname('箱号').AsString+'''');
                 adoquery4.Open;
                 if adoquery4.RecordCount >30 then
                     mess:=mess+#13#10+'箱号为【'+adoquery3.fieldbyname('箱号').AsString+'】的电子串号数据有【'+inttostr(adoquery4.RecordCount)+'】条';
                 if adoquery4.RecordCount mod 5 <>0 then
                    begin
                      mess:=mess+#13#10+'箱号为【'+adoquery3.fieldbyname('箱号').AsString+'】的电子串号数据有【'+inttostr(adoquery4.RecordCount)+'】条';
                    end;
                 memo1.Text:=mess;
                 adoquery3.Next;
                 Gauge_process.Progress :=Gauge_process.Progress +1;
               end;
           end;
        end;

end;

end.

⌨️ 快捷键说明

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