Example #1
0
        public void Update(long id, AwbSenderModel model)
        {
            var data = _awbs.Get(id).First();

            AwbMapper.Map(model, data);

            _awbs.Update(id, data);
        }
Example #2
0
        public void Update(long id, AwbBrokerModel model)
        {
            var data = _awbs.Get(id).First();

            if (data.StateId == _config.CargoIsCustomsClearedStateId)
            {
                throw new UnexpectedStateException(
                          data.StateId,
                          "Can't update an AWB while it has the state "
                          + _config.CargoIsCustomsClearedStateId.ToString(CultureInfo.InvariantCulture));
            }

            AwbMapper.Map(model, data);

            _awbs.Update(id, data);
        }