public void SetAwb(long applicationId, long?awbId) { if (awbId.HasValue) { var aggregate = _awbs.GetAggregate(new[] { awbId.Value }).First(); _editor.SetAirWaybill(applicationId, awbId.Value); _states.SetState(applicationId, aggregate.StateId); _events.Add(applicationId, EventType.SetAwb, EventState.Emailing, awbId.Value); } else { _editor.SetAirWaybill(applicationId, null); _states.SetState(applicationId, _config.CargoInStockStateId); } }
private void UpdateApplicationsState(long airWaybillId, long stateId, long oldStateId) { if (stateId == oldStateId) { return; } var applications = _applications.GetByAirWaybill(airWaybillId); foreach (var application in applications) { if (oldStateId == application.StateId) { _states.SetState(application.Id, stateId); } } }
public void SetTransitReference(long id, string transitReference) { _states.SetState(id, _config.CargoOnTransitStateId); _editor.SetTransitReference(id, transitReference); }
public virtual HttpStatusCodeResult Close(long id) { _states.SetState(id, _config.CargoReceivedStateId); return(new HttpStatusCodeResult(HttpStatusCode.OK)); }