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

📄 unit1.pas

📁 药房管理程序实现药房的基本管理功能
💻 PAS
字号:
unit Unit1;

interface

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

type
  TLogin_form = class(TForm)
    Image1: TImage;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    yhm_ledit: TEdit;
    mm_ledit: TEdit;
    comok: TButton;
    cmdclose: TButton;
    ADOConnection1: TADOConnection;
    ADOTable1: TADOTable;
    ADOQuery1: TADOQuery;
    Image2: TImage;
    procedure comokClick(Sender: TObject);
    procedure cmdcloseClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Login_form: TLogin_form;

implementation

uses Unit2;

{$R *.dfm}

procedure TLogin_form.comokClick(Sender: TObject);

var username,password:string;
begin
  if yhm_ledit.Text=''then
     messagebox(Login_form.handle,'请输入用户名','系统提示',mb_ok+mb_iconwarning)
  else
     if mm_ledit.Text=''then
        messagebox(Login_form.handle,'请输入密码','系统提示',mb_ok+mb_iconwarning)
  else
   begin
   username:=yhm_ledit.Text;
   password:=mm_ledit.Text;
  with ADOQuery1 do
      begin
        close;
        sql.Clear;
        sql.Add('select * from 系统用户 where 编号=');
        sql.add(''''+username+''''+'and 口令='+''''+password+'''');
        open;
        first;
        if recordcount=1 then
           begin
            //Login.Hide;
            form2.Show;
           end
        else
           messagebox(Login_form.handle,'你的密码错误,请重新登录','系统提示',mb_ok+mb_iconwarning);
        end;
  end;
end;

procedure TLogin_form.cmdcloseClick(Sender: TObject);
begin
  close
end;

end.

⌨️ 快捷键说明

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