예제 #1
0
        private void ExpireAllocations(Guid employerId)
        {
            var allocations = _allocationsQuery.GetAllocationsByOwnerId(employerId);

            foreach (var allocation in allocations)
            {
                allocation.CreatedTime = DateTime.Now.AddDays(-10);
                allocation.ExpiryDate  = DateTime.Now.AddDays(-5).Date;
                _creditsRepository.UpdateAllocation(allocation);
            }
        }
예제 #2
0
        void IAllocationsCommand.Deallocate(Guid allocationId)
        {
            var allocation = _repository.GetAllocation(allocationId);

            if (allocation != null)
            {
                allocation.DeallocatedTime = DateTime.Now;
                _repository.UpdateAllocation(allocation);
            }
        }
예제 #3
0
 private void Expire(Allocation allocation, DateTime date)
 {
     allocation.ExpiryDate = date;
     _creditsRepository.UpdateAllocation(allocation);
 }