예제 #1
0
 public void AddTransaction(Transaction transaction)
 {
     using (var bankContext = new BankingContext())
     {
         bankContext.Transaction.Add(transaction);
         bankContext.SaveChanges();
     }
 }
예제 #2
0
 public void InsertPaymentOrder(PaymentOrder paymentOrder)
 {
     using (var bankContext = new BankingContext())
     {
         bankContext.PaymentOrder.Add(paymentOrder);
         bankContext.SaveChanges();
     }
 }
예제 #3
0
 public void Update(Loan loan)
 {
     using (var bankContext = new BankingContext())
     {
         bankContext.Loan.Update(loan);
         bankContext.SaveChanges();
     }
 }
예제 #4
0
 public void InsertTransferOrder(TransferOrder transferOrder)
 {
     using (var bankContext = new BankingContext())
     {
         bankContext.TransferOrder.Add(transferOrder);
         bankContext.SaveChanges();
     }
 }
예제 #5
0
 public void UpdatePrepaidCard(PrepaidCard prepaidCard)
 {
     using (var bankContext = new BankingContext())
     {
         bankContext.PrepaidCard.Update(prepaidCard);
         bankContext.SaveChanges();
     }
 }
예제 #6
0
 public void UpdateCreditCard(CreditCard creditCard)
 {
     using (var bankContext = new BankingContext())
     {
         bankContext.CreditCard.Update(creditCard);
         bankContext.SaveChanges();
     }
 }
예제 #7
0
 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();
         }
     }
 }
예제 #8
0
 public void DeleteTransferOrder(TransferOrder transferOrder)
 {
     using (var bankContext = new BankingContext())
     {
         try
         {
             bankContext.TransferOrder.Remove(transferOrder);
             bankContext.SaveChanges();
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
예제 #9
0
 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;
         }
     }
 }