📄 unit1_caizepeng042_04.pas
字号:
unit Unit1_caizepeng042_04;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, StdCtrls, jpeg, ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
Label3: TLabel;
ComboBox1: TComboBox;
Image2: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2_caizepeng042_04, supplier_caizepeng042_04,
in_master_caizepeng042_04, guanli_caizepeng042_04,
xiaoshou_caizepeng042_04, tj_caizepeng042_04, tj2_caizepeng042_04;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var username,password,quanxian:string;
begin
if edit1.Text='' then
messagebox(Form1.Handle,'请输入用户名','警告',mb_ok+mb_iconwarning)
else
if edit2.Text='' then
messagebox(form1.Handle,'请输入密码','警告',mb_ok+mb_iconwarning)
else
if combobox1.Text='' then
messagebox(form1.Handle,'请选择权限','警告',mb_ok+mb_iconwarning)
else
begin
username:=edit1.Text;
password:=edit2.Text;
quanxian:=combobox1.Text;
with ADOQuery1 do
begin
close;
sql.clear;
sql.add('select * from load_caizepeng042_04 where 姓名=');
sql.add(''''+username+''''+'and 密码='+''''+password+''''+'and 权限='+''''+quanxian+'''');
open;
first;
if recordcount=1 then
begin
close;
adoquery1.SQL.clear;
adoquery1.SQL.Add('insert into time_caizepeng042_04(姓名,登录时间) values('''+username+''',getdate())');
adoquery1.execsql;
Adoquery1.Close;
adoquery1.SQL.clear;
Adoquery1.SQL.text:='select max(登录时间) as 登录时间 from time_caizepeng042_04 where 姓名='''+edit1.text+'''';
Form1.Hide;
showmessage('欢迎您:'''+edit1.text+'''');
Form2.Show;
adoquery1.Open;
form2.edit1.text:=adoquery1.FieldByName('登录时间').AsString;
if form1.combobox1.text='普通用户' then
begin
Form3.button2.visible:=false;
Form3.button3.visible:=false;
Form3.button5.visible:=false;
form3.GroupBox3.Visible:=false;
form3.label8.Visible:=false;
form3.label9.Visible:=false;
form3.edit8.Visible:=false;
form3.edit9.Visible:=false;
form3.Button8.Visible:=false;
form3.button9.Visible:=false;
form3.Button10.Visible:=false;
form3.label30.Visible:=false;
form3.label31.Visible:=false;
form3.edit29.Visible:=false;
form3.edit30.Visible:=false;
form3.GroupBox5.Visible:=false;
form3.GroupBox11.Visible:=false;
form3.GroupBox14.Visible:=false;
form3.GroupBox8.Visible:=false;
form4.visible:=false;
form5.visible:=false;
form6.visible:=false;
form8.hide;
form9.visible:=false;
end;
end
else
messagebox(Form1.Handle,'请输入正确的密码与权限','警告',mb_ok+mb_iconwarning);
end;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
var f:word;
begin
f:=MessageDlg('确定要退出?',mtInformation,[mbYes,mbNo],0);
if f=6 then
close
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -