/// <summary> /// Inventories the menu view. /// </summary> /// <param name="inventoryType">Type of the inventory.</param> public static void InventoryMenuview(string inventoryType) { int option = 0; while (true) { Console.WriteLine("--------------------------------------------"); Console.WriteLine("1.To view Existing Inventory for " + inventoryType); Console.WriteLine("2.To Remove an " + inventoryType + " Item"); Console.WriteLine("3.To Add " + inventoryType + " Item"); Console.WriteLine("4.To Edit from Existing " + inventoryType + " Inventory"); string stringOption = Console.ReadLine(); if (InventoryMngtUtility.IsNumber(stringOption) == false) { Console.WriteLine("Invalid input"); continue; } option = Convert.ToInt32(stringOption); //// Calls the mdethods based on the Option Choosen switch (option) { case 1: InventoryManager.GetInventoryList(inventoryType); break; case 2: InputForInventory.TakeInputForRemovingObject(inventoryType); break; case 3: InputForInventory.TakeInputsForCreatingObject(inventoryType); break; case 4: InventoryManipulationMenu.InventoryManipulationview(inventoryType); break; default: return; } } }
/// <summary> /// Starts the inventory manager. /// </summary> public static void StartInventoryManager() { int choice = 0; while (true) { Console.WriteLine("1.Rice"); Console.WriteLine("2.Wheat"); Console.WriteLine("3.Pulses"); Console.WriteLine("\nSelect an Inventory : "); string stringchoice = Console.ReadLine(); ////validate number if (InventoryMngtUtility.IsNumber(stringchoice) == false) { Console.WriteLine("\nInvalid Input"); continue; } ////Convert to integer choice = Convert.ToInt32(stringchoice); ////Calls the metods base on the Choosen choice. switch (choice) { case 1: InventoryMenu.InventoryMenuview("RICE"); break; case 2: InventoryMenu.InventoryMenuview("WHEAT"); break; case 3: InventoryMenu.InventoryMenuview("PULSES"); break; default: return; } } }