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

📄 yidongcx.~pas

📁 这是用Delphi编写的车辆管理系统。主要功能有档案管理
💻 ~PAS
字号:
unit yidongCX;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls, Grids, DBGrids;

type
  TcaryidongCX = class(TForm)
    Label1: TLabel;
    DBGrid1: TDBGrid;
    GroupBox1: TGroupBox;
    CheckBox1: TCheckBox;
    ComboBox1: TComboBox;
    DateTimePicker1: TDateTimePicker;
    ComboBox4: TComboBox;
    CheckBox2: TCheckBox;
    procedure FormShow(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  caryidongCX: TcaryidongCX;

implementation

uses Unit2;

{$R *.dfm}

procedure TcaryidongCX.FormShow(Sender: TObject);
begin
combobox1.Items.Clear;
with datamodule2.CarclassQ  do
begin
    close;
    sql.Clear;
    sql.Add('select * from caryidong.dbf');
    open;
     while not eof do
      begin
      combobox1.Items.Add(fieldbyname('carnum').AsString);
      next;
      end;
     first;
end;
combobox1.ItemIndex:=0;
end;

procedure TcaryidongCX.CheckBox1Click(Sender: TObject);
begin
if checkbox1.Checked then
  begin
     datetimepicker1.Enabled:=false;
        combobox4.Enabled:=false;
        combobox1.Enabled:=true;
     if checkbox2.Checked then
         begin
         datetimepicker1.Enabled:=true;
         combobox4.Enabled:=true;
         with datamodule2.CarclassQ  do
         begin
          close;
          sql.Clear;
          if combobox4.Text='之前' then
          sql.Add('select * from caryidong.dbf where yidongdt < :bdate and carnum like :can');
          if combobox4.Text='当天' then
          sql.Add('select * from caryidong.dbf where yidongdt = :bdate and carnum like :can');
          if combobox4.Text='之后' then
          sql.Add('select * from caryidong.dbf where yidongdt > :bdate and carnum like :can');
          parambyname('bdate').AsDate:=datetimepicker1.Date;
          parambyname('can').AsString:=combobox1.Text+'%';
          open;
          end;

         end
          else
           begin
         with datamodule2.CarclassQ  do
         begin
          close;
          sql.Clear;
          sql.Add('select * from caryidong.dbf where  carnum like :can');
          parambyname('can').AsString:=combobox1.Text+'%';
          open;
          end;
         end;
    end
  else
     if checkbox2.Checked then
        begin
        datetimepicker1.Enabled:=true;
        combobox4.Enabled:=true;
        combobox1.Enabled:=false;
        with datamodule2.CarclassQ  do
        begin
         close;
          sql.Clear;
          if combobox4.Text='之前' then
          sql.Add('select * from caryidong.dbf where yidongdt < :bdate');
          if combobox4.Text='当天' then
          sql.Add('select * from caryidong.dbf where yidongdt = :bdate');
          if combobox4.Text='之后' then
          sql.Add('select * from caryidong.dbf where yidongdt > :bdate');
          parambyname('bdate').AsDate:=datetimepicker1.Date;
          open;
          end;
      end
      else
        begin
        datetimepicker1.Enabled:=false;
        combobox4.Enabled:=false;
        combobox1.Enabled:=false;
        caryidongcx.FormShow(sender);
        end;


end;

end.

⌨️ 快捷键说明

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