public void DisplayAfterDeletion2(int num) { try { ProductDetailsFill objProductDetailsFill = new ProductDetailsFill(); List <ProductGroup> objListProductGroup = objProductDetailsFill.ProductGroupFill(); List <ProductInfo> objListproductInfo = objProductDetailsFill.ProductFill(); List <ProductInfo> objProductDelete2 = objProductDetailsFill.ProductDelete2(objListproductInfo, num); foreach (ProductGroup product1 in objListProductGroup) { foreach (ProductInfo product2 in objProductDelete2) { 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 void DisplayAfterDeletion2() { try { FindIndex objectFindIndex = new FindIndex(); ProductDetailsFill objectProductDetailsFill = new ProductDetailsFill(); List <ProductGroup> productGroup = objectProductDetailsFill.ProductGroupFill(); List <ProductInfo> productInfo = objectProductDetailsFill.ProductFill(); List <ProductInfo> productNew = objectProductDetailsFill.ProductDelete2(productInfo); foreach (ProductGroup item1 in productGroup) { foreach (ProductInfo item2 in productNew) { 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); } }