Changeset 20 for trunk/UCore.pas
- Timestamp:
- Mar 25, 2013, 10:58:03 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r19 r20 11 11 12 12 type 13 TAccountOperation = class 14 Id: string; 15 Time: TDateTime; 16 Value: Double; 17 VarSym: string; 18 SpecSym: string; 19 ConstSym: string; 20 end; 13 21 14 22 { TAccount } … … 18 26 Name: string; 19 27 Number: string; 28 BankCode: string; 20 29 Balance: Double; 21 30 Time: TDateTime; 31 Operations: TListObject; 22 32 procedure Assign(Source: TAccount); 23 33 procedure LoadFromRegistry(Context: TRegistryContext); 24 34 procedure SaveToRegistry(Context: TRegistryContext); 35 constructor Create; 36 destructor Destroy; override; 25 37 end; 26 38 … … 128 140 Balance := ReadFloatWithDefault('Balance', 0); 129 141 Number := UTF8Encode(ReadStringWithDefault('Number', '')); 142 BankCode := UTF8Encode(ReadStringWithDefault('BankCode', '')); 130 143 finally 131 144 Free; … … 144 157 WriteString('Token', UTF8Decode(Token)); 145 158 WriteFloat('Balance', Balance); 146 finally 147 Free; 148 end; 159 WriteString('BankCode', UTF8Decode(BankCode)); 160 finally 161 Free; 162 end; 163 end; 164 165 constructor TAccount.Create; 166 begin 167 Operations := TListObject.Create; 168 end; 169 170 destructor TAccount.Destroy; 171 begin 172 Operations.Free; 173 inherited Destroy; 149 174 end; 150 175 … … 194 219 Strings.Delete(Strings.Count - 1); 195 220 for I := 0 to Count - 1 do begin 196 Strings.Strings[I] := TAccount(Items[I]).Name + ' (' + TAccount(Items[I]).Number + ')'; 221 Strings.Strings[I] := IntToStr(I) + ': ' + TAccount(Items[I]).Name + ' (' + 222 TAccount(Items[I]).Number + '/' + TAccount(Items[I]).BankCode + ')'; 197 223 Strings.Objects[I] := Items[I]; 198 224 end; … … 240 266 Result := StringReplace(Result, '%a', CurrentAccount.Number, [rfReplaceAll]); 241 267 Result := StringReplace(Result, '%n', CurrentAccount.Name, [rfReplaceAll]); 268 Result := StringReplace(Result, '%b', CurrentAccount.BankCode, [rfReplaceAll]); 242 269 Result := StringReplace(Result, '%%', '%', [rfReplaceAll]); 243 270 end; … … 273 300 Node2 := Node.FindNode('bankId'); 274 301 if Assigned(Node2) then 275 Account. Number := Account.Number + '/' +UTF8Encode(Node2.TextContent);302 Account.BankCode := UTF8Encode(Node2.TextContent); 276 303 Node2 := Node.FindNode('closingBalance'); 277 304 if Assigned(Node2) then … … 279 306 DefaultFormatSettings.DecimalSeparator, [rfReplaceAll])); 280 307 end else begin 308 Account.BankCode := ''; 281 309 Account.Number := ''; 282 310 Account.Balance := 0;
Note:
See TracChangeset
for help on using the changeset viewer.