コード例 #1
0
 public CargoRoutingDTO LoadCargoForRouting(string trackingId)
 {
     try
     {
         Cargo cargo     = CargoRepository.Find(new TrackingId(trackingId));
         var   assembler = new CargoRoutingDTOAssembler();
         return(assembler.ToDTO(cargo));
     }
     catch (Exception exception)
     {
         throw new NDDDRemoteBookingException(exception.Message);
     }
 }
コード例 #2
0
 public CargoRoutingDTO LoadCargoForRouting(string trackingId)
 {
     try
     {
         Cargo cargo = CargoRepository.Find(new TrackingId(trackingId));
         var assembler = new CargoRoutingDTOAssembler();
         return assembler.ToDTO(cargo);
     }
     catch (Exception exception)
     {
         throw new NDDDRemoteBookingException(exception.Message);
     }
 }
コード例 #3
0
 public IList <CargoRoutingDTO> ListAllCargos()
 {
     try
     {
         IList <Cargo> cargoList = CargoRepository.FindAll();
         var           dtoList   = new List <CargoRoutingDTO>(cargoList.Count);
         var           assembler = new CargoRoutingDTOAssembler();
         foreach (Cargo cargo in cargoList)
         {
             dtoList.Add(assembler.ToDTO(cargo));
         }
         return(dtoList);
     }
     catch (Exception exception)
     {
         throw new NDDDRemoteBookingException(exception.Message);
     }
 }
コード例 #4
0
 public IList<CargoRoutingDTO> ListAllCargos()
 {
     try
     {
         IList<Cargo> cargoList = CargoRepository.FindAll();
         var dtoList = new List<CargoRoutingDTO>(cargoList.Count);
         var assembler = new CargoRoutingDTOAssembler();
         foreach (Cargo cargo in cargoList)
         {
             dtoList.Add(assembler.ToDTO(cargo));
         }
         return dtoList;
     }
     catch (Exception exception)
     {
         throw new NDDDRemoteBookingException(exception.Message);
     }
 }