hospital.~pas
资源名称:HIS.rar [点击查看]
上传用户:fjdqny
上传日期:2016-10-26
资源大小:6299k
文件大小:5k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit hospital;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, Menus, ComCtrls, ToolWin, ExtCtrls, StdCtrls, Buttons, DB, ADODB;
- type
- TForm1 = class(TForm)
- Image1: TImage;
- Label1: TLabel;
- Edit1: TEdit;
- Label2: TLabel;
- Label3: TLabel;
- Edit2: TEdit;
- Button2: TButton;
- Button3: TButton;
- ADOConnection1: TADOConnection;
- ADOQuery1: TADOQuery;
- DataSource1: TDataSource;
- procedure N5Click(Sender: TObject);
- procedure N6Click(Sender: TObject);
- procedure N21Click(Sender: TObject);
- procedure N22Click(Sender: TObject);
- procedure N23Click(Sender: TObject);
- procedure N24Click(Sender: TObject);
- procedure N8Click(Sender: TObject);
- procedure N10Click(Sender: TObject);
- procedure N26Click(Sender: TObject);
- procedure N27Click(Sender: TObject);
- procedure N16Click(Sender: TObject);
- procedure N35Click(Sender: TObject);
- procedure N36Click(Sender: TObject);
- procedure N15Click(Sender: TObject);
- procedure N29Click(Sender: TObject);
- procedure N30Click(Sender: TObject);
- procedure N31Click(Sender: TObject);
- procedure N33Click(Sender: TObject);
- procedure N34Click(Sender: TObject);
- procedure N20Click(Sender: TObject);
- procedure N19Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- Query : TADOQuery;
- implementation
- uses Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9, Unit10,
- Unit11, Unit12, Unit13, Unit14, Unit15, Unit16, Unit17, Unit18, Unit19,
- Unit20,ShellApi, Unit21;
- {$R *.dfm}
- procedure TForm1.N5Click(Sender: TObject);
- begin
- form2.show;
- end;
- procedure TForm1.N6Click(Sender: TObject);
- begin
- form3.show;
- end;
- procedure TForm1.N21Click(Sender: TObject);
- begin
- form4.show;
- end;
- procedure TForm1.N22Click(Sender: TObject);
- begin
- form5.show;
- end;
- procedure TForm1.N23Click(Sender: TObject);
- begin
- form6.show;
- end;
- procedure TForm1.N24Click(Sender: TObject);
- begin
- form7.show;
- end;
- procedure TForm1.N8Click(Sender: TObject);
- begin
- form8.show;
- end;
- procedure TForm1.N10Click(Sender: TObject);
- begin
- form9.show;
- end;
- procedure TForm1.N26Click(Sender: TObject);
- begin
- form10.show;
- end;
- procedure TForm1.N27Click(Sender: TObject);
- begin
- form11.show;
- end;
- procedure TForm1.N16Click(Sender: TObject);
- begin
- form12.show;
- end;
- procedure TForm1.N35Click(Sender: TObject);
- begin
- form13.show;
- end;
- procedure TForm1.N36Click(Sender: TObject);
- begin
- form14.show;
- end;
- procedure TForm1.N15Click(Sender: TObject);
- begin
- form15.show;
- end;
- procedure TForm1.N29Click(Sender: TObject);
- begin
- form16.show;
- end;
- procedure TForm1.N30Click(Sender: TObject);
- begin
- form17.show;
- end;
- procedure TForm1.N31Click(Sender: TObject);
- begin
- form18.show;
- end;
- procedure TForm1.N33Click(Sender: TObject);
- begin
- form19.show;
- end;
- procedure TForm1.N34Click(Sender: TObject);
- begin
- form20.show;
- end;
- procedure TForm1.N20Click(Sender: TObject);
- begin
- ShellExecute(0,'open','notepad.exe',nil,nil,sw_show);
- end;
- procedure TForm1.N19Click(Sender: TObject);
- begin
- ShellExecute(0,'open','calc.exe',nil,nil,sw_show);
- end;
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- form21.show;
- end;
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- if edit1.Text='' then
- showmessage('请输入用户名!')
- else
- try
- Query :=TADOQuery.Create(nil);
- Query.Connection :=ADOConnection1;
- Query.SQL.Add('select yonghu,mima from denglu where yonghu=:yonghu and mima =:mima'); Query.Parameters.ParamByName('yonghu').Value :=edit1.Text;
- Query.Parameters.ParamByName('mima').Value :=edit2.Text;
- Query.Open;
- if Query.RecordCount =0 then
- begin
- messageDlg('请输入正确的用户名和密码!',mterror,[mbok],0);
- exit;
- end
- else
- form1.Hide;
- form21.Show;
- query.Close;
- query.Free;
- except
- messageDlg('连接数据库出错!',mterror,[mbok],0)
- end;
- end;
- procedure TForm1.Button3Click(Sender: TObject);
- begin
- if application.MessageBox('您确实要取消登录吗?','退出',4)=6 then
- application.Terminate;
- end;
- procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- if application.MessageBox('您确实要取消登录吗?','退出',4)=6 then
- application.Terminate
- else
- exit;
- end;
- end.