⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.pas

📁 用Delphi开发的医院管理系统
💻 PAS
字号:
unit login;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DB, ADODB;

type
    TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    ComboBox1: TComboBox;
    ADOConnection1: TADOConnection;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses register, basicInfo, surgery, internal, ophthalmology, gynecology,
  leukorrhea, ENTdepartment, Bchao, cardiogram, Xray, urine, blood;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  ADOConnection1.Close;
  Application.Terminate;
end;

procedure TForm1.Button2Click(Sender: TObject);
  var
      cnnString:string;
      subject:integer;
      flag:word;
  begin
    if (edit1.text='')or(edit2.Text='')or(combobox1.text='')or(edit3.Text='')or(edit4.Text='') then
      begin
        showmessage('请完成全部选项!');
        exit;
      end;
    flag:=0;
    subject:=ComboBox1.ItemIndex;
    cnnString:='Provider=SQLOLEDB.1;Password='+trim(Edit4.Text)+';Persist Security Info=True;User ID='+trim(Edit3.Text)+';Initial Catalog='+trim(Edit2.Text)+';'+'Data Source='+trim(Edit1.Text);
    ADOConnection1.ConnectionString:=cnnString;
    ADOConnection1.LoginPrompt:=False;
    try
      ADOConnection1.Connected:=True;
    except
      ADOConnection1.Close;
      flag:=MessageDlg('数据库连接失败!请检查数据库连接!',mtWarning,[mbOk],0);
      Edit3.Clear;
      Edit4.Clear;
    end;
    if flag<>0 then
      begin
        ADOConnection1.close;
        exit;
      end;
    ADOConnection1.close;
    case subject of
        0:Form2.Show;
        1:Form3.Show;
        2:Form4.Show;
        3:Form5.Show;
        4:Form6.Show;
        5:Form7.Show;
        6:Form8.Show;
        7:Form9.Show;
        8:Form10.Show;
        9:Form11.Show;
        10:Form12.Show;
        11:Form13.Show;
        12:Form14.Show;
      end;
    Edit3.Clear;
    Edit4.Clear;
    Hide;
  end;
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -