示例#1
0
 private bool UpdateTransactionInfo(Transactions transaction)
 {
     try
     {
         bool isSuccess;
         using (var repo = new TranscationsRepository())
         {
             isSuccess = repo.Update(transaction);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         throw new Exception("BusinessLogic:TransactionBusiness::UpdateTransaction::Error occured.", ex);
     }
 }
示例#2
0
        public List <Transactions> SelectAllTransactions()
        {
            var responseEntities = new List <Transactions>();

            try
            {
                using (var repo = new TranscationsRepository())
                {
                    foreach (var entity in repo.SelectAll())
                    {
                        responseEntities.Add(entity);
                    }
                }
                return(responseEntities);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#3
0
 private bool InsertTransaction(Transactions entity)
 {
     try
     {
         bool isSuccess;
         using (var repo = new TranscationsRepository())
         {
             isSuccess = repo.Insert(entity);
             using (var customerRepo = new CustomersRepository())
             {
                 Customers c = customerRepo.SelectedById(entity.TransactorAccountNumber);
                 generalTransaction = c.Transactions.ElementAt(c.Transactions.Count - 1);
             }
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         throw new Exception("BusinessLogic:TransactionBusiness::InsertTransaction::Error occured.", ex);
     }
 }