예제 #1
0
        public ActionResult DeleteWithoutRollBack(int id)
        {
            ITransactionServices       transactionService = ServiceFactory.GetTransactionServices();
            ITransactionDetailServices detailService      = ServiceFactory.GetTransactionDetailServices();

            Transaction t = transactionService.Get(id);

            if (t.JournalId != 0)
            {
                ServiceFactory.GetJournalServices().Delete(t.JournalId);
            }

            List <TransactionDetail> detail = (List <TransactionDetail>)detailService.GetAll(t.Id);
            List <int> accId = new List <int>();

            foreach (TransactionDetail d in detail)
            {
                accId.Add(d.AccountId);
                detailService.Delete(d.Id);
            }
            transactionService.Delete(t.Id);
            return(View(accId));
        }
 public IActionResult Get()
 {
     return(Ok(_transactionServices.Get()));
 }