?? chshhfrm.pas
字號:
unit chshhfrm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Gauges, Buttons;
type
Tchshh = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Label1: TLabel;
GroupBox1: TGroupBox;
Gauge1: TGauge;
Label2: TLabel;
SpeedButton2: TSpeedButton;
SpeedButton1: TSpeedButton;
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
chshh: Tchshh;
implementation
uses datafrm;
{$R *.dfm}
procedure Tchshh.SpeedButton2Click(Sender: TObject);
begin
close;
end;
procedure Tchshh.SpeedButton1Click(Sender: TObject);
var
s,i,j:longint;
begin
chshh.SpeedButton1.Enabled:=false;
chshh.SpeedButton2.Enabled:=false;
s:=0;
i:=0;
s:=s+yfgldata.sdyh.RecordCount;
s:=s+yfgldata.sdf.RecordCount;
s:=s+yfgldata.dwsdf.RecordCount;
s:=s+yfgldata.grjyyj.RecordCount;
s:=s+yfgldata.grjyyj1.RecordCount;
s:=s+yfgldata.yjzl.RecordCount;
s:=s+yfgldata.yj.RecordCount;
s:=s+yfgldata.yj1.RecordCount;
s:=s+yfgldata.kcyj.RecordCount;
s:=s+yfgldata.kcyj1.RecordCount;
s:=s+yfgldata.dwyj.RecordCount;
s:=s+yfgldata.dwyj1.RecordCount;
s:=s+yfgldata.dbd.RecordCount;
s:=s+yfgldata.dbd1.RecordCount;
s:=s+yfgldata.cjd.RecordCount;
s:=s+yfgldata.cjd1.RecordCount;
s:=s+yfgldata.dwqk.RecordCount;
s:=s+yfgldata.guolu.RecordCount;
s:=s+yfgldata.gx.RecordCount;
s:=s+yfgldata.xjyf.RecordCount;
s:=s+yfgldata.yfda.RecordCount;
s:=s+yfgldata.yffd.RecordCount;
s:=s+yfgldata.yfsb.RecordCount;
s:=s+yfgldata.yfwz.RecordCount;
s:=s+yfgldata.yfzl.RecordCount;
s:=s+yfgldata.dt.RecordCount;
s:=s+yfgldata.wx.RecordCount;
s:=s+yfgldata.wxwz.RecordCount;
s:=s+yfgldata.wxwz1.RecordCount;
s:=s+yfgldata.dw.RecordCount;
if s>1 then
begin
chshh.Label2.Caption:='正在初始化水電用戶數據...';
yfgldata.sdyh.First;
for j:=1 to yfgldata.sdyh.RecordCount do
begin
yfgldata.sdyh.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化用戶水電費數據...';
yfgldata.sdf.First;
for j:=1 to yfgldata.sdf.RecordCount do
begin
yfgldata.sdf.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化單位水電費數據...';
yfgldata.dwsdf.First;
for j:=1 to yfgldata.dwsdf.RecordCount do
begin
yfgldata.dwsdf.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化個人借用營具數據...';
yfgldata.grjyyj.First;
for j:=1 to yfgldata.grjyyj.RecordCount do
begin
yfgldata.grjyyj.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
yfgldata.grjyyj1.First;
for j:=1 to yfgldata.grjyyj1.RecordCount do
begin
yfgldata.grjyyj1.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化營具種類數據...';
yfgldata.yjzl.First;
for j:=1 to yfgldata.yjzl.RecordCount do
begin
yfgldata.yjzl.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化系統營具數據...';
yfgldata.yj.First;
for j:=1 to yfgldata.yj.RecordCount do
begin
yfgldata.yj.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
yfgldata.yj1.First;
for j:=1 to yfgldata.yj1.RecordCount do
begin
yfgldata.yj1.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化庫存營具數據...';
yfgldata.kcyj.First;
for j:=1 to yfgldata.kcyj.RecordCount do
begin
yfgldata.kcyj.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
yfgldata.kcyj1.First;
for j:=1 to yfgldata.kcyj1.RecordCount do
begin
yfgldata.kcyj1.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化單位營具數據...';
yfgldata.dwyj.First;
for j:=1 to yfgldata.dwyj.RecordCount do
begin
yfgldata.dwyj.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
yfgldata.dwyj1.First;
for j:=1 to yfgldata.dwyj1.RecordCount do
begin
yfgldata.dwyj1.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化營具調撥單數據...';
yfgldata.dbd.First;
for j:=1 to yfgldata.dbd.RecordCount do
begin
yfgldata.dbd.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
yfgldata.dbd1.First;
for j:=1 to yfgldata.dbd1.RecordCount do
begin
yfgldata.dbd1.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化出借單數據...';
yfgldata.cjd.First;
for j:=1 to yfgldata.cjd.RecordCount do
begin
yfgldata.cjd.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
yfgldata.cjd1.First;
for j:=1 to yfgldata.cjd1.RecordCount do
begin
yfgldata.cjd1.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化單位情況數據...';
yfgldata.dwqk.First;
for j:=1 to yfgldata.dwqk.RecordCount do
begin
yfgldata.dwqk.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化鍋爐分臺登記表數據...';
yfgldata.guolu.First;
for j:=1 to yfgldata.guolu.RecordCount do
begin
yfgldata.guolu.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化管線數據...';
yfgldata.gx.First;
for j:=1 to yfgldata.gx.RecordCount do
begin
yfgldata.gx.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化新建營房數據...';
yfgldata.xjyf.First;
for j:=1 to yfgldata.xjyf.RecordCount do
begin
yfgldata.xjyf.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化營房檔案數據...';
yfgldata.yfda.First;
for j:=1 to yfgldata.yfda.RecordCount do
begin
yfgldata.yfda.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化營房分棟登記表數據...';
yfgldata.yffd.First;
for j:=1 to yfgldata.yffd.RecordCount do
begin
yfgldata.yffd.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化營房設施設備數據...';
yfgldata.yfsb.First;
for j:=1 to yfgldata.yfsb.RecordCount do
begin
yfgldata.yfsb.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化營房戰備物資數據...';
yfgldata.yfwz.First;
for j:=1 to yfgldata.yfwz.RecordCount do
begin
yfgldata.yfwz.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化營房坐落登記表數據...';
yfgldata.yfzl.First;
for j:=1 to yfgldata.yfzl.RecordCount do
begin
yfgldata.yfzl.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化電梯分部登記表數據...';
yfgldata.dt.First;
for j:=1 to yfgldata.dt.RecordCount do
begin
yfgldata.dt.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化維修登記數據...';
yfgldata.wx.First;
for j:=1 to yfgldata.wx.RecordCount do
begin
yfgldata.wx.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化維修物資數據...';
yfgldata.wxwz.First;
for j:=1 to yfgldata.wxwz.RecordCount do
begin
yfgldata.wxwz.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
yfgldata.wxwz1.First;
for j:=1 to yfgldata.wxwz1.RecordCount do
begin
yfgldata.wxwz1.Delete;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
chshh.Label2.Caption:='正在初始化單位設置數據...';
yfgldata.dw.First;
for j:=1 to yfgldata.dw.RecordCount do
begin
if yfgldata.dw.FieldByName('上級代碼').AsString<>'' then
yfgldata.dw.Delete
else
yfgldata.dw.Next;
i:=i+1;
chshh.Gauge1.Progress:=(i*100) div s;
end;
messagebox(chshh.handle,'系統初始化完畢。','營房工作管理系統',mb_iconexclamation);
close;
end
else
begin
messagebox(chshh.handle,'系統已經初始化。','營房工作管理系統',16);
close;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -