public void displaySortedProducts() { try { FindIndex objectFindIndex = new FindIndex(); ProductDetailsFill objectProductDetailsFill = new ProductDetailsFill(); List <ProductGroup> productGroup = objectProductDetailsFill.ProductGroupFill(); List <ProductInfo> productInfo = objectProductDetailsFill.ProductFill(); IEnumerable <ProductInfo> product = objectProductDetailsFill.ProductSort(productInfo); foreach (ProductGroup item1 in productGroup) { foreach (ProductInfo item2 in product) { if (item1.ID == item2.GroupID) { Console.WriteLine("Index: " + (objectFindIndex.Find(item2.Name)) + " || Product Group Name: " + item1.Name + " || Product Name: " + item2.Name + " || Product Description: " + item2.Description + " || Product Rate: " + item2.rate); } } } }catch (Exception ex) { Console.WriteLine(ex.Message); } }
public void DisplaySortedProducts() { try { ProductDetailsFill objProductDetailsFill = new ProductDetailsFill(); List <ProductGroup> objListProductGroup = objProductDetailsFill.ProductGroupFill(); List <ProductInfo> objListproductInfo = objProductDetailsFill.ProductFill(); IEnumerable <ProductInfo> EnumProductInfo = objProductDetailsFill.ProductSort(objListproductInfo); foreach (ProductGroup product1 in objListProductGroup) { foreach (ProductInfo product2 in EnumProductInfo) { if (product1.ProductGroupID == product2.GroupID) { Console.WriteLine("Product Group Name: " + product1.ProductGroupName + " || Product Name: " + product2.ProductName + " || Product Description: " + product2.ProductDescription + " || Product Rate: " + product2.ProductRate); } } } } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public IEnumerable <ProductInfo> testSort() { ProductDetailsFill objectProductDetailsFill = new ProductDetailsFill(); List <ProductInfo> productInfo = objectProductDetailsFill.ProductFill(); IEnumerable <ProductInfo> product = objectProductDetailsFill.ProductSort(productInfo); return(product); }