【delphi开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了delphi开源代码-Flog.pas的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
unit Flog;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Buttons, jpeg;
type
TF_log = class(TForm)
Image1: TImage;
Edit1: TEdit;
Edit2: TEdit;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure FormShow(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure Edit2KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
F_log: TF_log;
i:integer;
implementation
uses Fzct, Fdm;
{$R *.dfm}
procedure TF_log.FormKeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then
perform(WM_NEXTDLGCTL,0,0);
end;
procedure TF_log.FormShow(Sender: TObject);
begin
F_log.Left:=round(screen.Width/2)-round(F_log.Width/2);
F_log.top:=round(screen.Height/2)-round(188/2);
AnimateWindow(Self.Handle,500,AW_VER_NEGATIVE);
end;
procedure TF_log.SpeedButton2Click(Sender: TObject);
begin
Application.Terminate;
end;
procedure TF_log.SpeedButton1Click(Sender: TObject);
begin
F_zct.StatusBar1.Panels[2].Text:=datetostr(date);
with F_dm.users do
begin
Close;
SQL.Clear;
SQL.Add('select * from tb_power');
Open;
if RecordCount=0 then
begin
Application.MessageBox('进入
系统后请设置你的全部权限','提示',mb_ok);
F_zct.StatusBar1.Panels[1].Text:='第一用户,请添加自己为用户并设置所有权限';
self.Close;
Exit;
end;
Close;
SQL.Clear;
SQL.Add('select * from tb_power where users=:users and password=:pass
word' );
Parameters.ParamByName('users').Value:=Trim(Edit1.Text);
Parameters.ParamByName('password').Value:=Trim(Edit2.Text);
Open
end;
if F_dm.users.RecordCount=0 then
Application.MessageBox('用户名或密码不正确,请重新输入','提示', MB_ICONSTOP)
else
begin
if F_dm.users.FieldByName('stock').Value=False then
begin
F_zct.Action1.Visible:=False;
F_zct.Action46.Visible:=False;
F_zct.Action2.Enabled:=False;
end;
if F_dm.users.FieldByName('vendition').Value=False then
begin
F_zct.Action4.Visible:=False;
F_zct.Action46.Visible:=False;
F_zct.Action5.Enabled:=False;
end;
if F_dm.users.FieldByName('checked').Value=False then
begin
F_zct.Action7.Visible:=False;
F_zct.Action9.Enabled:=False;
F_zct.Action53.Enabled:=False;
end;
if F_dm.users.FieldByName('money').Value=False then
begin
F_zct.Action10.Visible:=False;
F_zct.Action21.Visible:=False;
F_zct.Action25.Enabled:=False;
end;
if F_dm.users.FieldByName('system').Value=False then
begin
F_zct.Action26.Visible:=False;
F_zct.Action27.Enabled:=False;
F_zct.Action29.Enabled:=False;
end;
if F_dm.users.FieldByName('base').Value=False then
F_zct.Action15.Visible:=False;
F_zct.StatusBar1.Panels[1].Text:='操作员:'+F_dm.users.Fields[1].Value;
Close;
end;
end;
procedure TF_log.Edit2KeyPress(Sender: TObject; var Key: Char);
begin
if (Key=#13) and (Edit1.Text<>'') and (Edit2.Text<>'') then
SpeedButton1.Click;
end;
end.