using System.Collections.Generic;
using System.Threading.Tasks;
public static string pN = "";
public static Dictionary<string, int> prodPrice = new Dictionary<string, int>();
static void Main(string[] args)
int choice = int.Parse(Console.ReadLine());
case 1: { Addnew(); break; }
case 2: { View(); break; }
case 3: { Delete(); break; }
case 4: { Transact(); break; }
Console.WriteLine("Good Bye! Thank you for transacting with us");
System.Threading.Thread.Sleep(2000);
Environment.Exit(0); break;
default: Console.WriteLine("Choice not in the menu, press key to continue."); break;
Console.WriteLine(err.Message + "Try again ...!");
Console.WriteLine("==============================================");
static void DisplayTitle()
Console.WriteLine(" +++ KD & MJ Shop (POS) +++ ");
static void DisplayMenu()
Console.WriteLine("\t1. Add a Product");
Console.WriteLine("\t2. View Product List");
Console.WriteLine("\t3. Delete a Product");
Console.WriteLine("\t4. Transact Sales");
Console.WriteLine("\t5. Exit Program");
Console.WriteLine("Make your choice: Type 1, 2,... or 5 for exit");
Console.WriteLine("= = = = = = < Add New Product > = = = = = =");
Console.Write("Product Name: ");
Console.Write("Product Price: ");
pP = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("! Product added to the system.");
Console.WriteLine("Press any key to continue, [x] to stop");
Console.WriteLine("! Product not added." + err.Message);
Console.WriteLine("Press any key to continue, [x] to stop");
while (Console.ReadKey(true).Key != ConsoleKey.X);
Console.WriteLine("= = = = = = < Product List View > = = = = = =");
foreach (KeyValuePair<string, int> kvG in prodPrice)
Console.WriteLine("Product Name: {0}", kvG.Key, kvG.Value);
Console.WriteLine(" Price: {1}", kvG.Key, kvG.Value);
Console.WriteLine("= = = = = = < Delete Product > = = = = = =");
foreach (KeyValuePair<string, int> kvG in prodPrice)
Console.Write("Product Name: ");
if (prodPrice.ContainsKey(pN))
Console.Write("Product was succefully deleted!");
Console.Write("Press any key to delete another, [x] to stop");
Console.Write("Product do not exists! Press any key to continue, [x] to stop");
while (Console.ReadKey(true).Key != ConsoleKey.X);
Console.WriteLine(" = = = = = = < Transact Sales > = = = = = =");
Console.WriteLine("Note:Press any key after selecting product to continue, [x] to stop transaction!");