private void ChangeProduct()
        {
            var products = productRepository.GetAll();

            var menu = new UI.SelectionMenu("Select which product to change", products.Select(r => r.Name).ToArray(), true);
            int sel  = menu.RenderAndSelect(true);

            if (sel == 0)
            {
                return;
            }
            var p = products[sel - 1];

            EditProduct(p);
        }
Beispiel #2
0
 public void Run()
 {
     while (true)
     {
         var menu = new UI.SelectionMenu("KASSA", new[] {
             "Ny kund",
         }, true);
         int sel = menu.RenderAndSelect(true);
         if (sel == 0)
         {
             break;
         }
         if (sel == 1)
         {
             CashRegisterDoCustomer();
         }
     }
 }
 public void Run()
 {
     while (true)
     {
         var menu = new UI.SelectionMenu("Admin", new[] {
             "Ny product",
             "Ändra product",
         }, true);
         int sel = menu.RenderAndSelect(true);
         if (sel == 0)
         {
             break;
         }
         if (sel == 1)
         {
             NewProduct();
         }
         if (sel == 2)
         {
             ChangeProduct();
         }
     }
 }