|
@@ -31,7 +31,7 @@ type
|
|
lblSgnAcc: TLabel;
|
|
lblSgnAcc: TLabel;
|
|
paGrid: TPanel;
|
|
paGrid: TPanel;
|
|
private
|
|
private
|
|
- FSendersGrid : TVisualGrid;
|
|
|
|
|
|
+ FSendersGrid: TVisualGrid;
|
|
public
|
|
public
|
|
procedure OnPresent; override;
|
|
procedure OnPresent; override;
|
|
end;
|
|
end;
|
|
@@ -48,97 +48,101 @@ type
|
|
{ TAccountSenderDataSource }
|
|
{ TAccountSenderDataSource }
|
|
|
|
|
|
TAccountSenderDataSource = class(TAccountsDataSourceBase)
|
|
TAccountSenderDataSource = class(TAccountsDataSourceBase)
|
|
- private
|
|
|
|
- FModel : TWIZOperationsModel;
|
|
|
|
- protected
|
|
|
|
- function GetColumns : TDataColumns; override;
|
|
|
|
- public
|
|
|
|
- property Model : TWIZOperationsModel read FModel write FModel;
|
|
|
|
- procedure FetchAll(const AContainer : TList<TAccount>); override;
|
|
|
|
- function GetItemField(constref AItem: TAccount; const ABindingName : AnsiString) : Variant; override;
|
|
|
|
|
|
+ private
|
|
|
|
+ FModel: TWIZOperationsModel;
|
|
|
|
+ protected
|
|
|
|
+ function GetColumns: TDataColumns; override;
|
|
|
|
+ public
|
|
|
|
+ property Model: TWIZOperationsModel read FModel write FModel;
|
|
|
|
+ procedure FetchAll(const AContainer: TList<TAccount>); override;
|
|
|
|
+ function GetItemField(constref AItem: TAccount; const ABindingName: ansistring): variant; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TWIZSendPASC_Confirmation }
|
|
{ TWIZSendPASC_Confirmation }
|
|
|
|
|
|
procedure TWIZSendPASC_Confirmation.OnPresent;
|
|
procedure TWIZSendPASC_Confirmation.OnPresent;
|
|
var
|
|
var
|
|
- data : TAccountSenderDataSource;
|
|
|
|
|
|
+ Data: TAccountSenderDataSource;
|
|
begin
|
|
begin
|
|
FSendersGrid := TVisualGrid.Create(Self);
|
|
FSendersGrid := TVisualGrid.Create(Self);
|
|
- FSendersGrid.CanSearch:= False;
|
|
|
|
|
|
+ FSendersGrid.CanSearch := False;
|
|
FSendersGrid.SortMode := smMultiColumn;
|
|
FSendersGrid.SortMode := smMultiColumn;
|
|
FSendersGrid.FetchDataInThread := False;
|
|
FSendersGrid.FetchDataInThread := False;
|
|
FSendersGrid.AutoPageSize := True;
|
|
FSendersGrid.AutoPageSize := True;
|
|
FSendersGrid.SelectionType := stNone;
|
|
FSendersGrid.SelectionType := stNone;
|
|
FSendersGrid.Options := [vgoColAutoFill, vgoColSizing, vgoSortDirectionAllowNone, vgoAutoHidePaging];
|
|
FSendersGrid.Options := [vgoColAutoFill, vgoColSizing, vgoSortDirectionAllowNone, vgoAutoHidePaging];
|
|
- with FSendersGrid.AddColumn('Sender') do begin
|
|
|
|
|
|
+ with FSendersGrid.AddColumn('Sender') do
|
|
|
|
+ begin
|
|
Binding := 'SenderAccount';
|
|
Binding := 'SenderAccount';
|
|
Filters := SORTABLE_NUMERIC_FILTER;
|
|
Filters := SORTABLE_NUMERIC_FILTER;
|
|
Width := 100;
|
|
Width := 100;
|
|
HeaderFontStyles := [fsBold];
|
|
HeaderFontStyles := [fsBold];
|
|
DataFontStyles := [fsBold];
|
|
DataFontStyles := [fsBold];
|
|
end;
|
|
end;
|
|
- with FSendersGrid.AddColumn('Balance') do begin
|
|
|
|
|
|
+ with FSendersGrid.AddColumn('Balance') do
|
|
|
|
+ begin
|
|
Filters := SORTABLE_NUMERIC_FILTER;
|
|
Filters := SORTABLE_NUMERIC_FILTER;
|
|
Width := 100;
|
|
Width := 100;
|
|
Renderer := TCellRenderers.PASC;
|
|
Renderer := TCellRenderers.PASC;
|
|
end;
|
|
end;
|
|
- with FSendersGrid.AddColumn('Amount To Send') do begin
|
|
|
|
|
|
+ with FSendersGrid.AddColumn('Amount To Send') do
|
|
|
|
+ begin
|
|
Binding := 'AmountToSend';
|
|
Binding := 'AmountToSend';
|
|
Filters := SORTABLE_TEXT_FILTER;
|
|
Filters := SORTABLE_TEXT_FILTER;
|
|
Width := 100;
|
|
Width := 100;
|
|
end;
|
|
end;
|
|
- with FSendersGrid.AddColumn('Fee') do begin
|
|
|
|
|
|
+ with FSendersGrid.AddColumn('Fee') do
|
|
|
|
+ begin
|
|
Filters := SORTABLE_TEXT_FILTER;
|
|
Filters := SORTABLE_TEXT_FILTER;
|
|
Width := 100;
|
|
Width := 100;
|
|
end;
|
|
end;
|
|
|
|
|
|
- data := TAccountSenderDataSource.Create(FSendersGrid);
|
|
|
|
- data.Model := Model;
|
|
|
|
- FSendersGrid.DataSource := data;
|
|
|
|
- paGrid.AddControlDockCenter(FSendersGrid);
|
|
|
|
- lblSgnAcc.Caption := TAccountComp.AccountNumberToAccountTxtNumber(Model.Signer.SignerAccount.account);
|
|
|
|
- lblDestAcc.Caption := TAccountComp.AccountNumberToAccountTxtNumber(Model.SendPASC.DestinationAccount.account);
|
|
|
|
|
|
+ Data := TAccountSenderDataSource.Create(FSendersGrid);
|
|
|
|
+ Data.Model := Model;
|
|
|
|
+ FSendersGrid.DataSource := Data;
|
|
|
|
+ paGrid.AddControlDockCenter(FSendersGrid);
|
|
|
|
+ lblSgnAcc.Caption := TAccountComp.AccountNumberToAccountTxtNumber(Model.Signer.SignerAccount.account);
|
|
|
|
+ lblDestAcc.Caption := TAccountComp.AccountNumberToAccountTxtNumber(Model.SendPASC.DestinationAccount.account);
|
|
end;
|
|
end;
|
|
|
|
|
|
{ TAccountSenderDataSource }
|
|
{ TAccountSenderDataSource }
|
|
|
|
|
|
-function TAccountSenderDataSource.GetColumns : TDataColumns;
|
|
|
|
|
|
+function TAccountSenderDataSource.GetColumns: TDataColumns;
|
|
begin
|
|
begin
|
|
Result := TDataColumns.Create(
|
|
Result := TDataColumns.Create(
|
|
TDataColumn.From('SenderAccount'),
|
|
TDataColumn.From('SenderAccount'),
|
|
TDataColumn.From('Balance'),
|
|
TDataColumn.From('Balance'),
|
|
TDataColumn.From('AmountToSend'),
|
|
TDataColumn.From('AmountToSend'),
|
|
TDataColumn.From('Fee')
|
|
TDataColumn.From('Fee')
|
|
- );
|
|
|
|
|
|
+ );
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TAccountSenderDataSource.GetItemField(constref AItem: TAccount; const ABindingName : AnsiString) : Variant;
|
|
|
|
|
|
+function TAccountSenderDataSource.GetItemField(constref AItem: TAccount; const ABindingName: ansistring): variant;
|
|
var
|
|
var
|
|
- index : Integer;
|
|
|
|
|
|
+ index: integer;
|
|
begin
|
|
begin
|
|
- if ABindingName = 'SenderAccount' then
|
|
|
|
- Result := TAccountComp.AccountNumberToAccountTxtNumber(AItem.account)
|
|
|
|
- else if ABindingName = 'Balance' then
|
|
|
|
- Result := TAccountComp.FormatMoney(AItem.Balance)
|
|
|
|
- else if ABindingName = 'AmountToSend' then
|
|
|
|
- Result := TAccountComp.FormatMoney(Model.SendPASC.SingleAmountToSend)
|
|
|
|
- else if ABindingName = 'Fee' then
|
|
|
|
- Result := TAccountComp.FormatMoney(Model.Fee.SingleOperationFee)
|
|
|
|
- else raise Exception.Create(Format('Field not found [%s]', [ABindingName]));
|
|
|
|
|
|
+ if ABindingName = 'SenderAccount' then
|
|
|
|
+ Result := TAccountComp.AccountNumberToAccountTxtNumber(AItem.account)
|
|
|
|
+ else if ABindingName = 'Balance' then
|
|
|
|
+ Result := TAccountComp.FormatMoney(AItem.Balance)
|
|
|
|
+ else if ABindingName = 'AmountToSend' then
|
|
|
|
+ Result := IIF(Model.SendPASC.SendPASCMode = akaAllBalance, 'ALL BALANCE', TAccountComp.FormatMoney(Model.SendPASC.SingleAmountToSend))
|
|
|
|
+ else if ABindingName = 'Fee' then
|
|
|
|
+ Result := TAccountComp.FormatMoney(Model.Fee.SingleOperationFee)
|
|
|
|
+ else
|
|
|
|
+ raise Exception.Create(Format('Field not found [%s]', [ABindingName]));
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
-procedure TAccountSenderDataSource.FetchAll(const AContainer : TList<TAccount>);
|
|
|
|
|
|
+procedure TAccountSenderDataSource.FetchAll(const AContainer: TList<TAccount>);
|
|
var
|
|
var
|
|
- i: Integer;
|
|
|
|
|
|
+ i: integer;
|
|
begin
|
|
begin
|
|
for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
|
|
for i := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
|
|
begin
|
|
begin
|
|
- AContainer.Add( Model.Account.SelectedAccounts[i] );
|
|
|
|
|
|
+ AContainer.Add(Model.Account.SelectedAccounts[i]);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|
|
end.
|
|
-
|
|
|