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

📄 vipcx.~pas

📁 图书影碟租赁管理系统
💻 ~PAS
字号:
unit vipcx;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls;

type
  TF_vipcx = class(TForm)
    cxGroup: TRadioGroup;
    GroupBox1: TGroupBox;
    Edit1: TEdit;
    b_cx: TBitBtn;
    b_exit: TBitBtn;
    procedure b_cxClick(Sender: TObject);
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
    procedure cxGroupClick(Sender: TObject);
    procedure b_exitClick(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  F_vipcx: TF_vipcx;

implementation

uses datam;

{$R *.dfm}

procedure TF_vipcx.b_cxClick(Sender: TObject);
var
  cxz:string;
begin
  if edit1.Text='' then
   begin
    Application.MessageBox(PChar('查询条件不能为空,请重新录入!'), PChar('提示'),
      MB_ICONEXCLAMATION);
    edit1.SetFocus();
    exit;
   end;
  cxz:=edit1.Text;
  case cxgroup.ItemIndex of
   0:begin
     if not dm.ADO_vip.Locate('证号',cxz,[]) then
      begin
       Application.MessageBox(PChar('没有符合条件的记录!'), PChar('提示'),
       MB_ICONEXCLAMATION);
       edit1.setfocus();
       exit;
      end;
     end;
   1:begin
      if not dm.ADO_vip.Locate('姓名',cxz,[]) then
      begin
       Application.MessageBox(PChar('没有符合条件的记录!'), PChar('提示'),
       MB_ICONEXCLAMATION);
       edit1.setfocus();
       exit;
      end;
     end;
   2:begin
      if not dm.ADO_vip.Locate('电话',cxz,[]) then
      begin
       Application.MessageBox(PChar('没有符合条件的记录!'), PChar('提示'),
       MB_ICONEXCLAMATION);
       edit1.setfocus();
       exit;
      end;
     end;
   3:begin
      if not dm.ADO_vip.Locate('地址',cxz,[]) then
      begin
       Application.MessageBox(PChar('没有符合条件的记录!'), PChar('提示'),
       MB_ICONEXCLAMATION);
       edit1.setfocus();
       exit;
      end;
     end;
   end;
  close;
end;

procedure TF_vipcx.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if cxgroup.ItemIndex=0 then
    if not ( Key in ['0'..'9',#13,#8]) then Key := #0;
    if key=#13 then
      begin
       b_cx.OnClick(b_cx);
      end;
end;

procedure TF_vipcx.cxGroupClick(Sender: TObject);
begin
 edit1.Text:='';
  edit1.SetFocus();
  if cxgroup.ItemIndex=0 then
   edit1.MaxLength:=5
  else
   edit1.MaxLength:=0;
end;

procedure TF_vipcx.b_exitClick(Sender: TObject);
begin
  close;
end;

procedure TF_vipcx.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  release;
end;

end.

⌨️ 快捷键说明

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