예제 #1
0
        public void UpdateBillState(IBill bill, BillStates state, string remarks, DateTime? date = null)
        {
            ExceptionHelper.ThrowIfNull(bill, "bill");

            if (state == bill.State)
            {
                UpdateLastStateHistoryRemarksIfMatchState(bill, state, remarks);
                return;
            }

            using (var scope = new System.Transactions.TransactionScope())
            {
                bill.UpdateState(_User, state);
                _BillRepository.SaveChanges();

                InsertBillStateHistory(bill, state, remarks, date);

                scope.Complete();
            }
        }