?? unit1.pas
字號:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, BarHL, Barcode, ExtCtrls, Buttons, StdCtrls, TeeProcs, TeEngine,
Chart, DbChart, Grids, DBGrids, DB, ADODB, ComCtrls, xpPages, RzPanel,
RzSplit, BusinessSkinForm, RzLabel, RzLstBox, xpBitBtn, RzBorder, Series,
jpeg, RzEdit, RzBckgnd, bsSkinCtrls, bsSkinGrids, bsDBGrids, RzTreeVw,
xpButton, Mask, QuickRpt, QRCtrls;
type
TzkForm = class(TForm)
bsBusinessSkinForm1: TbsBusinessSkinForm;
RzSplitter1: TRzSplitter;
RzPanel1: TRzPanel;
RzPanel2: TRzPanel;
xpPageControl1: TxpPageControl;
xpTabSheet1: TxpTabSheet;
xpTabSheet2: TxpTabSheet;
xpTabSheet3: TxpTabSheet;
xpTabSheet4: TxpTabSheet;
xpTabSheet5: TxpTabSheet;
RzPanel3: TRzPanel;
RzPanel4: TRzPanel;
ADOConnection1: TADOConnection;
ry1: TADOQuery;
ry1guest_id: TStringField;
ry1guest_name: TStringField;
ry1xb: TStringField;
ry1gj: TStringField;
ry1co_name: TStringField;
ry1address: TStringField;
ry1lx: TStringField;
ry1md: TStringField;
ry1zj_name: TStringField;
ry1zj_no: TStringField;
ry1photo: TBlobField;
rySc1: TDataSource;
info: TADOQuery;
DataSource1: TDataSource;
countrs: TADOQuery;
countrsrs: TIntegerField;
DBGrid1: TDBGrid;
RzListBox1: TRzListBox;
RzPanel5: TRzPanel;
RzLabel1: TRzLabel;
Image1: TImage;
RzPanel6: TRzPanel;
RzLabel2: TRzLabel;
Image2: TImage;
RzPanel7: TRzPanel;
RzLabel3: TRzLabel;
Image3: TImage;
RzPanel8: TRzPanel;
RzLabel4: TRzLabel;
Image4: TImage;
RzPanel9: TRzPanel;
RzLabel5: TRzLabel;
Image5: TImage;
RzPanel10: TRzPanel;
RzLabel6: TRzLabel;
Image6: TImage;
RzPanel11: TRzPanel;
RzLabel7: TRzLabel;
Image7: TImage;
RzPanel12: TRzPanel;
RzLabel8: TRzLabel;
Image8: TImage;
RzPanel13: TRzPanel;
RzLabel9: TRzLabel;
Image9: TImage;
RzPanel14: TRzPanel;
RzLabel10: TRzLabel;
Image10: TImage;
RzPanel15: TRzPanel;
RzLabel11: TRzLabel;
Image11: TImage;
RzPanel16: TRzPanel;
RzLabel12: TRzLabel;
Image12: TImage;
RzPanel17: TRzPanel;
RzLabel13: TRzLabel;
Image13: TImage;
RzPanel18: TRzPanel;
RzLabel14: TRzLabel;
Image14: TImage;
RzPanel19: TRzPanel;
RzLabel15: TRzLabel;
Image15: TImage;
RzPanel20: TRzPanel;
RzLabel16: TRzLabel;
Image16: TImage;
RzPanel21: TRzPanel;
RzLabel17: TRzLabel;
Image17: TImage;
RzPanel22: TRzPanel;
RzLabel18: TRzLabel;
Image18: TImage;
RzPanel23: TRzPanel;
RzLabel19: TRzLabel;
Image19: TImage;
RzPanel24: TRzPanel;
RzLabel20: TRzLabel;
Image20: TImage;
RzPanel25: TRzPanel;
RzLabel21: TRzLabel;
Image21: TImage;
RzPanel26: TRzPanel;
RzLabel22: TRzLabel;
Image22: TImage;
RzPanel27: TRzPanel;
RzLabel23: TRzLabel;
Image23: TImage;
RzPanel28: TRzPanel;
RzLabel24: TRzLabel;
Image24: TImage;
RzPanel29: TRzPanel;
RzLabel25: TRzLabel;
Image25: TImage;
RzPanel30: TRzPanel;
RzLabel26: TRzLabel;
Image26: TImage;
RzPanel31: TRzPanel;
RzLabel27: TRzLabel;
Image27: TImage;
RzPanel32: TRzPanel;
RzLabel28: TRzLabel;
Image28: TImage;
RzPanel33: TRzPanel;
RzLabel29: TRzLabel;
Image29: TImage;
RzPanel34: TRzPanel;
RzLabel30: TRzLabel;
Image30: TImage;
RzPanel35: TRzPanel;
RzLabel31: TRzLabel;
Image31: TImage;
RzPanel36: TRzPanel;
RzLabel32: TRzLabel;
Image32: TImage;
doorTimer: TTimer;
door: TADOQuery;
doorDOOR_NAME: TStringField;
doorTTIME: TDateTimeField;
xpBitBtn1: TxpBitBtn;
xpBitBtn2: TxpBitBtn;
xpBitBtn3: TxpBitBtn;
xpBitBtn4: TxpBitBtn;
xpBitBtn5: TxpBitBtn;
xpBitBtn6: TxpBitBtn;
xpBitBtn7: TxpBitBtn;
allaction: TADOCommand;
infoinfo_id: TAutoIncField;
infoitime: TDateTimeField;
infoinfo: TStringField;
RzPanel37: TRzPanel;
RzLEDDisplay2: TRzLEDDisplay;
RzLabel33: TRzLabel;
xpTabSheet6: TxpTabSheet;
doorstream: TADOQuery;
doorstmsc: TDataSource;
DBChart2: TDBChart;
Series1: TBarSeries;
doorstreamdoor_id: TStringField;
doorstreamin_num: TIntegerField;
doorstreamout_num: TIntegerField;
Series2: TBarSeries;
DBGrid2: TDBGrid;
RzPanel38: TRzPanel;
RzBackground1: TRzBackground;
RzMemo1: TRzMemo;
xpBitBtn8: TxpBitBtn;
DBChart1: TDBChart;
Series3: TLineSeries;
RzGroupBox1: TRzGroupBox;
RzPanel39: TRzPanel;
bsSkinDBGrid1: TbsSkinDBGrid;
ttype: TADOQuery;
ttypetype_id: TStringField;
ttypetype_name: TStringField;
memo1: TMemo;
RzGroupBox2: TRzGroupBox;
bsSkinDBGrid2: TbsSkinDBGrid;
RzPanel40: TRzPanel;
RzTreeView1: TRzTreeView;
RzBackground2: TRzBackground;
RzLabel34: TRzLabel;
RzEdit1: TRzEdit;
xpButton1: TxpButton;
RzLabel35: TRzLabel;
QuickRep1: TQuickRep;
QRSubDetail1: TQRSubDetail;
QRStringsBand1: TQRStringsBand;
QRBand1: TQRBand;
QRLabel1: TQRLabel;
RzPanel41: TRzPanel;
RzLabel36: TRzLabel;
Image33: TImage;
RzPanel42: TRzPanel;
RzLabel37: TRzLabel;
Image34: TImage;
RzPanel43: TRzPanel;
RzLabel38: TRzLabel;
Image35: TImage;
RzPanel44: TRzPanel;
RzLabel39: TRzLabel;
Image36: TImage;
RzPanel45: TRzPanel;
RzLabel40: TRzLabel;
Image37: TImage;
RzPanel46: TRzPanel;
RzLabel41: TRzLabel;
Image38: TImage;
RzPanel47: TRzPanel;
RzLabel42: TRzLabel;
Image39: TImage;
RzPanel48: TRzPanel;
RzLabel43: TRzLabel;
Image40: TImage;
procedure doorTimerTimer(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure xpBitBtn1Click(Sender: TObject);
procedure xpBitBtn2Click(Sender: TObject);
procedure xpBitBtn3Click(Sender: TObject);
procedure xpBitBtn8Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
zkForm: TzkForm;
bimg1,bimg2,bimg3:timage;
implementation
uses main;
{$R *.dfm}
procedure TzkForm.doorTimerTimer(Sender: TObject);
var
i:integer;
ifopen:array[0..22] of integer;
begin
door.Active:=false;
door.Active:=true;
for i:=1 to 22 do
begin
ifopen[i]:=0;
end;
if not door.IsEmpty then
begin
door.First;
while not door.Eof do
begin
ifopen[strtoint(copy(doordoor_name.Value,1,2))]:=1;
door.Next;
end;
end;
if ifopen[1]=1 then image1.picture.bitmap:=bimg3.picture.bitmap else image1.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[2]=1 then image2.picture.bitmap:=bimg3.picture.bitmap else image2.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[3]=1 then image3.picture.bitmap:=bimg3.picture.bitmap else image3.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[4]=1 then image4.picture.bitmap:=bimg3.picture.bitmap else image4.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[5]=1 then image5.picture.bitmap:=bimg3.picture.bitmap else image5.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[6]=1 then image6.picture.bitmap:=bimg3.picture.bitmap else image6.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[7]=1 then image7.picture.bitmap:=bimg3.picture.bitmap else image7.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[8]=1 then image8.picture.bitmap:=bimg3.picture.bitmap else image8.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[9]=1 then image9.picture.bitmap:=bimg3.picture.bitmap else image9.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[10]=1 then image10.picture.bitmap:=bimg3.picture.bitmap else image10.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[11]=1 then image11.picture.bitmap:=bimg3.picture.bitmap else image11.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[12]=1 then image12.picture.bitmap:=bimg3.picture.bitmap else image12.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[13]=1 then image13.picture.bitmap:=bimg3.picture.bitmap else image13.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[14]=1 then image14.picture.bitmap:=bimg3.picture.bitmap else image14.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[15]=1 then image15.picture.bitmap:=bimg3.picture.bitmap else image15.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[16]=1 then image16.picture.bitmap:=bimg3.picture.bitmap else image16.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[17]=1 then image17.picture.bitmap:=bimg3.picture.bitmap else image17.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[18]=1 then image18.picture.bitmap:=bimg3.picture.bitmap else image18.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[19]=1 then image19.picture.bitmap:=bimg3.picture.bitmap else image19.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[20]=1 then image20.picture.bitmap:=bimg3.picture.bitmap else image20.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[21]=1 then image21.picture.bitmap:=bimg3.picture.bitmap else image21.picture.bitmap:=bimg1.picture.bitmap;
if ifopen[22]=1 then image22.picture.bitmap:=bimg3.picture.bitmap else image22.picture.bitmap:=bimg1.picture.bitmap;
info.Active:=false;
info.Active:=true;
info.Last;
countrs.Active:=false;
countrs.Active :=true;
rzleddisplay2.Caption:=(inttostr(countrsrs.Value));
doorstream.Active:=false;
doorstream.Active:=true;
//(dbchart2.Series[0] as tpieseries).pievalues.
end;
procedure TzkForm.FormCreate(Sender: TObject);
begin
bimg1:=TImage.Create(self);
bimg2:=TImage.Create(self);
bimg3:=TImage.Create(self);
bimg1.Picture.LoadFromFile('.\red.bmp');
bimg2.Picture.LoadFromFile('.\he.bmp');
bimg3.Picture.LoadFromFile('.\green.bmp');
memo1.Clear;
memo1.Lines.Add('所有類型');
ttype.First;
while not ttype.Eof do
begin
memo1.Lines.Add(' '+trim(ttypetype_name.Value));
ttype.Next;
end;
memo1.Lines.SaveToFile('.\lx.txt');
rztreeview1.LoadFromFile('.\lx.txt');
end;
procedure TzkForm.xpBitBtn1Click(Sender: TObject);
begin
allaction.CommandText:='delete from in_stream';
allaction.Execute;
allaction.CommandText:='insert into info(itime,info) values(getdate(),'+''''+'總控通知:系統已經全部清場!請各門人員退出系統。'+''''+')';
allaction.Execute;
end;
procedure TzkForm.xpBitBtn2Click(Sender: TObject);
begin
allaction.CommandText:='delete from door';
allaction.Execute;
allaction.CommandText:='insert into info(itime,info) values(getdate(),'+''''+'總控通知:系統已經全部閉門!請各門人員退出系統。'+''''+')';
allaction.Execute;
end;
procedure TzkForm.xpBitBtn3Click(Sender: TObject);
begin
allaction.CommandText:='insert into his_info select * from info';
allaction.Execute;
allaction.CommandText:='delete info';
allaction.Execute;
end;
procedure TzkForm.xpBitBtn8Click(Sender: TObject);
begin
allaction.CommandText:='insert into info(itime,info) values(getdate(),'+''''+'總控通知:'+trim(rzmemo1.Text)+''''+')';
allaction.Execute;
rzmemo1.Text:='';
rzmemo1.SetFocus;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -