示例#1
0
        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);
            }
        }
示例#2
0
        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);
                }
            }
        }
示例#3
0
        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));
        }