Unit26.pas
资源名称:HIS.rar [点击查看]
上传用户:fjdqny
上传日期:2016-10-26
资源大小:6299k
文件大小:1k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit Unit26;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, DB, ADODB, Grids, DBGrids, StdCtrls, ComCtrls;
- type
- TForm26 = class(TForm)
- PageControl1: TPageControl;
- TabSheet1: TTabSheet;
- Label1: TLabel;
- Edit1: TEdit;
- Button1: TButton;
- Button2: TButton;
- DBGrid1: TDBGrid;
- ADOConnection1: TADOConnection;
- ADOQuery1: TADOQuery;
- DataSource1: TDataSource;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form26: TForm26;
- Query : TADOQuery;
- aaa,bbb:Char;
- implementation
- {$R *.dfm}
- procedure TForm26.Button1Click(Sender: TObject);
- begin
- if (Edit1.Text<>'') then
- begin
- Query := TADOQuery.Create(nil);
- Query.Connection :=ADOConnection1;
- Query.SQL.Add('select Patno from zhuyuanbingren where Patno =:aaa');
- Query.Parameters.ParamByName('aaa').Value :=edit1.Text;
- Query.Open;
- if Query.RecordCount =0 then //非0表示存在,0表示不存在
- showmessage('此病人信息不存在!')
- else
- begin
- adoquery1.Close;
- adoquery1.SQL.Clear;
- adoquery1.SQL.Add('select Patno,Entime,Extime,Fore,Bedno from zhuyuanbingren where Patno='''+edit1.Text+'''');
- adoquery1.Open;
- end
- end
- else
- showmessage('请输入病人编号!');
- end;
- procedure TForm26.Button2Click(Sender: TObject);
- begin
- form26.Close;
- end;
- end.