Ignore:
Timestamp:
Sep 9, 2022, 8:20:25 PM (2 years ago)
Author:
chronos
Message:
  • Modified: Removed TemplateGenerics package. Generics usage replaced by standard Generics.Collections.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/User/UUserControlPage.pas

    r137 r138  
    8787      AddNewAction('Přihlásit', 'Login');
    8888    end;
    89     if HandlerData.Request.Post.SearchKey('Login') <> -1 then begin
     89    if HandlerData.Request.Post.ContainsKey('Login') then begin
    9090      Form.Load(HandlerData.Request.Post);
    91       with THtmlString(SubItems.AddNew(THtmlString.Create)) do
     91      with SubItems.AddString do
    9292        Text := 'Přihlášení uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value;
    9393      UserId := ModuleUser.User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,
    9494        TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value);
    9595      if UserId = -1 then begin
    96         with THtmlString(SubItems.AddNew(THtmlString.Create)) do
     96        with SubItems.AddString do
    9797          Text := '<br/>Chybné jméno nebo heslo';
    9898      end else ModuleUser.UserOnline.Login(UserId);
    9999      Form.Free;
    100100    end else
    101       SubItems.AddNew(Form);
     101      SubItems.Add(Form);
    102102  end;
    103103end;
     
    144144      AddNewAction('Registrovat', 'Register');
    145145    end;
    146     if HandlerData.Request.Post.SearchKey('Register') <> -1 then
     146    if HandlerData.Request.Post.ContainsKey('Register') then
    147147    with HandlerData.Request do begin
    148148      Form.Load(HandlerData.Request.Post);
    149       with THtmlString(SubItems.AddNew(THtmlString.Create)) do
     149      with SubItems.AddString do
    150150        Text := 'Registrace uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value;
    151151      ModuleUser.User.Add(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,
     
    156156      if UserId <> -1 then ModuleUser.UserOnline.Login(UserId);
    157157      Form.Free;
    158     end else SubItems.AddNew(Form);
     158    end else SubItems.Add(Form);
    159159  end;
    160160end;
     
    164164  with TWebSession(HandlerData), Core, HtmlDocument.Body do begin
    165165    ModuleUser.UserOnline.Logout;
    166     with THtmlString(SubItems.AddNew(THtmlString.Create)) do
     166    with SubItems.AddString do
    167167      Text := 'Uživatel odhlášen';
    168168  end;
     
    213213      AddNewAction('Uložit', 'Save');
    214214    end;
    215     if HandlerData.Request.Post.SearchKey('Save') <> -1 then
     215    if HandlerData.Request.Post.ContainsKey('Save') then
    216216    with HandlerData.Request do begin
    217217      Form.Load(HandlerData.Request.Post);
    218       with THtmlString(SubItems.AddNew(THtmlString.Create)) do
     218      with SubItems.AddString do
    219219        Text := 'Profil uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value + ' uložen';
    220220      ModuleUser.User.Name := TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value;
     
    223223      ModuleUser.User.Save;
    224224      Form.Free;
    225     end else SubItems.AddNew(Form);
     225    end else SubItems.Add(Form);
    226226  end;
    227227end;
Note: See TracChangeset for help on using the changeset viewer.