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

📄 reportcondition_unt.pas

📁 煤矿行业采掘接替计划自动生成系统
💻 PAS
字号:
unit ReportCondition_Unt;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, DB, ADODB, DBCtrls, ComCtrls;

type
  TReportCondition_Frm = class(TForm)
    Label1: TLabel;
    ADOQuery1: TADOQuery;
    BitBtn1: TBitBtn;
    ComboBox1: TComboBox;
    Label2: TLabel;
    DateTimePicker1: TDateTimePicker;
    procedure BitBtn1Click(Sender: TObject);
    procedure ComboBox1DropDown(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    SelectYear:integer;
    SelectBeginDate:integer;
  end;

var
  ReportCondition_Frm: TReportCondition_Frm;

implementation
uses Data_Unt;
{$R *.dfm}

procedure TReportCondition_Frm.BitBtn1Click(Sender: TObject);
var
i,j:integer;
InputYear,MinYear,MaxYear:integer;
begin
  if(Label1.Visible)and(ComboBox1.Visible)then
    begin
      if ComboBox1.Text='' then
        begin
          showmessage('请选择输出报表的年份!');
          exit;
        end;
      if ComboBox1.Items.Count=0 then
        begin
          showmessage('选择列表为空!');
          SelectYear:=-1;
          close;
          exit;
        end;
      MinYear:=strtoint(ComboBox1.Items[0]);
      MaxYear:=strtoint(ComboBox1.Items[0]);
      for i:=1 to ComboBox1.Items.Count-1 do
        begin
          j:=strtoint(ComboBox1.Items[i]);
          if j<MinYear then MinYear:=j;
          if j>MaxYear then MaxYear:=j;
        end;
      InputYear:=strtoint(ComboBox1.Text);
      if not ((InputYear<=MaxYear)and(InputYear>=MinYear))then
        begin
          showmessage('请从列表中选择,或者输入列表中出现的年份!');
          exit;
        end;
      SelectYear:=InputYear;
    end;
  if(Label2.Visible)and(DateTimePicker1.Visible)then
    begin                        
      SelectBeginDate:=trunc(DateTimePicker1.DateTime);
    end;
  close;
end;

procedure TReportCondition_Frm.ComboBox1DropDown(Sender: TObject);
begin
if ComboBox1.Items.Count=0 then
    begin
      showmessage('出现错误,选择列表为空!');
      exit;
    end;
end;

end.

⌨️ 快捷键说明

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