/// <summary> /// inventory data managements this instance /// </summary> public void DisplayAllData() { try { //// Reads the file from which is json format AllFilePaths paths = new AllFilePaths(); List <InventoryModelClass> items = InventoryMain.ReadFile(paths.InventoryItems); Console.WriteLine("Name\tweight\tRate\tAmount"); //// for loop to iterate a data from json file foreach (var item in items) { Console.WriteLine("{0}" + "\t" + "{1}" + " \t" + "{2}" + "\t" + "{3}", item.Name, item.Weight, item.Priceperkg, item.Priceperkg * item.Weight); } } catch (Exception ex) { Console.WriteLine(ex.Message); } }
/// <summary> /// Defines the entry point of the application. /// </summary> /// <param name="args">The arguments.</param> static void Main(string[] args) { char condition; do { Console.WriteLine("PRESS: 1 TO Inventory Data Management For Grocery"); Console.WriteLine("PRESS: 2 TO Regular Expression Demonstration"); Console.WriteLine("PRESS: 3 TO Stock OF Company"); Console.WriteLine("PRESS: 4 TO Inventory Managments"); Console.WriteLine("PRESS: 5 TO DeckOfCards"); Console.WriteLine("PRESS 6 TO Address Book"); Console.WriteLine("PRESS 7 For DeckOfCards Using Queue"); Console.WriteLine("PRESS 8 FOR Commercial Data Processing"); int ch = Convert.ToInt32(Console.ReadLine()); switch (ch) { case 1: InventoryDetails.InventoryMain details = new InventoryDetails.InventoryMain(); details.DisplayAllData(); break; case 2: RegularExapressionDemo.RegularExpression rx = new RegularExapressionDemo.RegularExpression(); rx.ReadData(); break; case 3: StockReport.StockFileRead stock = new StockReport.StockFileRead(); stock.DisplayStocks(); break; case 4: InventoryManagementProgram.UserView management = new InventoryManagementProgram.UserView(); management.InventoryManagementMethod(); break; case 5: DeckOfCards.DeckOfCards dc = new DeckOfCards.DeckOfCards(); dc.InitializeDeckOfCards(); break; case 6: AdressBook.AddressBookMethodCall addbook = new AdressBook.AddressBookMethodCall(); addbook.AddressBookstart(); break; case 7: DeckOfCards.DeckOfCards DeckCardsQueue = new DeckOfCards.DeckOfCards(); DeckCardsQueue.InitializeDeckOfCards(); break; case 8: CommercialDataProcessing.FirstView data = new CommercialDataProcessing.FirstView(); data.ShareProcessingStart(); break; } Console.WriteLine("enter 'Y' or 'y' if you want to continue:"); condition = Convert.ToChar(Console.ReadLine()); } while (condition == 'y' || condition == 'Y'); }