Jump to content

Title Application


picyka

Recommended Posts

8 minutes ago, picyka said:

Currently the title of the application is in the server module, that is, only one per application, would it be possible to change this per session?

Yes, you can use UnaMainModule.Title property.

  • Like 1
Link to comment
Share on other sites

13 minutes ago, Sherzod said:

Can you please explain in more details?

When I set the title on the login screen, after retrieving the user, it works fine, but there are users who have automatic login, passing a hash by the URL as a parameter, this case does not work

 

procedure TUniMainModule.UniGUIMainModuleBeforeLogin(Sender: TObject; var Handled: Boolean);
var
  aApp: TUniGUIApplication;
  lCliente: String;
begin
  Handled := False;
  aApp := (Sender as TUniGUISession).UniApplication;
  lCliente := aApp.Parameters.Values['u'];

  if not lCliente.IsEmpty then
  begin
    var lClientAuth := Self.ClientApiAuth;
    try
      try
        Self.TOKEN_API := lClientAuth.Service<IServiceLogin>.ValidaLoginHash(UpperCase(lCliente));
        Handled := (Self.TOKEN_API <> '');

        if Handled then
        begin
          UniMainModule.SetUserLogado(Self.GetClientApiApp.Service<IServiceUsuario>.FindUsuarioByHash(UpperCase(lCliente)));

          if Self.UserActive.Empresa <> nil then
            Self.Title := 'Assistência 24 HS - ' + UniMainModule.UserActive.Empresa.NomeFantasia;

          UniSession.UserString := UniMainModule.UserActive.Nome + ' - Mobile';
        end;

      except
        Handled := False;
      end;
    finally
      lClientAuth.Free;
    end;
  end;
end;

 

Link to comment
Share on other sites

2 minutes ago, picyka said:

n this case, it opens a form of the mobile, is that why?

I understand the general condition is true:

4 hours ago, picyka said:
        Handled := (Self.TOKEN_API <> '');

        if Handled then

 

But I'm not sure if this condition is true:

4 hours ago, picyka said:
if Self.UserActive.Empresa <> nil then

 

Link to comment
Share on other sites

1 minuto atrás, Sherzod disse:

Eu entendo que a condição geral é verdadeira:

Mas não sei se essa condição é verdadeira:

 

Look at the attached images, I debugged it here, the condition is true, if you want you can access it here...

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...