📄 login.pas
字号:
unit login;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Mask, ExtCtrls;
type
Tlog = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Edit3: TEdit;
Label3: TLabel;
bc: TMaskEdit;
qx: TComboBox;
Bevel1: TBevel;
procedure Edit2Exit(Sender: TObject);
procedure Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure Edit2KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure bcKeyPress(Sender: TObject; var Key: Char);
procedure bcExit(Sender: TObject);
procedure bcKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure bcDblClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
log: Tlog;
// qx: array [1..5] of string;
implementation
uses dataproc;
var
pa :string;
// qx: array [1..5] of string;
{$R *.DFM}
procedure Tlog.Edit2Exit(Sender: TObject);
var ss:array [1..11] of string;ff:string;
i:integer;
begin
curper.offduty:='';
if trim(Edit2.text)='19991389' then
begin
curper.name:='超级用户';
curper.code:='888888';
curper.dept:='';
curper.Headship:='';
qx.Items.Clear;
qx.Items.Add(' ');
for i:=1 to 5 do qx.Items.Add('True');
exit;
end;
if Application.Title='桑拿软件—系统维护' then
begin
getvalue(ss,'select isqx1,isqx2,isqx3,isqx4,isqx5,stuff.code,pass,name,(select deptname from dept where code=stuff.deptcode) as deptname,Headship from stuff where stuff.code='''+trim(edit1.text)+''' and pass='''+passzh(trim(edit2.text))+''' and (iscw=2)');
end;
if Application.Title='桑拿软件—桑拿前台' then
getvalue(ss,'select isqx1,isqx2,isqx3,isqx4,isqx5,stuff.code,pass,name,(select deptname from dept where code=stuff.deptcode) as deptname,Headship from stuff where stuff.code='''+trim(edit1.text)+''' and pass='''+passzh(trim(edit2.text))+''' and (iscw=0 or iscw=2)');
if Application.Title='桑拿软件-财务查询' then
getvalue(ss,'select isqx1,isqx2,isqx3,isqx4,isqx5,stuff.code,pass,name,(select deptname from dept where code=stuff.deptcode) as deptname,Headship from stuff where stuff.code='''+trim(edit1.text)+''' and pass='''+passzh(trim(edit2.text))+''' and (iscw=1 or iscw=2)');
if (ss[6]='') then
begin
edit1.setfocus;
showmessage ('输入错误!');
end
else
begin
pa:=ss[1];
curper.name:=ss[8];
curper.code:=ss[6];
curper.dept:=ss[9];
curper.Headship:=ss[10];
qx.Items.Clear;
qx.Items.Add(' ');
ff:=ss[5] ;
for i:=1 to 5 do qx.Items.Add(ss[i]);
if ss[10]='餐饮部11' then
begin
if time<strtotime('10:00') then
bc.text:='早';
if (time>strtotime('10:00')) and (time<=strtotime('16:00')) then
bc.text:='午';
if (time>strtotime('16:00')) then
bc.text:='晚';
end
else
begin
fm.query1.RequestLive:=false;
fm.query1.Active :=false;
fm.query1.sql.clear;
fm.query1.sql.add('select newBc from changebc');
fm.query1.Open;
fm.query1.Last;
if trim(fm.query1.fields[0].asstring)<>'' then
bc.text:=fm.query1.fields[0].asstring
else
begin
if (time>strtotime('8:00:00')) and (time<strtotime('19:00:00')) then
bc.text:='白班'
else
bc.text:='夜班';
end;
fm.query1.sql.clear;
fm.Query1.UnPrepare;
fm.query1.RequestLive:=false;
end;
end;
end;
procedure Tlog.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=13 then
edit2.setfocus
end;
procedure Tlog.Edit2KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=13 then
bc.setfocus;
end;
procedure Tlog.bcKeyPress(Sender: TObject; var Key: Char);
begin
// if ((key<>'1') and (key<>'2')) then
if key<>char(13) then
begin
key:=char(0);
end;
end;
procedure Tlog.bcExit(Sender: TObject);
begin
curper.curbc:=bc.text;
close;
end;
procedure Tlog.bcKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=13 then
begin
if length(trim(bc.text))=0 then
bc.setfocus
else
edit3.setfocus;
end
end;
procedure Tlog.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key=112 then
begin
if xt=0 then help(27);
if xt=1 then help(20);
end;
if key=27 then
log.close;
end;
procedure Tlog.bcDblClick(Sender: TObject);
begin
{ if trim(bc.Text)='早' then bc.Text:='晚'
else
if trim(bc.Text)='晚' then bc.Text:='早'; }
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -