📄 u_ipyhcx.pas
字号:
unit U_IPYHCX;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, DBTables, Grids, DBGridEh, ExtCtrls, StdCtrls, ComCtrls,
Buttons;
type
TIPYHCX = class(TForm)
QueryIPYH: TQuery;
DataSource1: TDataSource;
DBGridEh1: TDBGridEh;
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label10: TLabel;
Label3: TLabel;
YHDM: TEdit;
YHM: TEdit;
SFZH: TEdit;
DZ: TEdit;
LXFS: TEdit;
MAC: TEdit;
IP: TEdit;
YZBZ: TEdit;
CheckBox1: TCheckBox;
RQ1: TDateTimePicker;
RQ2: TDateTimePicker;
Shape1: TShape;
YHZT: TComboBox;
BitBtn1: TBitBtn;
BitBtn3: TBitBtn;
YHDM2: TEdit;
procedure BitBtn1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure DBGridEh1DblClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
IPYHCX: TIPYHCX;
implementation
{$R *.dfm}
procedure TIPYHCX.BitBtn1Click(Sender: TObject);
begin
QueryIPYH.Close;
While QueryIPYH.SQL.Count>1 Do QueryIPYH.SQL.Delete(1);
If YHDM.Text<>'' Then QueryIPYH.SQL.Add('And 用户代码>='+#39+YHDM.Text+#39);
If YHDM2.Text<>'' Then QueryIPYH.SQL.Add('And 用户代码<='+#39+YHDM2.Text+#39);
If YHM.Text<>'' Then QueryIPYH.SQL.Add('And 用户姓名 Like '+#39+YHM.Text+'%'+#39);
If SFZH.Text<>'' Then QueryIPYH.SQL.Add('And 身份证号 Like '+#39+SFZH.Text+'%'+#39);
If DZ.Text<>'' Then QueryIPYH.SQL.Add('And 地址 Like '+#39+DZ.Text+'%'+#39);
If LXFS.Text<>'' Then QueryIPYH.SQL.Add('And 联系方式 Like '+#39+LXFS.Text+'%'+#39);
If Mac.Text<>'' Then QueryIPYH.SQL.Add('And Mac地址='+QuotedStr(Mac.Text));
If IP.Text<>'' Then QueryIPYH.SQL.Add('And IP地址='+QuotedStr(IP.Text));
If CheckBox1.Checked Then
Begin
QueryIPYH.SQL.Add('And To_Char(安装日期,''YYYY-MM-DD'')>='+QuotedStr(FormatDateTime('YYYY-MM-DD',RQ1.Date)));
QueryIPYH.SQL.Add('And To_Char(安装日期,''YYYY-MM-DD'')<='+QuotedStr(FormatDateTime('YYYY-MM-DD',RQ2.Date)));
End;
If YHZT.Text<>'' Then QueryIPYH.SQL.Add('And 用户状态='+QuotedStr(YHZT.Text));
If CheckBox1.Checked Then QueryIPYH.SQL.Add('Order By 安装日期');
QueryIPYH.Open;
end;
procedure TIPYHCX.FormShow(Sender: TObject);
begin
RQ1.Date:=Date-30;
RQ2.Date:=Date;
YHM.SetFocus;
end;
procedure TIPYHCX.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
If Key=VK_Return Then SelectNext(ActiveControl,True,True);
end;
procedure TIPYHCX.DBGridEh1DblClick(Sender: TObject);
begin
If QueryIPYH.Active Then
If QueryIPYH.FieldByName('ID').AsInteger>0 THen
ModalResult:=mrOK;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -