public OperationContent MakeBuyTransaction(OperationContent operationContent, OperationContractModel operation) { TakeAmountIntoAccount(operationContent); operationContent.ToStorages = AddItems(operationContent.ToStorages, operation.Items).ToList(); operationContent.FromStorages = DeductItems(operationContent.FromStorages, operation.Items).ToList(); return(operationContent); }
private void TakeAmountIntoAccount(OperationContent operationContent) { operationContent.FromAccount.AvailableBalance += operationContent.OperationAmount; operationContent.ToAccount.AvailableBalance -= operationContent.OperationAmount; }