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

📄 mainsrc.~pas

📁 该程序可作为386的接警程序使用
💻 ~PAS
📖 第 1 页 / 共 2 页
字号:
        FormBJData.ADOQuery1.SQL.Clear;
        FormBJData.ADOQuery1.SQL.Text := strSQL;
        FormBJData.ADOQuery1.Open;
        FormBJData.ShowModal();

end;

procedure TFormMain.Look6to10Click(Sender: TObject);
var
        strSQL:string;
begin
        strSQL := 'select * from 报警器档案 where 楼号 >= 6 and 楼号 <= 10';
        FormBJData.ADOQuery1.Close;
        FormBJData.ADOQuery1.SQL.Clear;
        FormBJData.ADOQuery1.SQL.Text := strSQL;
        FormBJData.ADOQuery1.Open;
        FormBJData.ShowModal();

end;

procedure TFormMain.Look11to15Click(Sender: TObject);
var
        strSQL:string;
begin
        strSQL := 'select * from 报警器档案 where 楼号 >= 11 and 楼号 <= 15';
        FormBJData.ADOQuery1.Close;
        FormBJData.ADOQuery1.SQL.Clear;
        FormBJData.ADOQuery1.SQL.Text := strSQL;
        FormBJData.ADOQuery1.Open;
        FormBJData.ShowModal();

end;

procedure TFormMain.Look21to25Click(Sender: TObject);
var
        strSQL:string;
begin
        strSQL := 'select * from 报警器档案 where 楼号 >= 21 and 楼号 <= 25';
        FormBJData.ADOQuery1.Close;
        FormBJData.ADOQuery1.SQL.Clear;
        FormBJData.ADOQuery1.SQL.Text := strSQL;
        FormBJData.ADOQuery1.Open;
        FormBJData.ShowModal();

end;

procedure TFormMain.Look26to35Click(Sender: TObject);
var
        strSQL:string;
begin
        strSQL := 'select * from 报警器档案 where 楼号 >= 26 and 楼号 <= 35';
        FormBJData.ADOQuery1.Close;
        FormBJData.ADOQuery1.SQL.Clear;
        FormBJData.ADOQuery1.SQL.Text := strSQL;
        FormBJData.ADOQuery1.Open;
        FormBJData.ShowModal();

end;

procedure TFormMain.Look36to50Click(Sender: TObject);
var
        strSQL:string;
begin
        strSQL := 'select * from 报警器档案 where 楼号 >= 36 and 楼号 <= 50';
        FormBJData.ADOQuery1.Close;
        FormBJData.ADOQuery1.SQL.Clear;
        FormBJData.ADOQuery1.SQL.Text := strSQL;
        FormBJData.ADOQuery1.Open;
        FormBJData.ShowModal();

end;

procedure TFormMain.Look50to70Click(Sender: TObject);
var
        strSQL:string;
begin
        strSQL := 'select * from 报警器档案 where 楼号 >= 50 and 楼号 <= 70';
        FormBJData.ADOQuery1.Close;
        FormBJData.ADOQuery1.SQL.Clear;
        FormBJData.ADOQuery1.SQL.Text := strSQL;
        FormBJData.ADOQuery1.Open;
        FormBJData.ShowModal();

end;

procedure TFormMain.LookAbove70Click(Sender: TObject);
var
        strSQL:string;
begin
        strSQL := 'select * from 报警器档案 where 楼号 >= 70';
        FormBJData.ADOQuery1.Close;
        FormBJData.ADOQuery1.SQL.Clear;
        FormBJData.ADOQuery1.SQL.Text := strSQL;
        FormBJData.ADOQuery1.Open;
        FormBJData.ShowModal();

end;

procedure TFormMain.Look16to20Click(Sender: TObject);
var
        strSQL:string;
begin
        strSQL := 'select * from 报警器档案 where 楼号 >= 16 and 楼号 <= 20';
        FormBJData.ADOQuery1.Close;
        FormBJData.ADOQuery1.SQL.Clear;
        FormBJData.ADOQuery1.SQL.Text := strSQL;
        FormBJData.ADOQuery1.Open;
        FormBJData.ShowModal();

end;

procedure TFormMain.MenuHardwareInterfaceClick(Sender: TObject);
begin
        FormHardwareInterface.ShowModal();
end;

procedure TFormMain.MenuDataRestoreClick(Sender: TObject);
var
        strFile,strSQL:string;
        strOrigin:string;
        ret:Boolean;
        Dir:String;
        i:Integer;
        bbb:boolean;
begin
        i := strcomp(pChar('Admin'), pChar(strStore1));
        if i <> 0 then
        begin
                Messagebox(Application.Handle, '只有管理员才能进行数据备份,请以管理员帐号重新登陆','联网报警中心--数据管理',MB_OK);
                Exit;
        end;
        BJDataSrc.FormBJData.ADOQuery1.Active := false;
        BJInfoSrc.FormBJInfo.ADOQuery1.Active := false;
        FormLogon.ADOQuery1.Active := false;


        FormBJData.ADOConnection1.Connected := false;

        FormLogon.ADOConnection1.Connected := false;
       
        //monitorControl.ADOConnection1.Connected:=false;

        GetDir(0, Dir);
        strOrigin := 'bj.mdb';
        if not OpenDialogStore.Execute then
        begin
                BJDataSrc.FormBJData.ADOConnection1.Connected := TRUE;
                FormLogon.ADOConnection1.Connected := TRUE;
                //monitorControl.ADOConnection1.Connected:=TRUE;
                BJDataSrc.FormBJData.ADOQuery1.Active := TRUE;
                BJInfoSrc.FormBJInfo.ADOQuery1.Active := TRUE;
                FormLogon.ADOQuery1.Active := TRUE;
                Exit;
        end;
        strFile := OpenDialogStore.FileName;
        ChDir(Dir);
        //if IOResult <> 0 then
                //MessageDlg('Cannot find directory', mtWarning, [mbOk], 0);
        //if FileExists(strOrigin)then ShowMessage('success')
        //else  ShowMessage('fail');
        ret := DeleteFile('wd.txt');//strOrigin);
        //ShowMessage(pchar(inttostr(getlasterror())));
        if ret = true then
        begin
                ret := CopyFileTo(strFile, strOrigin);
                if ret = TRUE
                then  MessageBox(Application.Handle, '数据恢复成功!', '联网报警中心--数据导入', MB_OK)
                else   MessageBox(Application.Handle, '数据恢复失败,请再尝试!', '联网报警中心--数据导入', MB_OK);
        end
        else ShowMessage('删除bj.mdb失败,');
        BJDataSrc.FormBJData.ADOConnection1.Connected := TRUE;
        FormLogon.ADOConnection1.Connected := TRUE;
        //monitorControl.ADOConnection1.Connected:=TRUE;
        BJDataSrc.FormBJData.ADOQuery1.Active := TRUE;
        BJInfoSrc.FormBJInfo.ADOQuery1.Active := TRUE;
        FormLogon.ADOQuery1.Active := TRUE;
end;

procedure TFormMain.N11Click(Sender: TObject);
begin
        QuickReportSrc.DataReport.Preview;
end;

procedure TFormMain.N12Click(Sender: TObject);
begin
        InfoReportSrc.InfoReport.Preview;
end;

procedure TFormMain.N5Click(Sender: TObject);
begin
        AutoSaveSrc.FormAutoSave.ShowModal;
end;

procedure TFormMain.TimerAutoSaveTimer(Sender: TObject);
var
        strSource:string;
        strDest:string;
        i, len:Integer;
begin
        strSource := 'bj.mdb';
        strDest := TimeToStr(time);

        len := strLen( PChar(strDest) );
        for i:=1 to len  do
                if strDest[i] = ':' then
                begin
                        strDest[i] := '-';
                end;

        strDest := 'BackUp\' + DateToStr(date)+'-'+strDest + '.mdb';

end;

procedure TFormMain.MenuAboutClick(Sender: TObject);
begin
//        MessageBox(Application.Handle, '四川省得安科技有限公司制作 电话:(028)86261878 86261861 传真:86261878 邮编:610031', '联网报警中心--关于', MB_OK);
        FormAbout.ShowModal();
end;

procedure TFormMain.MenuConnectClick(Sender: TObject);
begin
   FormConnectCenter.ShowModal();
end;

procedure TFormMain.Button2Click(Sender: TObject);
begin
    TimerFlashJin.Enabled := true;
    TimerFlashJu.Enabled := true;
end;

procedure TFormMain.light1to5Click(Sender: TObject);
begin
        TimerFlashJu.Enabled := false;
        FormMain.light1to5.Visible := false;

        FormMap1.ShowModal();
end;

procedure TFormMain.light6to10Click(Sender: TObject);
begin
        TimerFlashJin.Enabled := false;

        FormMain.light6to10.Visible := false;
        FormMap2.ShowModal();
end;

procedure TFormMain.MenuDeleteInfoClick(Sender: TObject);
var     nTemp:Integer;
begin
        nTemp := strcomp(pChar('Admin'), pChar(strStore1) );
        if nTemp <> 0 then
        begin
                Messagebox(Application.Handle, '只有管理员才能删除,请以管理员帐号重新登陆','联网报警中心--清除历史报警信息',MB_OK);
                Exit;
        end;

        FormDeleteInfo.ShowModal();
end;

procedure TFormMain.gray6to10Click(Sender: TObject);
begin
    TimerFlashJin.Enabled := false;

    FormMain.light6to10.Enabled := false;
    FormMap2.ShowModal();
end;

procedure TFormMain.gray1to5Click(Sender: TObject);
begin
    TimerFlashJu.Enabled := false;

    FormMain.light1to5.Enabled := false;
    FormMap1.ShowModal();
end;

procedure TFormMain.TimerFlashJuTimer(Sender: TObject);
begin

      Light1to5.Visible := not Light1to5.Visible;

end;

procedure TFormMain.TimerFlashJinTimer(Sender: TObject);
begin

      Light6to10.Visible := not Light6to10.Visible;

end;

procedure TFormMain.N16l1Click(Sender: TObject);
begin
        //monitorControl.ShowModal();
end;

procedure TFormMain.MenuHelpClick(Sender: TObject);
begin
        ShellExecute(Handle, 'open', 'help.hlp', nil, nil, SW_SHOW);
end;
end.

⌨️ 快捷键说明

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