public void AddTransaction(Transaction transaction) { using (var bankContext = new BankingContext()) { bankContext.Transaction.Add(transaction); bankContext.SaveChanges(); } }
public void InsertPaymentOrder(PaymentOrder paymentOrder) { using (var bankContext = new BankingContext()) { bankContext.PaymentOrder.Add(paymentOrder); bankContext.SaveChanges(); } }
public void Update(Loan loan) { using (var bankContext = new BankingContext()) { bankContext.Loan.Update(loan); bankContext.SaveChanges(); } }
public void InsertTransferOrder(TransferOrder transferOrder) { using (var bankContext = new BankingContext()) { bankContext.TransferOrder.Add(transferOrder); bankContext.SaveChanges(); } }
public void UpdatePrepaidCard(PrepaidCard prepaidCard) { using (var bankContext = new BankingContext()) { bankContext.PrepaidCard.Update(prepaidCard); bankContext.SaveChanges(); } }
public void UpdateCreditCard(CreditCard creditCard) { using (var bankContext = new BankingContext()) { bankContext.CreditCard.Update(creditCard); bankContext.SaveChanges(); } }
public void DeleteLinkedProduct(string cardId, string productId) { using (var bankContext = new BankingContext()) { var linkedProduct = bankContext.LinkedProducts .First(product => product.CardId == cardId && product.ProductId == productId); if (linkedProduct != null) { bankContext.Remove(linkedProduct); bankContext.SaveChanges(); } } }
public void DeleteTransferOrder(TransferOrder transferOrder) { using (var bankContext = new BankingContext()) { try { bankContext.TransferOrder.Remove(transferOrder); bankContext.SaveChanges(); } catch (Exception) { throw; } } }
public void DeletePaymentOrder(PaymentOrder paymentOrder) { using (var bankContext = new BankingContext()) { try { bankContext.PaymentOrder.Remove(paymentOrder); bankContext.SaveChanges(); } catch (Exception) { throw; } } }
public void UpdateAccount(Account account) { using (var bankContext = new BankingContext()) { try { bankContext.Account.Update(account as Account); bankContext.SaveChanges(); } catch (Exception) { throw; } } }