public static void DeallocateAll(this IAllocationsCommand allocationsCommand, IAllocationsQuery allocationsQuery, Guid ownerId) { foreach (var allocation in allocationsQuery.GetActiveAllocations(ownerId)) { allocationsCommand.Deallocate(allocation.Id); } }
private void DeallocateCredits(Order order) { foreach (var allocation in _allocationsQuery.GetAllocationsByReferenceId(order.Id)) { _allocationsCommand.Deallocate(allocation.Id); } }
protected void ExpireCredits() { if (_allocationId != null) { _allocationsCommand.Deallocate(_allocationId.Value); } }
private void DeallocateJobAdCredits(Guid ownerId) { var allocations = _allocationsQuery.GetActiveAllocations <JobAdCredit>(ownerId); if (allocations != null) { foreach (var allocation in allocations) { _allocationsCommand.Deallocate(allocation.Id); } } }
public ActionResult Deallocate(Guid id, Guid allocationId) { try { var organisation = _organisationsQuery.GetOrganisation(id); if (organisation == null) { return(JsonNotFound("organisation")); } _allocationsCommand.Deallocate(allocationId); return(Json(new JsonResponseModel())); } catch (UserException ex) { ModelState.AddModelError(ex, new StandardErrorHandler()); } return(Json(new JsonResponseModel())); }
void IEmployerAllocationsCommand.Deallocate(Guid allocationId) { _allocationsCommand.Deallocate(allocationId); }