- Timestamp:
- Mar 16, 2013, 12:05:33 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r12 r13 81 81 Core.CurrentAccount := TAccount(Core.Accounts[ComboBoxAccounts.ItemIndex]) 82 82 else Core.CurrentAccount := nil; 83 LoadInterface; 83 84 end; 84 85 … … 121 122 ButtonMonthly.Enabled := Assigned(Core.CurrentAccount); 122 123 ButtonNew.Enabled := Assigned(Core.CurrentAccount); 124 if ComboBoxAccounts.ItemIndex <> -1 then begin 125 LabelBalance.Caption := FloatToStr(TAccount(ComboBoxAccounts.Items.Objects[ 126 ComboBoxAccounts.ItemIndex]).Balance) + ' KÄ'; 127 end else begin 128 LabelBalance.Caption := '? KÄ'; 129 end; 123 130 end; 124 131 -
trunk/UCore.pas
r12 r13 119 119 RootKey := Context.RootKey; 120 120 OpenKey(Context.Key, True); 121 Name := ReadStringWithDefault('Name', '');121 Name := UTF8Encode(ReadStringWithDefault('Name', UTF8Decode('UÄet'))); 122 122 Time := ReadDateTimeWithDefault('Time', 0); 123 Token := ReadStringWithDefault('Token', '');123 Token :=UTF8Encode( ReadStringWithDefault('Token', '')); 124 124 Balance := ReadFloatWithDefault('Balance', 0); 125 Number := ReadStringWithDefault('Number', '');125 Number := UTF8Encode(ReadStringWithDefault('Number', '')); 126 126 finally 127 127 Free; … … 135 135 RootKey := Context.RootKey; 136 136 OpenKey(Context.Key, True); 137 WriteString('Number', Number);138 WriteString('Name', Name);137 WriteString('Number', UTF8Decode(Number)); 138 WriteString('Name', UTF8Decode(Name)); 139 139 WriteDateTime('Time', Time); 140 WriteString('Token', Token);140 WriteString('Token', UTF8Decode(Token)); 141 141 WriteFloat('Balance', Balance); 142 142 finally … … 189 189 while Strings.Count > Count do 190 190 Strings.Delete(Strings.Count - 1); 191 for I := 0 to Count - 1 do 192 Strings.Strings[I] := TAccount(Items[I]).Name; 191 for I := 0 to Count - 1 do begin 192 Strings.Strings[I] := TAccount(Items[I]).Name + ' (' + TAccount(Items[I]).Number + ')'; 193 Strings.Objects[I] := Items[I]; 194 end; 193 195 end; 194 196 … … 218 220 ApplicationInfo1.RegistryKey); 219 221 LoadFromRegistry(RegistryContext); 220 //LoadAccounts;222 LoadAccounts; 221 223 end; 222 224 … … 235 237 Mem: TMemoryStream; 236 238 RootNode: TDOMNode; 239 Node: TDOMNode; 240 Node2: TDOMNode; 237 241 begin 238 242 FioAPI := TFioAPI.Create; … … 246 250 if FioAPI.DownloadInterval(Now, Now, List) then begin 247 251 List.SaveToStream(Mem); 252 Mem.Position := 0; 248 253 ReadXMLFile(XMLDocument, Mem); 249 254 RootNode := XMLDocument.DocumentElement; 250 ShowMessage(RootNode.NodeName); 255 Node := RootNode.FindNode('Info'); 256 Node2 := Node.FindNode('accountId'); 257 if Assigned(Node2) then 258 Account.Number := UTF8Encode(Node2.TextContent); 259 Node2 := Node.FindNode('bankId'); 260 if Assigned(Node2) then 261 Account.Number := Account.Number + '/' + UTF8Encode(Node2.TextContent); 262 Node2 := Node.FindNode('closingBalance'); 263 if Assigned(Node2) then 264 Account.Balance := StrToFloat(Node2.TextContent); 251 265 end else begin 252 266 Account.Number := ''; … … 281 295 RootKey := Context.RootKey; 282 296 OpenKey(Context.Key, True); 283 WriteString('TargetDir', TargetDirectory);297 WriteString('TargetDir', UTF8Decode(TargetDirectory)); 284 298 WriteInteger('DataFormat', Integer(DataFormat)); 285 299 WriteDate('ReportTimeFrom', ReportTimeFrom); … … 300 314 RootKey := Context.RootKey; 301 315 OpenKey(Context.Key, True); 302 TargetDirectory := ReadStringWithDefault('TargetDir', ExtractFileDir(Application.ExeName));316 TargetDirectory := UTF8Encode(ReadStringWithDefault('TargetDir', UTF8Decode(ExtractFileDir(Application.ExeName)))); 303 317 DataFormat := TFioDataFormat(ReadIntegerWithDefault('DataFormat', Integer(dfXML))); 304 318 ReportTimeFrom := ReadDateTimeWithDefault('ReportTimeFrom', Now);
Note:
See TracChangeset
for help on using the changeset viewer.