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

📄 dr_addbackupdevice.pas

📁 亚惠快餐管理信息系统 包括亚惠快餐管理的各项功能
💻 PAS
字号:
unit DR_AddBackupDevice;

{
代码单元名称:通用数据库恢复工具设备选择窗口
从属软件:大连资金清算中心打码机管理信息系统
开发单位:大连理工大学计算机技术研究所软件工程研究室
作者:王树润
时间:2001,1,30
}

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, dbgrids;

type
  TDR_DfmBackupDestination = class(TForm)
    Label1: TLabel;
    DestinationComboBox: TComboBox;
    Button1: TButton;
    Button2: TButton;
    procedure FormShow(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    AddDeviceIdentify: boolean;
    DestinationListBox: TListBox;
    constructor Create(Owner: TComponent; ADestinationListBox: TListBox);
  end;

implementation

uses DR_DataModule1;

{$R *.DFM}

{ TDfmBackupDestination }

//构造函数======================================================================

constructor TDR_DfmBackupDestination.Create(Owner: TComponent;
  ADestinationListBox: TListBox);
begin
  inherited Create(Owner);
  DestinationListBox := ADestinationListBox;
end;

//窗体==========================================================================

procedure TDR_DfmBackupDestination.FormShow(Sender: TObject);
begin
  AddDeviceIdentify := False;
  with DR_DfmDataModule1.BackupDeviceADOQuery do
  begin
    Close;
    Sql.Clear;
    Sql.Add('Select * From sysdevices where cntrltype=2');
    try
      open;
    except
      ShowMessage('error');
      Exit;
    end;
  end;
  while not DR_DfmDataModule1.BackupDeviceADOQuery.Eof do
  begin
    DestinationComboBox.Items.Add(DR_DfmDataModule1.BackupDeviceADOQuery.FieldByName('name').AsString);
    DR_DfmDataModule1.BackupDeviceADOQuery.Next;
  end;
  DestinationComboBox.ItemIndex := 0;
end;

//关闭==========================================================================

procedure TDR_DfmBackupDestination.Button2Click(Sender: TObject);
begin
  DR_DfmDataModule1.BackupDeviceADOQuery.Close;
  Close;
end;

//添加备份设备==================================================================

procedure TDR_DfmBackupDestination.Button1Click(Sender: TObject);
begin
  if DestinationListBox.Items.Count <> 0 then
    Exit;
  DestinationListBox.Items.Add(DestinationComboBox.Text);
  AddDeviceIdentify := True;
  DR_DfmDataModule1.BackupDeviceContentADOQuery.Close;
  Close;
end;

end.

⌨️ 快捷键说明

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