public ArrayList toListItemsResponse(List <OrderItemEntity> items) { ArrayList listResponse = new ArrayList(); foreach (OrderItemEntity oe in items) { CustomOrderItem csi = new CustomOrderItem(); listResponse.Add(csi.toCustomOrderItem(oe)); } return(listResponse); }
public CustomOrderItem toCustomOrderItem(OrderItemEntity orderItemEntity) { CustomOrderItem csi = new CustomOrderItem(); Product2DAO product2DAO = new Product2DAO(); csi.productID = orderItemEntity.ProductId; Product2 productItem = product2DAO.getProduct(csi.productID); //csi.productImg = productItem.Images[0].Image; csi.productName = productItem.Name; csi.pricePerOne = (double)productItem.OriginalPrice; csi.quatity = orderItemEntity.Quantity; csi.priceAll = csi.computePriceAllByProduct(); return(csi); }