|
@@ -12,41 +12,17 @@ unit UWIZEnlistAccountForSale;
|
|
interface
|
|
interface
|
|
|
|
|
|
uses
|
|
uses
|
|
- Classes, SysUtils, Forms, Dialogs, UCrypto, UCommon, UWizard, UAccounts, LCLType;
|
|
|
|
|
|
+ Classes, SysUtils, Forms, Dialogs, UCrypto, UCommon, UWizard, UAccounts, UWIZModels, LCLType;
|
|
|
|
|
|
type
|
|
type
|
|
|
|
|
|
- { TWIZEnlistAccountForSaleModel }
|
|
|
|
- TWIZAccountSaleMode = (akaPublicSale, akaPrivateSale);
|
|
|
|
- TWIZPayloadEncryptionMode = (akaEncryptWithOldEC, akaEncryptWithEC,
|
|
|
|
- akaEncryptWithPassword, akaNotEncrypt);
|
|
|
|
-
|
|
|
|
- TWIZEnlistAccountForSaleModel = class(TComponent)
|
|
|
|
- public
|
|
|
|
- DefaultFee: int64;
|
|
|
|
- NewPublicKey, Payload, EncryptionPassword: string;
|
|
|
|
- SelectedIndex: integer;
|
|
|
|
- SalePrice: int64;
|
|
|
|
- NewOwnerPublicKey: TAccountKey;
|
|
|
|
- LockedUntilBlock: cardinal;
|
|
|
|
- EncodedPayload: TRawBytes;
|
|
|
|
- SignerAccount, SellerAccount: TAccount;
|
|
|
|
- SelectedAccounts: TArray<TAccount>;
|
|
|
|
- PayloadEncryptionMode: TWIZPayloadEncryptionMode;
|
|
|
|
- AccountSaleMode: TWIZAccountSaleMode;
|
|
|
|
- end;
|
|
|
|
-
|
|
|
|
{ TWIZEnlistAccountForSaleWizard }
|
|
{ TWIZEnlistAccountForSaleWizard }
|
|
|
|
|
|
- TWIZEnlistAccountForSaleWizard = class(TWizard<TWIZEnlistAccountForSaleModel>)
|
|
|
|
|
|
+ TWIZEnlistAccountForSaleWizard = class(TWizard<TWIZOperationsModel>)
|
|
private
|
|
private
|
|
- function UpdatePayload(const SenderAccount: TAccount;
|
|
|
|
- var errors: string): boolean;
|
|
|
|
|
|
+ function UpdatePayload(const SenderAccount: TAccount; var errors: string): boolean;
|
|
function UpdateOperationOptions(var errors: string): boolean;
|
|
function UpdateOperationOptions(var errors: string): boolean;
|
|
- function UpdateOpListForSale(const TargetAccount: TAccount;
|
|
|
|
- var SalePrice: int64; var SellerAccount, SignerAccount: TAccount;
|
|
|
|
- var NewOwnerPublicKey: TAccountKey; var LockedUntilBlock: cardinal;
|
|
|
|
- var errors: ansistring): boolean;
|
|
|
|
|
|
+ function UpdateOpListForSale(const TargetAccount: TAccount; var SalePrice: int64; var SellerAccount, SignerAccount: TAccount; var NewOwnerPublicKey: TAccountKey; var LockedUntilBlock: cardinal; var errors: ansistring): boolean;
|
|
procedure EnlistAccountForSale();
|
|
procedure EnlistAccountForSale();
|
|
public
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
constructor Create(AOwner: TComponent); override;
|
|
@@ -66,13 +42,15 @@ uses
|
|
UWallet,
|
|
UWallet,
|
|
UECIES,
|
|
UECIES,
|
|
UAES,
|
|
UAES,
|
|
- UWIZEnlistAccountForSale_Start,
|
|
|
|
|
|
+ UWIZEnlistAccountForSale_ConfirmAccount,
|
|
|
|
+ UWIZEnlistAccountForSale_SelectOption,
|
|
|
|
+ UWIZEnlistAccountForSale_EnterSeller,
|
|
|
|
+ UWIZEnlistAccountForSale_EnterSaleAmount,
|
|
UWIZEnlistAccountForSale_Confirmation;
|
|
UWIZEnlistAccountForSale_Confirmation;
|
|
|
|
|
|
{ TWIZEnlistAccountForSaleWizard }
|
|
{ TWIZEnlistAccountForSaleWizard }
|
|
|
|
|
|
-function TWIZEnlistAccountForSaleWizard.UpdatePayload(const SenderAccount: TAccount;
|
|
|
|
- var errors: string): boolean;
|
|
|
|
|
|
+function TWIZEnlistAccountForSaleWizard.UpdatePayload(const SenderAccount: TAccount; var errors: string): boolean;
|
|
var
|
|
var
|
|
valid: boolean;
|
|
valid: boolean;
|
|
payload_encrypted, payload_u: string;
|
|
payload_encrypted, payload_u: string;
|
|
@@ -80,9 +58,9 @@ var
|
|
begin
|
|
begin
|
|
valid := False;
|
|
valid := False;
|
|
payload_encrypted := '';
|
|
payload_encrypted := '';
|
|
- Model.EncodedPayload := '';
|
|
|
|
|
|
+ Model.Payload.EncodedBytes := '';
|
|
errors := 'Unknown error';
|
|
errors := 'Unknown error';
|
|
- payload_u := Model.Payload;
|
|
|
|
|
|
+ payload_u := Model.Payload.Content;
|
|
|
|
|
|
try
|
|
try
|
|
if (payload_u = '') then
|
|
if (payload_u = '') then
|
|
@@ -90,9 +68,9 @@ begin
|
|
valid := True;
|
|
valid := True;
|
|
Exit;
|
|
Exit;
|
|
end;
|
|
end;
|
|
- case Model.PayloadEncryptionMode of
|
|
|
|
|
|
+ case Model.Payload.Mode of
|
|
|
|
|
|
- akaEncryptWithOldEC:
|
|
|
|
|
|
+ akaEncryptWithSender:
|
|
begin
|
|
begin
|
|
// Use sender
|
|
// Use sender
|
|
errors := 'Error encrypting';
|
|
errors := 'Error encrypting';
|
|
@@ -101,11 +79,11 @@ begin
|
|
valid := payload_encrypted <> '';
|
|
valid := payload_encrypted <> '';
|
|
end;
|
|
end;
|
|
|
|
|
|
- akaEncryptWithEC:
|
|
|
|
|
|
+ akaEncryptWithReceiver:
|
|
begin
|
|
begin
|
|
errors := 'Public key: ' + 'Error encrypting';
|
|
errors := 'Public key: ' + 'Error encrypting';
|
|
|
|
|
|
- account := Model.SignerAccount;
|
|
|
|
|
|
+ account := Model.Signer.SignerAccount;
|
|
payload_encrypted := ECIESEncrypt(account.accountInfo.accountKey, payload_u);
|
|
payload_encrypted := ECIESEncrypt(account.accountInfo.accountKey, payload_u);
|
|
valid := payload_encrypted <> '';
|
|
valid := payload_encrypted <> '';
|
|
end;
|
|
end;
|
|
@@ -113,7 +91,7 @@ begin
|
|
akaEncryptWithPassword:
|
|
akaEncryptWithPassword:
|
|
begin
|
|
begin
|
|
payload_encrypted := TAESComp.EVP_Encrypt_AES256(
|
|
payload_encrypted := TAESComp.EVP_Encrypt_AES256(
|
|
- payload_u, Model.EncryptionPassword);
|
|
|
|
|
|
+ payload_u, Model.Payload.Password);
|
|
valid := payload_encrypted <> '';
|
|
valid := payload_encrypted <> '';
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -124,30 +102,24 @@ begin
|
|
end
|
|
end
|
|
|
|
|
|
else
|
|
else
|
|
- begin
|
|
|
|
raise Exception.Create('Invalid Encryption Selection');
|
|
raise Exception.Create('Invalid Encryption Selection');
|
|
- end;
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
finally
|
|
finally
|
|
if valid then
|
|
if valid then
|
|
- begin
|
|
|
|
if length(payload_encrypted) > CT_MaxPayloadSize then
|
|
if length(payload_encrypted) > CT_MaxPayloadSize then
|
|
begin
|
|
begin
|
|
valid := False;
|
|
valid := False;
|
|
errors := 'Payload size is bigger than ' + IntToStr(CT_MaxPayloadSize) +
|
|
errors := 'Payload size is bigger than ' + IntToStr(CT_MaxPayloadSize) +
|
|
' (' + IntToStr(length(payload_encrypted)) + ')';
|
|
' (' + IntToStr(length(payload_encrypted)) + ')';
|
|
end;
|
|
end;
|
|
-
|
|
|
|
- end;
|
|
|
|
- Model.EncodedPayload := payload_encrypted;
|
|
|
|
|
|
+ Model.Payload.EncodedBytes := payload_encrypted;
|
|
Result := valid;
|
|
Result := valid;
|
|
end;
|
|
end;
|
|
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TWIZEnlistAccountForSaleWizard.UpdateOperationOptions(
|
|
|
|
- var errors: string): boolean;
|
|
|
|
|
|
+function TWIZEnlistAccountForSaleWizard.UpdateOperationOptions(var errors: string): boolean;
|
|
var
|
|
var
|
|
iAcc, iWallet: integer;
|
|
iAcc, iWallet: integer;
|
|
sender_account, signer_account, seller_account: TAccount;
|
|
sender_account, signer_account, seller_account: TAccount;
|
|
@@ -165,17 +137,15 @@ begin
|
|
Exit;
|
|
Exit;
|
|
end;
|
|
end;
|
|
|
|
|
|
- if Length(Model.SelectedAccounts) = 0 then
|
|
|
|
|
|
+ if Length(Model.Account.SelectedAccounts) = 0 then
|
|
begin
|
|
begin
|
|
errors := 'No sender account';
|
|
errors := 'No sender account';
|
|
Exit;
|
|
Exit;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
- begin
|
|
|
|
-
|
|
|
|
- for iAcc := Low(Model.SelectedAccounts) to High(Model.SelectedAccounts) do
|
|
|
|
|
|
+ for iAcc := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
|
|
begin
|
|
begin
|
|
- sender_account := Model.SelectedAccounts[iAcc];
|
|
|
|
|
|
+ sender_account := Model.Account.SelectedAccounts[iAcc];
|
|
iWallet := TWallet.Keys.IndexOfAccountKey(sender_account.accountInfo.accountKey);
|
|
iWallet := TWallet.Keys.IndexOfAccountKey(sender_account.accountInfo.accountKey);
|
|
if (iWallet < 0) then
|
|
if (iWallet < 0) then
|
|
begin
|
|
begin
|
|
@@ -188,30 +158,22 @@ begin
|
|
if not assigned(wk.PrivateKey) then
|
|
if not assigned(wk.PrivateKey) then
|
|
begin
|
|
begin
|
|
if wk.CryptedKey <> '' then
|
|
if wk.CryptedKey <> '' then
|
|
- begin
|
|
|
|
- // TODO: handle unlocking of encrypted wallet here
|
|
|
|
- errors := 'Wallet is password protected. Need password';
|
|
|
|
- end
|
|
|
|
|
|
+ errors := 'Wallet is password protected. Need password'// TODO: handle unlocking of encrypted wallet here
|
|
|
|
+
|
|
else
|
|
else
|
|
- begin
|
|
|
|
errors := 'Only public key of account ' +
|
|
errors := 'Only public key of account ' +
|
|
TAccountComp.AccountNumberToAccountTxtNumber(sender_account.account) +
|
|
TAccountComp.AccountNumberToAccountTxtNumber(sender_account.account) +
|
|
' found in wallet. You cannot operate with this account';
|
|
' found in wallet. You cannot operate with this account';
|
|
- end;
|
|
|
|
Exit;
|
|
Exit;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
- end;
|
|
|
|
|
|
|
|
- Result := UpdateOpListForSale(Model.SelectedAccounts[0], salePrice,
|
|
|
|
|
|
+ Result := UpdateOpListForSale(Model.Account.SelectedAccounts[0], salePrice,
|
|
seller_account, signer_account, publicKey, auxC, errors);
|
|
seller_account, signer_account, publicKey, auxC, errors);
|
|
UpdatePayload(sender_account, e);
|
|
UpdatePayload(sender_account, e);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TWIZEnlistAccountForSaleWizard.UpdateOpListForSale(
|
|
|
|
- const TargetAccount: TAccount; var SalePrice: int64;
|
|
|
|
- var SellerAccount, SignerAccount: TAccount; var NewOwnerPublicKey: TAccountKey;
|
|
|
|
- var LockedUntilBlock: cardinal; var errors: ansistring): boolean;
|
|
|
|
|
|
+function TWIZEnlistAccountForSaleWizard.UpdateOpListForSale(const TargetAccount: TAccount; var SalePrice: int64; var SellerAccount, SignerAccount: TAccount; var NewOwnerPublicKey: TAccountKey; var LockedUntilBlock: cardinal; var errors: ansistring): boolean;
|
|
begin
|
|
begin
|
|
Result := False;
|
|
Result := False;
|
|
SalePrice := 0;
|
|
SalePrice := 0;
|
|
@@ -226,21 +188,21 @@ begin
|
|
TargetAccount.account) + ' is already enlisted for sale';
|
|
TargetAccount.account) + ' is already enlisted for sale';
|
|
Exit;
|
|
Exit;
|
|
end;
|
|
end;
|
|
- salePrice := Model.SalePrice;
|
|
|
|
|
|
+ salePrice := Model.EnlistAccountForSale.SalePrice;
|
|
|
|
|
|
- SignerAccount := Model.SignerAccount;
|
|
|
|
|
|
+ SignerAccount := Model.Signer.SignerAccount;
|
|
|
|
|
|
- if (Model.SellerAccount.account = TargetAccount.account) then
|
|
|
|
|
|
+ if (Model.EnlistAccountForSale.SellerAccount.account = TargetAccount.account) then
|
|
begin
|
|
begin
|
|
errors := 'Seller account cannot be same account';
|
|
errors := 'Seller account cannot be same account';
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
|
|
|
|
- SellerAccount := Model.SellerAccount;
|
|
|
|
- if Model.AccountSaleMode = akaPrivateSale then
|
|
|
|
|
|
+ SellerAccount := Model.EnlistAccountForSale.SellerAccount;
|
|
|
|
+ if Model.EnlistAccountForSale.AccountSaleMode = akaPrivateSale then
|
|
begin
|
|
begin
|
|
|
|
|
|
- NewOwnerPublicKey := Model.NewOwnerPublicKey;
|
|
|
|
|
|
+ NewOwnerPublicKey := Model.EnlistAccountForSale.NewOwnerPublicKey;
|
|
|
|
|
|
if TAccountComp.EqualAccountKeys(NewOwnerPublicKey,
|
|
if TAccountComp.EqualAccountKeys(NewOwnerPublicKey,
|
|
TargetAccount.accountInfo.accountKey) then
|
|
TargetAccount.accountInfo.accountKey) then
|
|
@@ -248,7 +210,7 @@ begin
|
|
errors := 'New public key for private sale is the same public key';
|
|
errors := 'New public key for private sale is the same public key';
|
|
Exit;
|
|
Exit;
|
|
end;
|
|
end;
|
|
- LockedUntilBlock := Model.LockedUntilBlock;
|
|
|
|
|
|
+ LockedUntilBlock := Model.EnlistAccountForSale.LockedUntilBlock;
|
|
if LockedUntilBlock = 0 then
|
|
if LockedUntilBlock = 0 then
|
|
begin
|
|
begin
|
|
errors := 'Insert locking block';
|
|
errors := 'Insert locking block';
|
|
@@ -294,21 +256,17 @@ begin
|
|
_signer_n_ops := 0;
|
|
_signer_n_ops := 0;
|
|
operationstxt := '';
|
|
operationstxt := '';
|
|
operation_to_string := '';
|
|
operation_to_string := '';
|
|
- for iAcc := Low(Model.SelectedAccounts) to High(Model.SelectedAccounts) do
|
|
|
|
|
|
+ for iAcc := Low(Model.Account.SelectedAccounts) to High(Model.Account.SelectedAccounts) do
|
|
begin
|
|
begin
|
|
loop_start:
|
|
loop_start:
|
|
op := nil;
|
|
op := nil;
|
|
- account := Model.SelectedAccounts[iAcc];
|
|
|
|
|
|
+ account := Model.Account.SelectedAccounts[iAcc];
|
|
if not UpdatePayload(account, errors) then
|
|
if not UpdatePayload(account, errors) then
|
|
- begin
|
|
|
|
raise Exception.Create('Error encoding payload of sender account ' +
|
|
raise Exception.Create('Error encoding payload of sender account ' +
|
|
TAccountComp.AccountNumberToAccountTxtNumber(account.account) + ': ' + errors);
|
|
TAccountComp.AccountNumberToAccountTxtNumber(account.account) + ': ' + errors);
|
|
- end;
|
|
|
|
i := TWallet.Keys.IndexOfAccountKey(account.accountInfo.accountKey);
|
|
i := TWallet.Keys.IndexOfAccountKey(account.accountInfo.accountKey);
|
|
if i < 0 then
|
|
if i < 0 then
|
|
- begin
|
|
|
|
raise Exception.Create('Sender account private key not found in Wallet');
|
|
raise Exception.Create('Sender account private key not found in Wallet');
|
|
- end;
|
|
|
|
|
|
|
|
wk := TWallet.Keys.Key[i];
|
|
wk := TWallet.Keys.Key[i];
|
|
dooperation := True;
|
|
dooperation := True;
|
|
@@ -320,32 +278,24 @@ begin
|
|
|
|
|
|
if not UpdateOpListForSale(account, _salePrice, destAccount,
|
|
if not UpdateOpListForSale(account, _salePrice, destAccount,
|
|
signerAccount, _newOwnerPublicKey, _lockedUntil, errors) then
|
|
signerAccount, _newOwnerPublicKey, _lockedUntil, errors) then
|
|
- begin
|
|
|
|
raise Exception.Create(errors);
|
|
raise Exception.Create(errors);
|
|
- end;
|
|
|
|
// Special fee account:
|
|
// Special fee account:
|
|
if signerAccount.balance > Model.Fee.DefaultFee then
|
|
if signerAccount.balance > Model.Fee.DefaultFee then
|
|
_fee := Model.Fee.DefaultFee
|
|
_fee := Model.Fee.DefaultFee
|
|
else
|
|
else
|
|
_fee := signerAccount.balance;
|
|
_fee := signerAccount.balance;
|
|
- if Model.AccountSaleMode = akaPublicSale then
|
|
|
|
- begin
|
|
|
|
|
|
+ if Model.EnlistAccountForSale.AccountSaleMode = akaPublicSale then
|
|
op := TOpListAccountForSale.CreateListAccountForSale(
|
|
op := TOpListAccountForSale.CreateListAccountForSale(
|
|
signerAccount.account, signerAccount.n_operation + 1 + iAcc,
|
|
signerAccount.account, signerAccount.n_operation + 1 + iAcc,
|
|
account.account, _salePrice, _fee, destAccount.account,
|
|
account.account, _salePrice, _fee, destAccount.account,
|
|
- CT_TECDSA_Public_Nul, 0, wk.PrivateKey, Model.EncodedPayload);
|
|
|
|
- end
|
|
|
|
- else if Model.AccountSaleMode = akaPrivateSale then
|
|
|
|
- begin
|
|
|
|
|
|
+ CT_TECDSA_Public_Nul, 0, wk.PrivateKey, Model.Payload.EncodedBytes)
|
|
|
|
+ else if Model.EnlistAccountForSale.AccountSaleMode = akaPrivateSale then
|
|
op := TOpListAccountForSale.CreateListAccountForSale(
|
|
op := TOpListAccountForSale.CreateListAccountForSale(
|
|
signerAccount.account, signerAccount.n_operation + 1 + iAcc,
|
|
signerAccount.account, signerAccount.n_operation + 1 + iAcc,
|
|
account.account, _salePrice, _fee, destAccount.account,
|
|
account.account, _salePrice, _fee, destAccount.account,
|
|
- _newOwnerPublicKey, _lockedUntil, wk.PrivateKey, Model.EncodedPayload);
|
|
|
|
- end
|
|
|
|
|
|
+ _newOwnerPublicKey, _lockedUntil, wk.PrivateKey, Model.Payload.EncodedBytes)
|
|
else
|
|
else
|
|
- begin
|
|
|
|
raise Exception.Create('Invalid Sale type');
|
|
raise Exception.Create('Invalid Sale type');
|
|
- end;
|
|
|
|
|
|
|
|
if Assigned(op) and (dooperation) then
|
|
if Assigned(op) and (dooperation) then
|
|
begin
|
|
begin
|
|
@@ -360,41 +310,32 @@ begin
|
|
if (ops.OperationsCount = 0) then
|
|
if (ops.OperationsCount = 0) then
|
|
raise Exception.Create('No valid operation to execute');
|
|
raise Exception.Create('No valid operation to execute');
|
|
|
|
|
|
- if (Length(Model.SelectedAccounts) > 1) then
|
|
|
|
|
|
+ if (Length(Model.Account.SelectedAccounts) > 1) then
|
|
begin
|
|
begin
|
|
auxs := '';
|
|
auxs := '';
|
|
if Application.MessageBox(
|
|
if Application.MessageBox(
|
|
- PChar('Execute ' + IntToStr(Length(Model.SelectedAccounts)) +
|
|
|
|
|
|
+ PChar('Execute ' + IntToStr(Length(Model.Account.SelectedAccounts)) +
|
|
' operations?' + #10 + 'Operation: ' + operationstxt + #10 +
|
|
' operations?' + #10 + 'Operation: ' + operationstxt + #10 +
|
|
auxs + 'Total fee: ' + TAccountComp.FormatMoney(_totalfee) +
|
|
auxs + 'Total fee: ' + TAccountComp.FormatMoney(_totalfee) +
|
|
#10 + #10 + 'Note: This operation will be transmitted to the network!'),
|
|
#10 + #10 + 'Note: This operation will be transmitted to the network!'),
|
|
PChar(Application.Title), MB_YESNO + MB_ICONINFORMATION + MB_DEFBUTTON2) <>
|
|
PChar(Application.Title), MB_YESNO + MB_ICONINFORMATION + MB_DEFBUTTON2) <>
|
|
idYes then
|
|
idYes then
|
|
- begin
|
|
|
|
Exit;
|
|
Exit;
|
|
- end;
|
|
|
|
end
|
|
end
|
|
else
|
|
else
|
|
- begin
|
|
|
|
- if Application.MessageBox(PChar('Execute this operation:' +
|
|
|
|
- #10 + #10 + operation_to_string + #10 + #10 +
|
|
|
|
- 'Note: This operation will be transmitted to the network!'),
|
|
|
|
- PChar(Application.Title), MB_YESNO + MB_ICONINFORMATION + MB_DEFBUTTON2) <>
|
|
|
|
- idYes then
|
|
|
|
- begin
|
|
|
|
- Exit;
|
|
|
|
- end;
|
|
|
|
- end;
|
|
|
|
|
|
+ if Application.MessageBox(PChar('Execute this operation:' +
|
|
|
|
+ #10 + #10 + operation_to_string + #10 + #10 +
|
|
|
|
+ 'Note: This operation will be transmitted to the network!'),
|
|
|
|
+ PChar(Application.Title), MB_YESNO + MB_ICONINFORMATION + MB_DEFBUTTON2) <>
|
|
|
|
+ idYes then
|
|
|
|
+ Exit;
|
|
i := TNode.Node.AddOperations(nil, ops, nil, errors);
|
|
i := TNode.Node.AddOperations(nil, ops, nil, errors);
|
|
if (i = ops.OperationsCount) then
|
|
if (i = ops.OperationsCount) then
|
|
begin
|
|
begin
|
|
operationstxt := 'Successfully executed ' + IntToStr(i) +
|
|
operationstxt := 'Successfully executed ' + IntToStr(i) +
|
|
' operations!' + #10 + #10 + operation_to_string;
|
|
' operations!' + #10 + #10 + operation_to_string;
|
|
if i > 1 then
|
|
if i > 1 then
|
|
- begin
|
|
|
|
-
|
|
|
|
- ShowMessage(operationstxt);
|
|
|
|
- end
|
|
|
|
|
|
+ ShowMessage(operationstxt)
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
Application.MessageBox(
|
|
Application.MessageBox(
|
|
@@ -413,9 +354,7 @@ begin
|
|
ShowMessage(operationstxt);
|
|
ShowMessage(operationstxt);
|
|
end
|
|
end
|
|
else
|
|
else
|
|
- begin
|
|
|
|
raise Exception.Create(errors);
|
|
raise Exception.Create(errors);
|
|
- end;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
finally
|
|
@@ -426,8 +365,15 @@ end;
|
|
|
|
|
|
constructor TWIZEnlistAccountForSaleWizard.Create(AOwner: TComponent);
|
|
constructor TWIZEnlistAccountForSaleWizard.Create(AOwner: TComponent);
|
|
begin
|
|
begin
|
|
- inherited Create(AOwner, [TWIZEnlistAccountForSale_Start,
|
|
|
|
- TWIZEnlistAccountForSale_Confirmation]);
|
|
|
|
|
|
+ inherited Create(AOwner,
|
|
|
|
+ [
|
|
|
|
+ TWIZEnlistAccountForSale_ConfirmAccount,
|
|
|
|
+ TWIZEnlistAccountForSale_SelectOption,
|
|
|
|
+ TWIZEnlistAccountForSale_EnterSeller,
|
|
|
|
+ TWIZEnlistAccountForSale_EnterSaleAmount,
|
|
|
|
+ TWIZEnlistAccountForSale_Confirmation
|
|
|
|
+ ]
|
|
|
|
+ );
|
|
TitleText := 'Enlist Account';
|
|
TitleText := 'Enlist Account';
|
|
FinishText := 'Enlist Account';
|
|
FinishText := 'Enlist Account';
|
|
end;
|
|
end;
|
|
@@ -442,8 +388,7 @@ begin
|
|
Result := inherited DetermineHasPrevious;
|
|
Result := inherited DetermineHasPrevious;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TWIZEnlistAccountForSaleWizard.FinishRequested(
|
|
|
|
- out message: ansistring): boolean;
|
|
|
|
|
|
+function TWIZEnlistAccountForSaleWizard.FinishRequested(out message: ansistring): boolean;
|
|
begin
|
|
begin
|
|
// Execute the Enlist Account For Sale Action here
|
|
// Execute the Enlist Account For Sale Action here
|
|
try
|
|
try
|
|
@@ -458,8 +403,8 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TWIZEnlistAccountForSaleWizard.CancelRequested(
|
|
|
|
- out message: ansistring): boolean;
|
|
|
|
|
|
+function TWIZEnlistAccountForSaleWizard.CancelRequested(out message: ansistring): boolean;
|
|
|
|
+
|
|
begin
|
|
begin
|
|
Result := True;
|
|
Result := True;
|
|
end;
|
|
end;
|