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

📄 untexportcondition.pas

📁 简要说明:对医院幼儿心理情况做的一个调查,统计系统.
💻 PAS
字号:
unit untExportCondition;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, untBaseDialog, StdCtrls, Buttons, ExtCtrls, Mask, DBCtrlsEh,
  DBLookupEh, DBCtrls, DB, ADODB, jpeg, fcButton, fcImgBtn, OleServer,
  Excel2000;

type
  TfrmExportCondition = class(TfrmBaseDialog)
    adsSchool: TADODataSet;
    adsClass: TADODataSet;
    dsSchool: TDataSource;
    dsClass: TDataSource;
    chkSchool: TCheckBox;
    chkClass: TCheckBox;
    cboSchool: TDBLookupComboBox;
    cboClass: TDBLookupComboboxEh;
    Label1: TLabel;
    rgType: TRadioGroup;
    procedure chkSchoolClick(Sender: TObject);
    procedure chkClassClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure adsSchoolAfterScroll(DataSet: TDataSet);
    procedure btnOKClick(Sender: TObject);
  private
    FSchoolID: Integer;
    FClassID: Integer;
    FDataType: Integer;
    { Private declarations }
  public
    { Public declarations }
    property SchoolID: Integer read FSchoolID write FSchoolID;
    property ClassID:  Integer read FClassID  write FClassID;
    property DataType: Integer read FDataType write FDataType;
  end;

var
  frmExportCondition: TfrmExportCondition;

implementation

uses untDM;

{$R *.dfm}

procedure TfrmExportCondition.chkSchoolClick(Sender: TObject);
begin
  inherited;
  cboschool.Enabled := TCheckBox(Sender).Checked;
end;

procedure TfrmExportCondition.chkClassClick(Sender: TObject);
begin
  inherited;
  cboClass.Enabled := TCheckBox(Sender).Checked;
end;

procedure TfrmExportCondition.FormShow(Sender: TObject);
begin
  inherited;
  with adsSchool do begin
    if Active then Active := False;
    Active := true;
  end;
end;

procedure TfrmExportCondition.adsSchoolAfterScroll(DataSet: TDataSet);
begin
  inherited;
  with adsClass do begin
    if Active then Active := false;
    Active := true;
    if Filtered then Filtered := false;
    Filter := 'SchoolID='+DataSet.FieldByName('iAutoID').AsString;
    Filtered := true;
  end;
end;

procedure TfrmExportCondition.btnOKClick(Sender: TObject);
begin
  inherited;
  if chkSchool.Checked then
  begin if cboSchool.Text<>'' then  FSchoolID := cboSchool.KeyValue  else FSchoolID := -1; end
  else FSchoolID := -1;
  if chkClass.Checked then
  begin  if  cboClass.Text<>'' then  FClassID := cboClass.KeyValue  else FClassID := -1; end
  else FClassID := -1;
  FDataType := rgType.ItemIndex;
  ModalResult := mrOk;
end;

end.

⌨️ 快捷键说明

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