コード例 #1
0
 public IActionResult GetShipment([FromRoute] int id)
 {
     try
     {
         if (!_repo.ShipmentExists(id))
         {
             return(NotFound());
         }
         var shipment = Mapper.Map <ShipmentDto>(_repo.GetShipment(id));
         return(Ok(shipment));
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
コード例 #2
0
        public async Task UpdateShipmentByIdAsync(string code, FormShipmentModel model)
        {
            var entity = _shipmentRepository.GetShipment(model.Id.ToString());

            _mapper.Map <FormShipmentModel, Shipment>(model, entity);

            _shipmentRequestRepository.UpdateShipmentRequest(model.RequestIdList, model.Id);
            _uow.GetRepository <IShipmentRepository>().Update(entity);

            await _uow.SaveChangesAsync();
        }
コード例 #3
0
 public IEnumerable <Shipment> GetShipment()
 {
     _log4net.Info("ShipmentController HttpGet ");
     return(repo.GetShipment());
 }