Example #1
0
        public ProductAnalysis HighestSellingProduct()
        {
            int             high = 0;
            ProductAnalysis pa   = new ProductAnalysis();


            foreach (var prod in db.ProductAnalysis.ToList())
            {
                if (prod.Product_Quantity > high)
                {
                    high = prod.Product_Quantity;
                    pa   = prod;
                }
            }
            return(pa);
        }
Example #2
0
        public ProductAnalysis LowestSellingProduct()
        {
            int low = HighestSellingProduct().Product_Quantity;


            ProductAnalysis pa = new ProductAnalysis();

            foreach (var prod in db.ProductAnalysis.ToList())
            {
                if (prod.Product_Quantity < low)
                {
                    low = prod.Product_Quantity;
                    pa  = prod;
                }
            }
            return(pa);
        }