public List <ShipmentAllDTO> GetAll()
        {
            var shipmentDTOs = new List <ShipmentAllDTO>();
            var shipments    = _shipmentRepository.GetAll();

            foreach (var shipment in shipments)
            {
                var shipmentDto = new ShipmentAllDTO();
                shipmentDto.CategoryId               = shipment.CategoryId;
                shipmentDto.CategoryName             = shipment.CategoryName;
                shipmentDto.Address                  = shipment.Address;
                shipmentDto.TotalProductsToBeShipped = shipment.TotalProductsToBeShipped;
                shipmentDTOs.Add(shipmentDto);
            }

            return(shipmentDTOs);
        }
Beispiel #2
0
 // GET: api/Shipments
 public IEnumerable <ShipmentsModel> GetShipments()
 {
     return(Mapper.Map <IEnumerable <ShipmentsModel> >(
                _shipmentRepository.GetAll()
                ));
 }
 public IActionResult Get()
 {
     return(Ok(_shipmentRepository.GetAll()));
 }
Beispiel #4
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     dataGridView1.DataSource = _shipmentRepository.GetAll();
 }
Beispiel #5
0
 public IEnumerable <ShipmentEntity> GetList()
 {
     return(_shipmentRepository.GetAll());
 }