Exemple #1
0
        public static ClientShipment Cast(ShipmentDB order)
        {
            var newObject = new ClientShipment()
            {
                IdShipment        = order.IdShipment,
                Orders            = Cast(order.Orders),
                QuantityOrders    = order.Quantity,
                TotalWeigthOrders = order.TotalWeigthOrders,
                IdLoad            = order.IdLoad
            };

            return(newObject);
        }
Exemple #2
0
        public static ShipmentDB Cast(ShipmentDTO shipment)
        {
            var newObject = new ShipmentDB()
            {
                IdLoad            = shipment.IdLoad,
                Quantity          = shipment.Quantity,
                TotalWeigthOrders = shipment.TotalWeigthOrders,
                IdShipment        = shipment.IdShipment,
                Orders            = Cast(shipment.Orders)
            };

            return(newObject);
        }
Exemple #3
0
        public static IList <ShipmentDB> Cast(IList <ClientShipment> shipments)
        {
            var list = new List <ShipmentDB>();

            foreach (var ships in shipments)
            {
                var ship = new ShipmentDB()
                {
                    IdShipment        = ships.IdShipment,
                    Orders            = Cast(ships.Orders),
                    Quantity          = ships.QuantityOrders,
                    TotalWeigthOrders = ships.TotalWeigthOrders,
                    IdLoad            = ships.IdLoad
                };
                list.Add(ship);
            }

            return(list);
        }
Exemple #4
0
        public static IList <ShipmentDB> Cast(IEnumerable <ShipmentDTO> orders)
        {
            var shipmentList = new List <ShipmentDB>();

            foreach (var order in orders)
            {
                var newObject = new ShipmentDB()
                {
                    IdShipment        = order.IdShipment,
                    Orders            = Cast(order.Orders),
                    Quantity          = order.Quantity,
                    TotalWeigthOrders = order.TotalWeigthOrders,
                    IdLoad            = order.IdLoad
                };
                shipmentList.Add(newObject);
            }

            return(shipmentList);
        }
Exemple #5
0
 /// <summary>
 /// The Update method will upate a certain shipment that exists into a deleted load
 /// </summary>
 /// <param name="id">The id<see cref="int"/></param>
 /// <param name="shipment">The shipment<see cref="ShipmentDB"/></param>
 /// <returns>The <see cref="string"/></returns>
 public string Update(int id, ShipmentDB shipment)
 {
     _shipmentRepo.Update(id, shipment);
     return("updated succesfully");
 }