Ejemplo n.º 1
0
        public bool RunAndFindPurchase()
        {
            MenegerOfGoods    menegerOfGoods    = new MenegerOfGoods(goods);
            MenegerOfPurchase menegerOfPurchase = new MenegerOfPurchase(menegerOfGoods, purchases);

            var(name, isName) = menegerOfPurchase.FindName();
            if (isName)
            {
                purchases.Add(menegerOfPurchase.Add(name));
            }
            return(isName);
        }
Ejemplo n.º 2
0
        public void RunGood()
        {
            MenegerOfGoods menegerOfGoods = new MenegerOfGoods(goods);

            Console.WriteLine("If you want to add new good, click G if you want to delete good click D, if you want ro change good click C, if you want exit this program click Escape");
            var key = Console.ReadKey(true);

            if (key.Key == ConsoleKey.G)
            {
                menegerOfGoods.Add();
            }
            if (key.Key == ConsoleKey.D)
            {
                menegerOfGoods.Remove();
            }
            if (key.Key == ConsoleKey.C)
            {
                menegerOfGoods.Change();
            }
            if (key.Key == ConsoleKey.Escape)
            {
                throw new OperationCanceledException();
            }
        }
Ejemplo n.º 3
0
 public MenegerOfPurchase(MenegerOfGoods menegerOfGoods, List <Purchase> purchases)
 {
     this.MenegerOfGoods = menegerOfGoods;
     this.Purchases      = purchases;
 }