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

📄 login.~pas

📁 这是一个用Delphi写的工资管理系统
💻 ~PAS
字号:
unit login;

interface

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

type
  Tlogin_form = class(TForm)
    Image1: TImage;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  login_form: Tlogin_form;

implementation
   uses data, main_form;
{$R *.dfm}

procedure Tlogin_form.SpeedButton2Click(Sender: TObject);
begin
close;
end;

procedure Tlogin_form.SpeedButton1Click(Sender: TObject);
begin
try
with mydm.userQuery do
begin
Close;
SQL.Clear;
SQL.Add('select*from users where user_name=:p and user_password = :a');
Parameters[0].Value:=Trim(Edit1.Text);
Parameters[1].Value:=Trim(Edit2.Text);
Open;
End;
If mydm.userquery.RecordCount>0 then
Begin
if Trim(mydm.userQuery.fields[1].AsString)='浏览者' then//判断权限
begin
//F_customer.Panel1.Visible:=False;
//F_main.SpeedButton12.Enabled:=False;
//F_insurant.panel1.Visible:=False;
//F_bene.Panel1.Visible:=False;
//F_base.Panel1.Visible:=False;
//F_user.Panel1.Visible:=False;
//F_bill.Panel1.Visible:=False;
end
else
begin
//F_customer.Panel1.Visible:=True;
//F_main.SpeedButton12.Enabled:=True;
//F_insurant.panel1.Visible:=True;
//F_bene.Panel1.Visible:=True;
//F_base.Panel1.Visible:=True;
//F_user.Panel1.Visible:=True;
//F_bill.Panel1.Visible:=True;
end;
Edit1.Clear;
edit2.Clear;
Login_form.Hide;
main.Show;

end
else
begin
Application.MessageBox('密码不正确。','提示',64);
Edit1.Clear;
edit2.Clear;
Edit1.SetFocus;
end;
except
Application.MessageBox('系统出错。','提示',64);
end;
end;

end.

⌨️ 快捷键说明

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