public void EmptyCurrentAccount(int client_id, int destinaryAccount) { string queryString = $"SELECT amount FROM CurrentAccounts WHERE client_id = {client_id};"; double amount = (double)ConnectionDB.ReturnDecimal(queryString); string queryStringGetCurrentAccountId = $"SELECT id FROM CurrentAccounts WHERE client_id = {client_id};"; int currentAccountId = ConnectionDB.ReturnID(queryStringGetCurrentAccountId); InstantTransfer instant = new InstantTransfer(); instant.RecordTransferFromCurrentToCurrent(currentAccountId, destinaryAccount, amount); }
static void RunInstantTransferOptions(InstantTransferOptions options) { InstantTransfer instantTransfer = new InstantTransfer(); if (Person.ID == options.IdClient) { if (options.CurrentToCurrent) { instantTransfer.RecordTransferFromCurrentToCurrent(options.EmitterId, options.BeneficiaryId, options.Amount); } if (options.CurrentToSaving) { instantTransfer.RecordTransferFromCurrentToSaving(options.EmitterId, options.BeneficiaryId, options.Amount); } if (options.SavingToCurrent) { instantTransfer.RecordTransferFromSavingToCurrent(options.EmitterId, options.BeneficiaryId, options.Amount); } } else { Console.WriteLine("Wrong id"); } }