起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 167|回复: 6

【搞定】如何在登录协同前弹出对话框提示?**

[复制链接]
发表于 2007-6-23 12:46:30 | 显示全部楼层 |阅读模式
要在出现
用户/密码框并输入完可以登录协同后,弹出一个提示框,提示点东西。

要修改协同系统的哪里的代码?
我的版本是2800

谢谢
回复

使用道具 举报

发表于 2007-6-23 14:25:59 | 显示全部楼层
可以在主界面上放一个timer控件,在控件的ontimer事件实现。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-6-23 15:48:35 | 显示全部楼层
?不明白...
这跟timer有关系吗? 确实是这样的话,能否说得具体些?

我是想协同登录框输入密码后,出现个提示(比如显示“请注意上报时间”),用户点击[确定]后,再出现工作台。
回复 支持 反对

使用道具 举报

发表于 2007-6-23 15:49:34 | 显示全部楼层
如果是登录前显示,可以修改当前界面方案中的 登录窗体。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-6-23 17:18:55 | 显示全部楼层
找不到界面方案,我是2800版本的,能不能再看看?

我不是要登录前提示,而是输入密码和用户名, 在[点登录后----工作台出现]这期间提示。
回复 支持 反对

使用道具 举报

发表于 2007-6-25 14:34:22 | 显示全部楼层
在 系统空间\系统运行库\系统初始化
static function TINIT.InternalLogon(AParam: String): Boolean;
const
  MaxLogonFailCount = 3;
  LogonErrorMsg01 = '登录失败';
  LogonErrorMsg02 = '用户不存在或者密码错误,请注意大小写,密码是区分大小写的。';
  LogonErrorMsg03 = '对不起,您已经 %d 次登录失败,将退出系统。';
var
  I: Integer;
  lAccept: Boolean;
  sUser, sPass, lAccountID, lUserID, lMessage: String;
  lIniFile: TIniFile;
  lIniFileName: String;
  lPerson: Org.TPerson;
  lLogonPerson: Org.TPersonMember;
begin
  if not FInternalDisableAutoLogon then
  begin
    if UseAD and LoginUseAD then
    begin
      Result := True;
      Exit;
    end;

    if AParam <> '' then
    begin
      Result := TAutoLogon.AutoLogon(AParam, lUserID, lMessage, lAccountID);
      if not Result then
      begin
        Dialogs.MessageDlg(lMessage, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK] , 0);
        Exit;
      end;
      BizSys.BizSystem.ClientAccount := lAccountID;
      if not SysUtils.SameText(lUserID, 'System') then
      begin
        lPerson := Org.OrgSys.OrgSystem.FindPerson(lUserID);
        Result := (not Opr.IsSystemManager(lUserID) or ExtUtils.ClientAccountExist(BizSys.BizSystem.ClientAccount)) and
              TSystemCore.Logon(lPerson.LoginID, lPerson.Password);
      end else begin
        Result := TSystemCore.Logon(lUserID, ExtUtils.ReadUserSysMngerPassWord);
      end;
      Exit;
    end;
  end;
  lIniFileName := jsCommon.ModulePath + 'Business.ini';

  lIniFile := TIniFile.Create(lIniFileName);
  try
    sUser := lIniFile.ReadString('System', 'LastLogonUserID', '');
    sPass := '';
    I := MaxLogonFailCount;
    repeat
      if I <> MaxLogonFailCount then
        Dialogs.MessageDlg(LogonErrorMsg02, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK] , 0);

      { 旧调用模式
      lAccept := TSystemCore.SystemInterface.ShowLogonForm(sUser, sPass);}
      lAccept := TSystemCore.SystemInterface.ShowLogonFormEx(sUser, sPass, lLogonPerson);

      if not lAccept then Break;

      // IE嵌入登陆 sUser的返回可以为空(这个方案不好,为了做嵌入IE登陆)
      if sUser <>  '' then
      begin
        lAccountID := sUser;
        lUserID := JSCommon.SplitStr('@', lAccountID);
        BizSys.BizSystem.ClientAccount := lAccountID;

        Result := (not Opr.IsSystemManager(lUserID) or ExtUtils.ClientAccountExist(BizSys.BizSystem.ClientAccount)) and
          TSystemCore.LogonEx(lUserID, sPass, lLogonPerson);
      end
      else
        Result := True;

      if Result then Break;
      Dec(I);
    until I = 0;
    if Result then
      try
        //这里登陆成功
        lIniFile.WriteString('System', 'LastLogonUserID', sUser);
      except

      end
    else
      if lAccept then
        Dialogs.MessageDlg(SysUtils.Format(LogonErrorMsg03, [MaxLogonFailCount]),
          TMsgDlgType.mtError, [TMsgDlgBtn.mbOK] , 0);
  finally
    lIniFile.Free;
  end;
end;
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-6-26 09:41:39 | 显示全部楼层
3x 可以结贴了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-6-22 19:44 , Processed in 0.050046 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表