Unit2.~pas
资源名称:HIS.rar [点击查看]
上传用户:fjdqny
上传日期:2016-10-26
资源大小:6299k
文件大小:2k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit Unit2;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, DB, ADODB;
- type
- TForm2 = class(TForm)
- Label1: TLabel;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Edit1: TEdit;
- Edit2: TEdit;
- Edit3: TEdit;
- Edit4: TEdit;
- Button1: TButton;
- Button2: TButton;
- ADOConnection1: TADOConnection;
- ADOQuery1: TADOQuery;
- DataSource1: TDataSource;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form2: TForm2;
- Patno,Pat,Sex,Birth,Nation,Dep,Gua:Char;
- implementation
- {$R *.dfm}
- procedure TForm2.Button1Click(Sender: TObject);
- begin
- if (Edit1.Text<>'') and (Edit2.text<>'')and (Edit4.text<>'') then
- begin
- // adoquery1.Open;
- adoquery1.SQL.Clear;
- adoquery1.SQL.Add('insert into bingren(Patno,Pat,Sex,Birth,Nation,Dep,Gua) values(:Patno,:Pat,:Sex,:Birth,:Nation,:Dep,:Gua)');
- adoquery1.Parameters.ParamByName('Patno').Value:=Edit1.Text;
- adoquery1.Parameters.ParamByName('Pat').Value:=Edit2.Text;
- adoquery1.Parameters.ParamByName('Sex').Value:='';
- adoquery1.Parameters.ParamByName('Birth').Value:='';
- adoquery1.Parameters.ParamByName('Nation').Value:='';
- adoquery1.Parameters.ParamByName('Dep').Value:=Edit3.Text;
- adoquery1.Parameters.ParamByName('Gua').Value:=strtoint(Edit4.Text);
- adoquery1.ExecSQL;
- edit1.Clear;edit2.Clear;edit3.clear;edit4.clear;
- showmessage('已经挂号!');
- end
- else
- if (Edit1.Text='') then
- showmessage('请输入病人编号!')
- else
- if (Edit2.Text='') then
- showmessage('请输入病人姓名!')
- else
- if (Edit4.Text='') then
- showmessage('请输入挂号费!');
- end;
- procedure TForm2.Button2Click(Sender: TObject);
- begin
- form2.Close;
- end;
- end.