Unit24.pas
资源名称:HIS.rar [点击查看]
上传用户:fjdqny
上传日期:2016-10-26
资源大小:6299k
文件大小:5k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit Unit24;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ComCtrls, StdCtrls, DB, ADODB, Grids, DBGrids;
- type
- TForm24 = class(TForm)
- PageControl1: TPageControl;
- TabSheet1: TTabSheet;
- TabSheet2: TTabSheet;
- RadioButton1: TRadioButton;
- RadioButton2: TRadioButton;
- Label1: TLabel;
- Label2: TLabel;
- Edit1: TEdit;
- Edit2: TEdit;
- DataSource1: TDataSource;
- DBGrid1: TDBGrid;
- ADOQuery1: TADOQuery;
- ADOConnection1: TADOConnection;
- Button1: TButton;
- Button2: TButton;
- RadioButton3: TRadioButton;
- RadioButton4: TRadioButton;
- Label3: TLabel;
- Edit3: TEdit;
- Label4: TLabel;
- Edit4: TEdit;
- ADOQuery2: TADOQuery;
- DataSource2: TDataSource;
- Button3: TButton;
- Button4: TButton;
- DBGrid2: TDBGrid;
- procedure Button1Click(Sender: TObject);
- procedure RadioButton1Click(Sender: TObject);
- procedure RadioButton2Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- procedure RadioButton3Click(Sender: TObject);
- procedure RadioButton4Click(Sender: TObject);
- procedure Button4Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form24: TForm24;
- Query : TADOQuery;
- aaa,bbb:Char;
- implementation
- {$R *.dfm}
- procedure TForm24.Button1Click(Sender: TObject);
- begin
- if (RadioButton1.Checked=true) then
- begin
- Query := TADOQuery.Create(nil);
- Query.Connection :=ADOConnection1;
- Query.SQL.Add('select Patno from bingren 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,Pat,Dep,Gua from bingren where Patno='''+edit1.Text+'''');
- adoquery1.Open;
- end
- end
- else
- if(RadioButton2.Checked=true) then
- begin
- Query := TADOQuery.Create(nil);
- Query.Connection :=ADOConnection1;
- Query.SQL.Add('select Dep from bingren where Dep =:aaa');
- Query.Parameters.ParamByName('aaa').Value :=edit2.Text;
- Query.Open;
- if Query.RecordCount =0 then //非0表示存在,0表示不存在
- showmessage('病人信息不存在!')
- else
- begin
- adoquery1.Close;
- adoquery1.SQL.Clear;
- adoquery1.SQL.Add('select Patno,Pat,Dep,Gua from bingren where Dep='''+edit2.Text+'''');
- adoquery1.Open;
- end
- end
- else
- showmessage('请输入病人编号或科室!');
- end;
- procedure TForm24.RadioButton1Click(Sender: TObject);
- begin
- //RadioButton1.Checked:=true;
- //RadioButton2.Checked:=false;
- end;
- procedure TForm24.RadioButton2Click(Sender: TObject);
- begin
- //RadioButton2.Checked:=true;
- //RadioButton1.Checked:=false;
- end;
- procedure TForm24.Button2Click(Sender: TObject);
- begin
- form24.Close;
- end;
- procedure TForm24.Button3Click(Sender: TObject);
- begin
- if (RadioButton3.Checked=true) then
- begin
- Query := TADOQuery.Create(nil);
- Query.Connection :=ADOConnection1;
- Query.SQL.Add('select Chano from shoufeidan where Chano =:bbb');
- Query.Parameters.ParamByName('bbb').Value :=edit3.Text;
- Query.Open;
- if Query.RecordCount =0 then //非0表示存在,0表示不存在
- showmessage('收费单信息不存在!')
- else
- begin
- adoquery2.Close;
- adoquery2.SQL.Clear;
- adoquery2.SQL.Add('select Chano,Patno,Pat,Doc,Chaitem,Chasum from shoufeidan where Chano='''+edit3.Text+'''');
- adoquery2.Open;
- end
- end
- else
- if(RadioButton4.Checked=true) then
- begin
- Query := TADOQuery.Create(nil);
- Query.Connection :=ADOConnection1;
- Query.SQL.Add('select Patno from shoufeidan where Patno =:bbb');
- Query.Parameters.ParamByName('bbb').Value :=edit4.Text;
- Query.Open;
- if Query.RecordCount =0 then //非0表示存在,0表示不存在
- showmessage('病人编号不正确!')
- else
- begin
- adoquery2.Close;
- adoquery2.SQL.Clear;
- adoquery2.SQL.Add('select Chano,Patno,Pat,Doc,Chaitem,Chasum from shoufeidan where Patno='''+edit4.Text+'''');
- adoquery2.Open;
- end
- end
- else
- showmessage('请输入收费单号或病人编号!');
- end;
- procedure TForm24.RadioButton3Click(Sender: TObject);
- begin
- RadioButton3.Checked:=true;
- RadioButton4.Checked:=false;
- end;
- procedure TForm24.RadioButton4Click(Sender: TObject);
- begin
- RadioButton4.Checked:=true;
- RadioButton3.Checked:=false;
- end;
- procedure TForm24.Button4Click(Sender: TObject);
- begin
- form24.Close;
- end;
- end.