Changeset 34 for trunk/Application


Ignore:
Timestamp:
Nov 24, 2011, 2:06:10 PM (13 years ago)
Author:
chronos
Message:
  • Modified: Report loading is now done by TChronisClient.
Location:
trunk/Application
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Clients/UChronisClientMySQL.pas

    r33 r34  
    6161      Filter := '';
    6262      for I := 0 to AList.ColumnsFilter.Count - 1 do
    63         Filter := Filter + AList.ColumnsFilter[I] + ',';
    64       Delete(Filter, Length(Filter), 1);
     63        Filter := Filter + '`' + AList.ColumnsFilter[I] + '`, ';
     64      Delete(Filter, Length(Filter) - 1, 2);
    6565    end else Filter := '*';
    6666    if AList.ConditionUse then Condition := '`' + AList.ConditionColumn + '` = "' +
    6767      AList.ConditionValue + '"'
    6868      else Condition := '1';
    69     Database.Select(DbRows, AList.ObjectName, Filter, Condition);
     69    Database.Query(DbRows, 'SELECT ' + Filter + ' FROM `' + AList.SchemaName + '`.`' +
     70      AList.ObjectName + '` WHERE ' + Condition);
    7071    AList.Objects.Clear;
    71     for I := 0 to DbRows.Count - 1 do
     72    for I := 0 to DbRows.Count - 1 do begin
    7273      NewObject := TObjectProxy.Create;
    7374      NewObject.Client := AList.Client;
    7475      NewObject.Properties.Assign(TDictionaryStringString(DbRows[I]));
    7576      AList.Objects.Add(NewObject);
     77    end;
    7678  finally
    7779    DbRows.Free;
  • trunk/Application/UChronisClient.pas

    r33 r34  
    4343    ConditionUse: Boolean;
    4444    ObjectName: string;
     45    SchemaName: string;
    4546    Objects: TListObject; // TListObject<TObjectProxy>
     47    procedure SetCondition(ColumnName: string; Value: string);
    4648    procedure Clear;
    4749    constructor Create;
     
    105107{ TListProxy }
    106108
     109procedure TListProxy.SetCondition(ColumnName: string; Value: string);
     110begin
     111  ConditionColumn := ColumnName;
     112  ConditionValue := Value;
     113  ConditionUse := True;
     114end;
     115
    107116procedure TListProxy.Clear;
    108117begin
Note: See TracChangeset for help on using the changeset viewer.