public ActionResult CreateCardOperation(CardOperation operation, FormCollection form) { return CreateOperation(operation, form); }
private static void CheckCardOperation(IRepositoryFactory factory, string userId, Operation operation) { if (!(operation is CardOperation)) return; var cOperation = operation as CardOperation; cOperation.CardNumber = new string(cOperation.CardNumber.Where(c => c != ' ').ToArray()); var card = factory.CardRepository.Find(c => c.Number.Equals(cOperation.CardNumber)).FirstOrDefault(); if (card != null) { var replenishmentOperation = new CardOperation { Amount = operation.Amount, CardNumber = cOperation.CardNumber, AccountId = card.Account.AccountId }; ReplenishAccount(replenishmentOperation, factory, userId); } }