if mycom.fuwubool then
begin
frmdenglu:=tfrmdenglu.Create(application);
frmdenglu.ShowModal;
if mycom.denglubool then
begin
Application.CreateForm(TFrmmain, Frmmain);
Application.Run;
end;
end
if assigned(frmdenglu) then FreeAndNil(frmdenglu);
if assigned(frmfuwu) then freeAndNil(frmfuwu);
class function TfrmLogin.Execute:Boolean;
begin
with TfrmLogin.Create(Application) do ShowModal;
Result := IsLogined;
end;
procedure TfrmLogin.Button1Click(Sender: TObject);
begin
Inc(FLoginTimes);
With frmMain.ADOQuery do
begin
try
SQL.Clear;
SQL.Add(Format(SGetPassWordSQL,[cmbUserName.text]));
Open;
if RecordCount = 0 then
begin
MessageBox(Handle,Pchar(SInvalidUserName),Pchar(Application.Title),
MB_OK or MB_ICONSTOP);
exit;
end;
if edtPassword.Text = Fields.FieldByName('UserPassword').AsString then
begin
IsLogined := True;
strUserName := cmbUserName.text;
Self.Close;
exit;
end;
finally
Close;
end;
end;
if FLoginTimes = 3 then
begin
MessageBox(Handle,Pchar(S3Times),PChar(Application.Title),MB_OK or MB_ICONSTOP);
Self.Close;
end
else begin
MessageBox(Handle,Pchar(SInvalidPassword),Pchar(Application.Title),MB_OK or MB_ICONSTOP);
EdtPassword.SetFocus;
EdtPassword.SelectAll;
end;
end;
uses
Forms,
MAIN in 'MAIN.pas' {Frmmain},
DENGLU in 'DENGLU.pas' {Frmdenglu},
FUWU in 'FUWU.pas' {Frmfuwu},
MYCOM in 'MYCOM.pas',
LOGO in 'LOGO.pas' {FRMLOGO};
{$R *.res}
begin
Application.Initialize;
Application.Title := '房屋中介管理系统';
frmfuwu:=tfrmfuwu.Create(application);
frmfuwu.ShowModal;
frmfuwu.Update;
if mycom.fuwubool=TRUE then
begin
frmdenglu:=tfrmdenglu.Create(application);
frmdenglu.ShowModal;
frmdenglu.Update;
if mycom.denglubool=TRUE then
begin
Application.CreateForm(TFrmmain, Frmmain);
Application.Run;
end;
end
else
application.Terminate;