Ejemplo n.º 1
0
        private IEnumerable <FlatVM> CreateFlat(IEnumerable <Order> orh)
        {
            List <FlatVM> lflatvm = new List <FlatVM>();

            foreach (var item in orh)
            {
                foreach (var ord in item.Order_Details)
                {
                    var flatvm = new FlatVM();
                    flatvm.orderid        = item.OrderID;
                    flatvm.shipcity       = item.ShipCity;
                    flatvm.companynamea   = item.Shipper.CompanyName;        //shp
                    flatvm.numoflineitems = item.Order_Details.Count();

                    flatvm.ProductID = ord.ProductID;
                    flatvm.Quantity  = ord.Quantity;
                    flatvm.UnitPrice = ord.UnitPrice;
                    flatvm.Discount  = ord.Discount;

                    flatvm.ProductName = ord.Product.ProductName;           // prd

                    lflatvm.Add(flatvm);
                }
            }
            return(lflatvm);
        }
Ejemplo n.º 2
0
        private IEnumerable<FlatVM> CreateFlat(IEnumerable<Order> orh)
        {
            List<FlatVM> lflatvm = new List<FlatVM>();

            foreach (var item in orh)
            {

                foreach (var ord in item.Order_Details)
                {
                    var flatvm = new FlatVM();
                    flatvm.orderid = item.OrderID;
                    flatvm.shipcity = item.ShipCity;
                    flatvm.companynamea = item.Shipper.CompanyName;          //shp
                    flatvm.numoflineitems = item.Order_Details.Count();

                    flatvm.ProductID = ord.ProductID;
                    flatvm.Quantity = ord.Quantity;
                    flatvm.UnitPrice = ord.UnitPrice;
                    flatvm.Discount = ord.Discount;

                    flatvm.ProductName = ord.Product.ProductName;           // prd

                    lflatvm.Add(flatvm);
                }
            }
            return (lflatvm);
        }