Changeset 22 for trunk/UFioAPI.pas


Ignore:
Timestamp:
Mar 25, 2013, 11:47:38 PM (11 years ago)
Author:
chronos
Message:
  • Upraveno: Příprava pro zobrazování seznamu operací.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UFioAPI.pas

    r10 r22  
    66
    77uses
    8   Classes, SysUtils, httpsend, ssl_openssl;
     8  Classes, SysUtils, httpsend, ssl_openssl, dateutils;
    99
    1010type
     
    2323    function DownloadMonthly(Year, Id: Integer; Data: TStrings): Boolean;
    2424    function DownloadLast(Data: TStrings): Boolean;
     25    function SetLastId(Id: Integer): Boolean;
     26    function SetLastDate(Date: TDate): Boolean;
    2527  end;
    2628
     
    4648        100..299:
    4749          begin
    48             Data.LoadFromStream(HTTPSender.Document);
     50            if Assigned(Data) then
     51              Data.LoadFromStream(HTTPSender.Document);
    4952            Result := True;
    5053          end; //informational, success
     
    8588end;
    8689
     90function TFioAPI.SetLastId(Id: Integer): Boolean;
     91begin
     92  Result := Download('https://www.fio.cz/ib_api/rest/set-last-id/' + Token +
     93    '/' + IntToStr(Id), nil);
     94end;
     95
     96function TFioAPI.SetLastDate(Date: TDate): Boolean;
     97begin
     98  Result := Download('https://www.fio.cz/ib_api/rest/set-last-date/' + Token +
     99    '/' + IntToStr(YearOf(Date)) + '/' + IntToStr(MonthOf(Date)) + '/' +
     100    IntToStr(DayOf(Date)), nil);
     101end;
     102
    87103end.
    88104
Note: See TracChangeset for help on using the changeset viewer.